Documentation
¶
Index ¶
- Constants
- type AssignedServerLinks
- type DeviceManagementService
- func (s *DeviceManagementService) AssignDevicesToServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*ResponseOrgDeviceActivity, error)
- func (s *DeviceManagementService) GetAssignedDeviceManagementServiceIDForADevice(ctx context.Context, deviceID string) (*ResponseOrgDeviceAssignedServerLinkage, error)
- func (s *DeviceManagementService) GetAssignedDeviceManagementServiceInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*MDMServerResponse, error)
- func (s *DeviceManagementService) GetDeviceManagementServices(ctx context.Context, opts *RequestQueryOptions) (*ResponseMDMServers, error)
- func (s *DeviceManagementService) GetMDMServerDeviceLinkages(ctx context.Context, mdmServerID string, opts *RequestQueryOptions) (*ResponseMDMServerDevicesLinkages, error)
- func (s *DeviceManagementService) UnassignDevicesFromServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*ResponseOrgDeviceActivity, error)
- type DeviceManagementServiceInterface
- type Links
- type MDMServer
- type MDMServerAttributes
- type MDMServerDeviceLinkage
- type MDMServerDevicesLinks
- type MDMServerDevicesRelationship
- type MDMServerRelationships
- type MDMServerResponse
- type Meta
- type OrgDeviceActivity
- type OrgDeviceActivityAttributes
- type OrgDeviceActivityCreateAttributes
- type OrgDeviceActivityCreateRelationships
- type OrgDeviceActivityCreateRequest
- type OrgDeviceActivityData
- type OrgDeviceActivityDeviceLinkage
- type OrgDeviceActivityDevicesRelationship
- type OrgDeviceActivityLinks
- type OrgDeviceActivityMDMServerLinkage
- type OrgDeviceActivityMDMServerRelationship
- type OrgDeviceAssignedServerLinkage
- type Paging
- type RequestQueryOptions
- type ResponseMDMServerDevicesLinkages
- type ResponseMDMServers
- type ResponseOrgDeviceActivity
- type ResponseOrgDeviceAssignedServerLinkage
Constants ¶
const ( ActivityTypeAssignDevices = "ASSIGN_DEVICES" ActivityTypeUnassignDevices = "UNASSIGN_DEVICES" )
Activity type constants
const ( ActivityStatusInProgress = "IN_PROGRESS" ActivityStatusCompleted = "COMPLETED" ActivityStatusFailed = "FAILED" )
Activity status constants
const ( ActivitySubStatusSubmitted = "SUBMITTED" ActivitySubStatusProcessing = "PROCESSING" )
Activity sub-status constants
const ( FieldServerName = "serverName" FieldServerType = "serverType" FieldCreatedDateTime = "createdDateTime" FieldUpdatedDateTime = "updatedDateTime" FieldDevices = "devices" )
MDM Server field constants for field selection
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignedServerLinks ¶
type AssignedServerLinks struct {
Self string `json:"self,omitempty"`
Related string `json:"related,omitempty"`
}
AssignedServerLinks contains linkage navigation links
type DeviceManagementService ¶
type DeviceManagementService struct {
// contains filtered or unexported fields
}
DeviceManagementService handles communication with the device management 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) *DeviceManagementService
NewService creates a new device management service
func (*DeviceManagementService) AssignDevicesToServer ¶
func (s *DeviceManagementService) AssignDevicesToServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*ResponseOrgDeviceActivity, error)
AssignDevicesToServer assigns devices to an MDM server URL: POST https://api-business.apple.com/v1/orgDeviceActivities https://developer.apple.com/documentation/applebusinessmanagerapi/create-an-orgdeviceactivity
func (*DeviceManagementService) GetAssignedDeviceManagementServiceIDForADevice ¶
func (s *DeviceManagementService) GetAssignedDeviceManagementServiceIDForADevice(ctx context.Context, deviceID string) (*ResponseOrgDeviceAssignedServerLinkage, error)
GetAssignedDeviceManagementServiceIDForADevice retrieves the assigned device management service ID linkage for a device URL: GET https://api-business.apple.com/v1/orgDevices/{id}/relationships/assignedServer https://developer.apple.com/documentation/applebusinessmanagerapi/get-the-assigned-server-id-for-an-orgdevice
func (*DeviceManagementService) GetAssignedDeviceManagementServiceInformationByDeviceID ¶
func (s *DeviceManagementService) GetAssignedDeviceManagementServiceInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*MDMServerResponse, error)
GetAssignedDeviceManagementServiceInformationByDeviceID retrieves the assigned device management service information for a device URL: GET https://api-business.apple.com/v1/orgDevices/{id}/assignedServer https://developer.apple.com/documentation/applebusinessmanagerapi/get-the-assigned-server-information-for-an-orgdevice
func (*DeviceManagementService) GetDeviceManagementServices ¶
func (s *DeviceManagementService) GetDeviceManagementServices(ctx context.Context, opts *RequestQueryOptions) (*ResponseMDMServers, error)
GetDeviceManagementServices retrieves a list of device management services (MDM servers) in an organization URL: GET https://api-business.apple.com/v1/mdmServers https://developer.apple.com/documentation/applebusinessmanagerapi/get-mdm-servers
func (*DeviceManagementService) GetMDMServerDeviceLinkages ¶
func (s *DeviceManagementService) GetMDMServerDeviceLinkages(ctx context.Context, mdmServerID string, opts *RequestQueryOptions) (*ResponseMDMServerDevicesLinkages, error)
GetMDMServerDeviceLinkages retrieves a list of device IDs assigned to an MDM server URL: GET https://api-business.apple.com/v1/mdmServers/{id}/relationships/devices https://developer.apple.com/documentation/applebusinessmanagerapi/get-all-device-ids-for-a-mdmserver
func (*DeviceManagementService) UnassignDevicesFromServer ¶
func (s *DeviceManagementService) UnassignDevicesFromServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*ResponseOrgDeviceActivity, error)
UnassignDevicesFromServer unassigns devices from an MDM server URL: POST https://api-business.apple.com/v1/orgDeviceActivities https://developer.apple.com/documentation/applebusinessmanagerapi/create-an-orgdeviceactivity
type DeviceManagementServiceInterface ¶
type DeviceManagementServiceInterface interface {
// GetDeviceManagementServices retrieves a list of device management services (MDM servers) in an organization
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/get-mdm-servers
GetDeviceManagementServices(ctx context.Context, opts *RequestQueryOptions) (*ResponseMDMServers, error)
// GetMDMServerDeviceLinkages retrieves a list of device IDs assigned to an MDM server
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/get-all-device-ids-for-a-mdmserver
GetMDMServerDeviceLinkages(ctx context.Context, mdmServerID string, opts *RequestQueryOptions) (*ResponseMDMServerDevicesLinkages, error)
// GetAssignedDeviceManagementServiceIDForADevice retrieves the assigned device management service ID linkage for a device
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/get-the-assigned-server-id-for-an-orgdevice
GetAssignedDeviceManagementServiceIDForADevice(ctx context.Context, deviceID string) (*ResponseOrgDeviceAssignedServerLinkage, error)
// GetAssignedDeviceManagementServiceInformationByDeviceID retrieves the assigned device management service information for a device
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/get-the-assigned-server-information-for-an-orgdevice
GetAssignedDeviceManagementServiceInformationByDeviceID(ctx context.Context, deviceID string, opts *RequestQueryOptions) (*MDMServerResponse, error)
// AssignDevicesToServer assigns devices to an MDM server
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/create-an-orgdeviceactivity
AssignDevicesToServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*ResponseOrgDeviceActivity, error)
// UnassignDevicesFromServer unassigns devices from an MDM server
//
// Apple Business Manager API docs:
// https://developer.apple.com/documentation/applebusinessmanagerapi/create-an-orgdeviceactivity
UnassignDevicesFromServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*ResponseOrgDeviceActivity, error)
}
DeviceManagementServiceInterface defines the interface for device management operations
type Links ¶
type Links struct {
Self string `json:"self,omitempty"`
First string `json:"first,omitempty"`
Next string `json:"next,omitempty"`
Prev string `json:"prev,omitempty"`
Last string `json:"last,omitempty"`
}
Links contains navigation links for API responses
type MDMServer ¶
type MDMServer struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes *MDMServerAttributes `json:"attributes,omitempty"`
Relationships *MDMServerRelationships `json:"relationships,omitempty"`
}
MDMServer represents an MDM server in the Apple Business Manager system
type MDMServerAttributes ¶
type MDMServerAttributes struct {
ServerName string `json:"serverName,omitempty"`
ServerType string `json:"serverType,omitempty"`
CreatedDateTime *time.Time `json:"createdDateTime,omitempty"`
UpdatedDateTime *time.Time `json:"updatedDateTime,omitempty"`
Devices []string `json:"devices,omitempty"`
}
MDMServerAttributes contains the MDM server attributes
type MDMServerDeviceLinkage ¶
type MDMServerDeviceLinkage struct {
Type string `json:"type"` // Should be "orgDevices"
ID string `json:"id"` // Device ID
}
MDMServerDeviceLinkage represents a device linkage in the MDM server relationships
type MDMServerDevicesLinks ¶
type MDMServerDevicesLinks struct {
Self string `json:"self,omitempty"`
}
MDMServerDevicesLinks contains the navigation links for devices
type MDMServerDevicesRelationship ¶
type MDMServerDevicesRelationship struct {
Links *MDMServerDevicesLinks `json:"links,omitempty"`
}
MDMServerDevicesRelationship contains the devices relationship links
type MDMServerRelationships ¶
type MDMServerRelationships struct {
Devices *MDMServerDevicesRelationship `json:"devices,omitempty"`
}
MDMServerRelationships contains the MDM server relationships
type MDMServerResponse ¶
type MDMServerResponse struct {
Data MDMServer `json:"data"`
Links *Links `json:"links,omitempty"`
}
MDMServerResponse represents the response for getting a single MDM server
type Meta ¶
type Meta struct {
Paging *Paging `json:"paging,omitempty"`
}
Meta represents pagination metadata
type OrgDeviceActivity ¶
type OrgDeviceActivity struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes *OrgDeviceActivityAttributes `json:"attributes,omitempty"`
Links *OrgDeviceActivityLinks `json:"links,omitempty"`
}
OrgDeviceActivity represents a device activity (assign/unassign operations)
type OrgDeviceActivityAttributes ¶
type OrgDeviceActivityAttributes struct {
Status string `json:"status,omitempty"`
SubStatus string `json:"subStatus,omitempty"`
CreatedDateTime *time.Time `json:"createdDateTime,omitempty"`
ActivityType string `json:"activityType,omitempty"`
}
OrgDeviceActivityAttributes contains the activity attributes
type OrgDeviceActivityCreateAttributes ¶
type OrgDeviceActivityCreateAttributes struct {
ActivityType string `json:"activityType"`
}
OrgDeviceActivityCreateAttributes contains the activity creation attributes
type OrgDeviceActivityCreateRelationships ¶
type OrgDeviceActivityCreateRelationships struct {
MDMServer *OrgDeviceActivityMDMServerRelationship `json:"mdmServer,omitempty"`
Devices *OrgDeviceActivityDevicesRelationship `json:"devices,omitempty"`
}
OrgDeviceActivityCreateRelationships contains the relationships for activity creation
type OrgDeviceActivityCreateRequest ¶
type OrgDeviceActivityCreateRequest struct {
Data OrgDeviceActivityData `json:"data"`
}
OrgDeviceActivityCreateRequest represents the request for creating a device activity
type OrgDeviceActivityData ¶
type OrgDeviceActivityData struct {
Type string `json:"type"`
Attributes OrgDeviceActivityCreateAttributes `json:"attributes"`
Relationships OrgDeviceActivityCreateRelationships `json:"relationships"`
}
OrgDeviceActivityData contains the activity data for the request
type OrgDeviceActivityDeviceLinkage ¶
type OrgDeviceActivityDeviceLinkage struct {
Type string `json:"type"` // Should be "orgDevices"
ID string `json:"id"` // Device ID
}
OrgDeviceActivityDeviceLinkage represents a device linkage
type OrgDeviceActivityDevicesRelationship ¶
type OrgDeviceActivityDevicesRelationship struct {
Data []OrgDeviceActivityDeviceLinkage `json:"data"`
}
OrgDeviceActivityDevicesRelationship represents the devices relationship
type OrgDeviceActivityLinks ¶
type OrgDeviceActivityLinks struct {
Self string `json:"self,omitempty"`
}
OrgDeviceActivityLinks contains activity navigation links
type OrgDeviceActivityMDMServerLinkage ¶
type OrgDeviceActivityMDMServerLinkage struct {
Type string `json:"type"` // Should be "mdmServers"
ID string `json:"id"` // MDM Server ID
}
OrgDeviceActivityMDMServerLinkage represents the MDM server linkage
type OrgDeviceActivityMDMServerRelationship ¶
type OrgDeviceActivityMDMServerRelationship struct {
Data OrgDeviceActivityMDMServerLinkage `json:"data"`
}
OrgDeviceActivityMDMServerRelationship represents the MDM server relationship
type OrgDeviceAssignedServerLinkage ¶
type OrgDeviceAssignedServerLinkage struct {
Type string `json:"type"` // Should be "mdmServers"
ID string `json:"id"` // MDM Server ID
}
OrgDeviceAssignedServerLinkage represents the linkage between a device and its assigned server
type Paging ¶
type Paging struct {
Total int `json:"total,omitempty"`
Limit int `json:"limit,omitempty"`
NextCursor string `json:"nextCursor,omitempty"`
}
Paging contains pagination information
type RequestQueryOptions ¶
type RequestQueryOptions struct {
// Field selection - fields to return for mdmServers
// Possible values: serverName, serverType, createdDateTime, updatedDateTime, devices
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 MDM servers
type ResponseMDMServerDevicesLinkages ¶
type ResponseMDMServerDevicesLinkages struct {
Data []MDMServerDeviceLinkage `json:"data"`
Links *Links `json:"links,omitempty"`
Meta *Meta `json:"meta,omitempty"`
}
ResponseMDMServerDevicesLinkages represents the response for getting device linkages for an MDM server
type ResponseMDMServers ¶
type ResponseMDMServers struct {
Data []MDMServer `json:"data"`
Meta *Meta `json:"meta,omitempty"`
Links *Links `json:"links,omitempty"`
}
ResponseMDMServers represents the response for getting MDM servers
type ResponseOrgDeviceActivity ¶
type ResponseOrgDeviceActivity struct {
Data OrgDeviceActivity `json:"data"`
Links *Links `json:"links,omitempty"`
}
ResponseOrgDeviceActivity represents the response for creating an org device activity
type ResponseOrgDeviceAssignedServerLinkage ¶
type ResponseOrgDeviceAssignedServerLinkage struct {
Data OrgDeviceAssignedServerLinkage `json:"data"`
Links *AssignedServerLinks `json:"links,omitempty"`
}
ResponseOrgDeviceAssignedServerLinkage represents the response for getting assigned server linkage