client

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadResponseBody

func ReadResponseBody(resp *http.Response) ([]byte, error)

ReadResponseBody reads the full body from an HTTP response with a 10 MB limit.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the HTTP client for Jamf Pro API

func New

func New(baseURL string, authProvider auth.Provider, opts ...Option) *Client

New creates a new Jamf Pro API client

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, body io.Reader) (*http.Response, error)

Do executes an HTTP request with authentication and retry logic

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, path string, body io.Reader, contentType string, contentLength int64) (*http.Response, error)

Upload executes a streaming HTTP request with a caller-specified Content-Type and Content-Length. Unlike Do, it does not buffer the body (supporting multi-GB files) and does not retry (the body stream cannot be replayed).

type Option

type Option func(*Client)

Option configures the client

func WithCookieJar

func WithCookieJar(jar http.CookieJar) Option

WithCookieJar sets the cookie jar on the HTTP client. Sharing a jar with the auth provider enables sticky session affinity cookies (e.g. APBALANCEID on Jamf Cloud) to persist from the token exchange through all API calls.

func WithTenantID

func WithTenantID(id string) Option

WithTenantID enables platform gateway mode, where API paths are rewritten to include the tenant identifier for routing through the Jamf Platform Gateway.

func WithVerbose

func WithVerbose(v bool) Option

WithVerbose enables verbose logging

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL