Versions in this module Expand all Collapse all v0 v0.0.6 Oct 3, 2023 Changes in this version + const DefaultTimeout + const SDKVersion + const UserAgentBase + func CheckDeprecationHeader(resp *http.Response, logger Logger) + func EnsureHTTPScheme(url string) string + func GetUserAgent() string + func ParseISO8601Date(dateStr string) (time.Time, error) + type APIError struct + Message string + StatusCode int + func (e *APIError) Error() string + type APIHandler interface + GetContentType func(method string) string + MarshalRequest func(body interface{}, method string) ([]byte, error) + SetDebugMode func(debug bool) + SetLogger func(logger Logger) + UnmarshalResponse func(resp *http.Response, out interface{}) error + func GetAPIHandler(endpoint string, debugMode bool) APIHandler + type BearerTokenAuthCredentials struct + Password string + Username string + type ClassicApiHandler struct + func (h *ClassicApiHandler) GetContentType(method string) string + func (h *ClassicApiHandler) MarshalRequest(body interface{}, method string) ([]byte, error) + func (h *ClassicApiHandler) SetDebugMode(debug bool) + func (h *ClassicApiHandler) SetLogger(logger Logger) + func (h *ClassicApiHandler) UnmarshalResponse(resp *http.Response, out interface{}) error + type Client struct + BaseURL string + ConcurrencyMgr *ConcurrencyManager + Expiry time.Time + Token string + func NewClient(baseURL string, config Config, logger Logger, options ...ClientOption) *Client + func (c *Client) Delete(endpoint string, out interface{}) (*http.Response, error) + func (c *Client) DoRequest(method, endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) Get(endpoint string, out interface{}) (*http.Response, error) + func (c *Client) InvalidateOAuthToken() error + func (c *Client) ObtainOAuthToken(credentials OAuthCredentials) error + func (c *Client) ObtainToken() error + func (c *Client) Patch(endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) Post(endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) Put(endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) RefreshOAuthToken() error + func (c *Client) RefreshToken() error + func (c *Client) SetBearerTokenAuthCredentials(credentials BearerTokenAuthCredentials) + func (c *Client) SetOAuthCredentials(credentials OAuthCredentials) + func (c *Client) ValidAuthTokenCheck() bool + type ClientAuthConfig struct + BaseURL string + ClientID string + ClientSecret string + Password string + Username string + func LoadClientAuthConfig(filename string) (*ClientAuthConfig, error) + type ClientOption func(*Client) + type ConcurrencyManager struct + func NewConcurrencyManager(limit int, logger Logger, debugMode bool) *ConcurrencyManager + func (c *ConcurrencyManager) Acquire(ctx context.Context) (uuid.UUID, error) + func (c *ConcurrencyManager) Release(requestID uuid.UUID) + type Config struct + BufferPeriod time.Duration + CustomBackoff func(attempt int) time.Duration + DebugMode bool + EnableDynamicRateLimiting bool + Logger Logger + MaxConcurrentRequests int + MaxRetryAttempts int + TokenLifespan time.Duration + TotalRetryDuration time.Duration + type JamfProApiHandler struct + func (h *JamfProApiHandler) GetContentType(method string) string + func (h *JamfProApiHandler) MarshalRequest(body interface{}, method string) ([]byte, error) + func (h *JamfProApiHandler) SetDebugMode(debug bool) + func (h *JamfProApiHandler) SetLogger(logger Logger) + func (h *JamfProApiHandler) UnmarshalResponse(resp *http.Response, out interface{}) error + type Logger interface + Debug func(msg string, keysAndValues ...interface{}) + Error func(msg string, keysAndValues ...interface{}) + Fatal func(msg string, keysAndValues ...interface{}) + Info func(msg string, keysAndValues ...interface{}) + Trace func(msg string, keysAndValues ...interface{}) + Warn func(msg string, keysAndValues ...interface{}) + func NewDefaultLogger() Logger + type OAuthCredentials struct + ClientID string + ClientSecret string + type OAuthResponse struct + AccessToken string + Error string + ExpiresIn int64 + RefreshToken string + TokenType string + type StructuredError struct + Error struct{ ... } + type TokenResponse struct + Expires time.Time + Token string + type UnknownApiHandler struct + func (h *UnknownApiHandler) GetContentType(method string) string + func (h *UnknownApiHandler) MarshalRequest(body interface{}, method string) ([]byte, error) + func (h *UnknownApiHandler) SetDebugMode(debug bool) + func (h *UnknownApiHandler) SetLogger(logger Logger) + func (h *UnknownApiHandler) UnmarshalResponse(resp *http.Response, out interface{}) error