axm

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound added in v0.3.1

func IsNotFound(err error) bool

IsNotFound returns true when err is an API 404 response. Use this in cleanup functions to treat "already deleted" as non-fatal.

func LoadPrivateKeyFromFile added in v0.3.1

func LoadPrivateKeyFromFile(filePath string) (any, error)

LoadPrivateKeyFromFile reads and parses a private key from a .p8 file path.

func ParsePrivateKey added in v0.3.1

func ParsePrivateKey(keyData []byte) (any, error)

ParsePrivateKey parses a PEM-encoded private key (ECDSA or RSA) from bytes.

Types

type AXMAPIClient added in v0.3.1

type AXMAPIClient struct {
	Devices          *devices.DevicesService
	DeviceManagement *devicemanagement.DeviceManagementService
}

AXMAPIClient groups all Apple Business Manager API services.

type Client

type Client struct {
	AXMAPI *AXMAPIClient
	// contains filtered or unexported fields
}

Client is the main entry point for the Apple Business Manager API SDK.

func NewClient

func NewClient(keyID, issuerID string, privateKey any, options ...client.ClientOption) (*Client, error)

NewClient creates a new Apple Business Manager client. Parameters:

  • keyID: Your Apple Developer Key ID
  • issuerID: Your Apple Developer Issuer ID (Team ID)
  • privateKey: Your Apple Developer private key (*rsa.PrivateKey or *ecdsa.PrivateKey)
  • options: Optional configuration options (WithLogger, WithTimeout, etc.)

func NewClientFromEnv

func NewClientFromEnv(options ...client.ClientOption) (*Client, error)

NewClientFromEnv creates a client using environment variables. Expects: APPLE_KEY_ID, APPLE_ISSUER_ID, APPLE_PRIVATE_KEY_PATH Parameters:

  • options: Optional configuration options (WithLogger, WithTimeout, etc.)

func NewClientFromFile

func NewClientFromFile(keyID, issuerID, privateKeyPath string, options ...client.ClientOption) (*Client, error)

NewClientFromFile creates a client using private key from file. Parameters:

  • keyID: Your Apple Developer Key ID
  • issuerID: Your Apple Developer Issuer ID (Team ID)
  • privateKeyPath: Path to your Apple Developer private key file (.p8)
  • options: Optional configuration options (WithLogger, WithTimeout, etc.)

type ClientOption added in v0.3.1

type ClientOption = client.ClientOption

ClientOption configures the Apple Business Manager API transport at construction time. Pass one or more ClientOption values to NewClient, NewClientFromFile, or NewClientFromEnv.

func WithAudience added in v0.3.1

func WithAudience(audience string) ClientOption

WithAudience sets a custom JWT audience (default: "appstoreconnect-v1").

func WithBaseURL added in v0.3.1

func WithBaseURL(baseURL string) ClientOption

WithBaseURL sets a custom base URL, overriding the default Apple Business Manager endpoint.

func WithClientCertificate added in v0.3.1

func WithClientCertificate(certFile, keyFile string) ClientOption

WithClientCertificate sets a client certificate for mutual TLS authentication.

func WithClientCertificateFromString added in v0.3.1

func WithClientCertificateFromString(certPEM, keyPEM string) ClientOption

WithClientCertificateFromString sets a client certificate from PEM-encoded strings.

func WithCustomAgent added in v0.3.1

func WithCustomAgent(customAgent string) ClientOption

WithCustomAgent appends a custom identifier to the default user agent.

func WithDebug added in v0.3.1

func WithDebug() ClientOption

WithDebug enables resty's request/response debug logging.

func WithGlobalHeader added in v0.3.1

func WithGlobalHeader(key, value string) ClientOption

WithGlobalHeader adds a single header to every outgoing request.

func WithGlobalHeaders added in v0.3.1

func WithGlobalHeaders(headers map[string]string) ClientOption

WithGlobalHeaders adds multiple headers to every outgoing request.

func WithInsecureSkipVerify added in v0.3.1

func WithInsecureSkipVerify() ClientOption

WithInsecureSkipVerify disables TLS certificate verification (use only for testing).

func WithLogger added in v0.3.1

func WithLogger(logger *zap.Logger) ClientOption

WithLogger sets a custom zap logger. Returns an error if logger is nil.

func WithMinTLSVersion added in v0.3.1

func WithMinTLSVersion(minVersion uint16) ClientOption

WithMinTLSVersion sets the minimum TLS version for connections.

func WithProxy added in v0.3.1

func WithProxy(proxyURL string) ClientOption

WithProxy sets an HTTP proxy for all requests.

func WithRetryCount added in v0.3.1

func WithRetryCount(count int) ClientOption

WithRetryCount sets the maximum number of retries for failed requests.

func WithRetryMaxWaitTime added in v0.3.1

func WithRetryMaxWaitTime(maxWaitTime time.Duration) ClientOption

WithRetryMaxWaitTime sets the maximum wait time between retry attempts.

func WithRetryWaitTime added in v0.3.1

func WithRetryWaitTime(waitTime time.Duration) ClientOption

WithRetryWaitTime sets the initial wait time between retry attempts.

func WithRootCertificateFromString added in v0.3.1

func WithRootCertificateFromString(pemContent string) ClientOption

WithRootCertificateFromString adds a custom root CA certificate from PEM string.

func WithRootCertificates added in v0.3.1

func WithRootCertificates(pemFilePaths ...string) ClientOption

WithRootCertificates adds custom root CA certificates for server validation.

func WithScope added in v0.3.1

func WithScope(scope string) ClientOption

WithScope sets a custom JWT scope (default: "business.api").

func WithTLSClientConfig added in v0.3.1

func WithTLSClientConfig(tlsConfig *tls.Config) ClientOption

WithTLSClientConfig sets custom TLS configuration.

func WithTimeout added in v0.3.1

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets the timeout for all HTTP requests.

func WithTransport added in v0.3.1

func WithTransport(transport http.RoundTripper) ClientOption

WithTransport sets a custom HTTP transport (http.RoundTripper).

func WithUserAgent added in v0.3.1

func WithUserAgent(userAgent string) ClientOption

WithUserAgent sets a custom user-agent string.

Directories

Path Synopsis
axm_api

Jump to

Keyboard shortcuts

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