Documentation
¶
Index ¶
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
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
SerialNumber string `json:"serial_number"`
Model string `json:"model"`
Description string `json:"description"`
Color string `json:"color"`
AssetTag string `json:"asset_tag"`
ProfileStatus string `json:"profile_status"`
ProfileUUID string `json:"profile_uuid"`
ProfileAssignTime time.Time `json:"profile_assign_time"`
DeviceAssignedBy string `json:"device_assigned_by"`
DeviceAssignedDate time.Time `json:"device_assigned_date"`
OpType string `json:"op_type,omitempty"`
OpDate time.Time `json:"op_date,omitempty"`
}
Legacy Device struct for backward compatibility
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) 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)
}
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