Documentation
¶
Overview ¶
apiintegrations/apihandler/apihandler.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶
type APIHandler interface {
ConstructAPIResourceEndpoint(instanceName string, endpointPath string, log logger.Logger) string
ConstructAPIAuthEndpoint(instanceName string, endpointPath string, log logger.Logger) string
MarshalRequest(body interface{}, method string, endpoint string, log logger.Logger) ([]byte, error)
MarshalMultipartRequest(fields map[string]string, files map[string]string, log logger.Logger) ([]byte, string, error)
HandleAPISuccessResponse(resp *http.Response, out interface{}, log logger.Logger) error
HandleAPIErrorResponse(resp *http.Response, out interface{}, log logger.Logger) error
GetContentTypeHeader(method string, log logger.Logger) string
GetAcceptHeader() string
GetDefaultBaseDomain() string
GetOAuthTokenEndpoint() string
GetBearerTokenEndpoint() string
GetTokenRefreshEndpoint() string
GetTokenInvalidateEndpoint() string
GetAPIBearerTokenAuthenticationSupportStatus() bool
GetAPIOAuthAuthenticationSupportStatus() bool
GetAPIOAuthWithCertAuthenticationSupportStatus() bool
GetAPIRequestHeaders(endpoint string) map[string]string // Provides standard headers required for making API requests.
}
APIHandler is an interface for encoding, decoding, and implenting contexual api functions for different API implementations. It encapsulates behavior for encoding and decoding requests and responses.
func LoadAPIHandler ¶
func LoadAPIHandler(apiType string, log logger.Logger) (APIHandler, error)
LoadAPIHandler returns an APIHandler based on the provided API type. 'apiType' parameter could be "jamf" or "graph" to specify which API handler to load.
Click to show internal directories.
Click to hide internal directories.