Documentation
¶
Index ¶
- Constants
- type AppleCareCoverage
- type AppleCareCoverageAttributes
- type AppleCareCoverageResponse
- type DevicesService
- func (s *DevicesService) GetAppleCareInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*AppleCareCoverageResponse, error)
- func (s *DevicesService) GetDeviceInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*OrgDeviceResponse, error)
- func (s *DevicesService) GetOrganizationDevices(ctx context.Context, opts *RequestQueryOptions) (*OrgDevicesResponse, error)
- type DevicesServiceInterface
- type Links
- type Meta
- type OrgDevice
- type OrgDeviceAttributes
- type OrgDeviceFilter
- type OrgDeviceResponse
- type OrgDevicesResponse
- type Paging
- type RequestQueryOptions
Constants ¶
const ( ProfileStatusEmpty = "empty" ProfileStatusAssigned = "assigned" ProfileStatusPushed = "pushed" ProfileStatusRemoved = "removed" )
ProfileStatus constants for device profile status
const ( ModeliPhone = "iPhone" ModeliPad = "iPad" ModelMac = "Mac" ModelAppleTV = "Apple TV" ModelAppleWatch = "Apple Watch" )
DeviceModel constants for common device models
const ( ColorSilver = "Silver" ColorGold = "Gold" ColorSpaceGray = "Space Gray" ColorRoseGold = "Rose Gold" ColorBlack = "Black" ColorWhite = "White" ColorRed = "Red" ColorBlue = "Blue" ColorGreen = "Green" ColorYellow = "Yellow" ColorPurple = "Purple" )
DeviceColor constants for device colors
const ( FieldSerialNumber = "serialNumber" FieldAddedToOrgDateTime = "addedToOrgDateTime" FieldUpdatedDateTime = "updatedDateTime" FieldDeviceModel = "deviceModel" FieldProductFamily = "productFamily" FieldProductType = "productType" FieldDeviceCapacity = "deviceCapacity" FieldPartNumber = "partNumber" FieldOrderNumber = "orderNumber" FieldColor = "color" FieldStatus = "status" FieldOrderDateTime = "orderDateTime" FieldIMEI = "imei" FieldMEID = "meid" FieldEID = "eid" FieldWiFiMACAddress = "wifiMacAddress" FieldBluetoothMACAddress = "bluetoothMacAddress" FieldPurchaseSourceUid = "purchaseSourceUid" FieldPurchaseSourceType = "purchaseSourceType" FieldAssignedServer = "assignedServer" )
OrgDevice field constants for field selection
const ( StatusActive = "active" StatusInactive = "inactive" )
Device status constants
const ( ProductFamilyiPhone = "iPhone" ProductFamilyiPad = "iPad" ProductFamilyMac = "Mac" )
Product family constants
const ( FieldAppleCareStatus = "status" FieldAppleCarePaymentType = "paymentType" FieldAppleCareDescription = "description" FieldAppleCareAgreementNumber = "agreementNumber" FieldAppleCareStartDateTime = "startDateTime" FieldAppleCareEndDateTime = "endDateTime" FieldAppleCareIsRenewable = "isRenewable" FieldAppleCareIsCanceled = "isCanceled" FieldAppleCareContractCancelDateTime = "contractCancelDateTime" )
AppleCare coverage field constants for field selection
const ( AppleCareStatusActive = "ACTIVE" AppleCareStatusInactive = "INACTIVE" AppleCareStatusExpired = "EXPIRED" )
AppleCare coverage status constants
const ( PaymentTypeNone = "NONE" PaymentTypeSubscription = "SUBSCRIPTION" PaymentTypeABESubscription = "ABE_SUBSCRIPTION" )
AppleCare payment type constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppleCareCoverage ¶ added in v0.3.0
type AppleCareCoverage struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes *AppleCareCoverageAttributes `json:"attributes,omitempty"`
}
AppleCareCoverage represents AppleCare coverage for a device
type AppleCareCoverageAttributes ¶ added in v0.3.0
type AppleCareCoverageAttributes struct {
Status string `json:"status,omitempty"`
PaymentType string `json:"paymentType,omitempty"`
Description string `json:"description,omitempty"`
AgreementNumber *string `json:"agreementNumber,omitempty"`
StartDateTime *time.Time `json:"startDateTime,omitempty"`
EndDateTime *time.Time `json:"endDateTime,omitempty"`
IsRenewable bool `json:"isRenewable,omitempty"`
IsCanceled bool `json:"isCanceled,omitempty"`
ContractCancelDateTime *time.Time `json:"contractCancelDateTime,omitempty"`
}
AppleCareCoverageAttributes contains the AppleCare coverage attributes
type AppleCareCoverageResponse ¶ added in v0.3.0
type AppleCareCoverageResponse struct {
Data []AppleCareCoverage `json:"data"`
Links *Links `json:"links,omitempty"`
Meta *Meta `json:"meta,omitempty"`
}
AppleCareCoverageResponse represents the response for getting AppleCare coverage
type DevicesService ¶
type DevicesService struct {
// contains filtered or unexported fields
}
DevicetService handles communication with the device related methods of the Apple Business Manager API.
Apple Business Manager API docs: https://developer.apple.com/documentation/applebusinessmanagerapi/
func NewService ¶
func NewService(client interfaces.HTTPClient) *DevicesService
NewService creates a new devices service
func (*DevicesService) GetAppleCareInformationByDeviceID ¶ added in v0.3.0
func (s *DevicesService) GetAppleCareInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*AppleCareCoverageResponse, error)
GetAppleCareInformationByDeviceID retrieves AppleCare coverage information for a specific device URL: GET https://api-business.apple.com/v1/orgDevices/{id}/appleCareCoverage https://developer.apple.com/documentation/applebusinessmanagerapi/get-all-apple-care-coverage-for-an-orgdevice
func (*DevicesService) GetDeviceInformationByDeviceID ¶
func (s *DevicesService) GetDeviceInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*OrgDeviceResponse, error)
GetDeviceInformationByDeviceID retrieves information about a specific device in an organization URL: GET https://api-business.apple.com/v1/orgDevices/{id} https://developer.apple.com/documentation/applebusinessmanagerapi/get-orgdevice-information
func (*DevicesService) GetOrganizationDevices ¶
func (s *DevicesService) GetOrganizationDevices(ctx context.Context, opts *RequestQueryOptions) (*OrgDevicesResponse, error)
GetOrganizationDevices retrieves a list of devices in an organization that enroll using Automated Device Enrollment URL: GET https://api-business.apple.com/v1/orgDevices https://developer.apple.com/documentation/applebusinessmanagerapi/get-org-devices
type DevicesServiceInterface ¶
type DevicesServiceInterface interface {
// GetOrganizationDevices retrieves a list of devices in an organization
// that enroll using Automated Device Enrollment.
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/get-org-devices
GetOrganizationDevices(ctx context.Context, opts *RequestQueryOptions) (*OrgDevicesResponse, error)
// GetDeviceInformationByDeviceID retrieves information about a specific device
// in an organization.
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/get-orgdevice-information
GetDeviceInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*OrgDeviceResponse, error)
// GetAppleCareInformationByDeviceID retrieves AppleCare coverage information
// for a specific device.
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/get-all-apple-care-coverage-for-an-orgdevice
GetAppleCareInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*AppleCareCoverageResponse, error)
}
DevicesServiceInterface defines the interface for device operations.
type Meta ¶
type Meta struct {
Paging *Paging `json:"paging,omitempty"`
}
Shared types for pagination and links
type OrgDevice ¶
type OrgDevice struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes *OrgDeviceAttributes `json:"attributes,omitempty"`
}
OrgDevice represents a device in the Apple Business Manager system based on the API specification
type OrgDeviceAttributes ¶
type OrgDeviceAttributes struct {
SerialNumber string `json:"serialNumber,omitempty"`
AddedToOrgDateTime *time.Time `json:"addedToOrgDateTime,omitempty"`
UpdatedDateTime *time.Time `json:"updatedDateTime,omitempty"`
DeviceModel string `json:"deviceModel,omitempty"`
ProductFamily string `json:"productFamily,omitempty"`
ProductType string `json:"productType,omitempty"`
DeviceCapacity string `json:"deviceCapacity,omitempty"`
PartNumber string `json:"partNumber,omitempty"`
OrderNumber string `json:"orderNumber,omitempty"`
Color string `json:"color,omitempty"`
Status string `json:"status,omitempty"`
OrderDateTime *time.Time `json:"orderDateTime,omitempty"`
IMEI []string `json:"imei,omitempty"`
MEID []string `json:"meid,omitempty"`
EID string `json:"eid,omitempty"`
WiFiMACAddress string `json:"wifiMacAddress,omitempty"`
BluetoothMACAddress string `json:"bluetoothMacAddress,omitempty"`
PurchaseSourceUid string `json:"purchaseSourceUid,omitempty"`
PurchaseSourceType string `json:"purchaseSourceType,omitempty"`
AssignedServer string `json:"assignedServer,omitempty"`
}
OrgDeviceAttributes contains the device attributes
type OrgDeviceFilter ¶
type OrgDeviceFilter struct {
SerialNumber string `json:"serialNumber,omitempty"`
DeviceModel string `json:"deviceModel,omitempty"`
ProductFamily string `json:"productFamily,omitempty"`
Color string `json:"color,omitempty"`
Status string `json:"status,omitempty"`
}
OrgDeviceFilter represents filter options for organization devices
type OrgDeviceResponse ¶
type OrgDeviceResponse struct {
Data OrgDevice `json:"data"`
}
OrgDeviceResponse represents the response for a single device
type OrgDevicesResponse ¶
type OrgDevicesResponse struct {
Data []OrgDevice `json:"data"`
Meta *Meta `json:"meta,omitempty"`
Links *Links `json:"links,omitempty"`
}
OrgDevicesResponse represents the response for getting organization devices
type RequestQueryOptions ¶
type RequestQueryOptions struct {
// Field selection - fields to return for orgDevices
// Possible values: serialNumber, addedToOrgDateTime, updatedDateTime, deviceModel,
// productFamily, productType, deviceCapacity, partNumber, orderNumber, color, status,
// orderDateTime, imei, meid, eid, wifiMacAddress, bluetoothMacAddress, purchaseSourceId,
// purchaseSourceType, assignedServer
Fields []string `json:"fields,omitempty"`
// Limit the number of included related resources to return (max 1000)
Limit int `json:"limit,omitempty"`
}
RequestQueryOptions represents the query parameters for getting organization devices