devicemanagement

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityTypeAssignDevices   = "ASSIGN_DEVICES"
	ActivityTypeUnassignDevices = "UNASSIGN_DEVICES"
)

Activity type constants

View Source
const (
	ActivityStatusInProgress = "IN_PROGRESS"
	ActivityStatusCompleted  = "COMPLETED"
	ActivityStatusFailed     = "FAILED"
)

Activity status constants

View Source
const (
	ActivitySubStatusSubmitted  = "SUBMITTED"
	ActivitySubStatusProcessing = "PROCESSING"
)

Activity sub-status constants

View Source
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 struct {
	Self    string `json:"self,omitempty"`
	Related string `json:"related,omitempty"`
}

AssignedServerLinks contains linkage navigation links

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides access to Apple Business Manager Device Management Services API

func NewClient

func NewClient(c *axm.Client) *Client

NewClient creates a new device management client

func (*Client) AssignDevicesToServer

func (c *Client) AssignDevicesToServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*OrgDeviceActivityResponse, 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 (*Client) GetAssignedDeviceManagementServiceIDForADevice

func (c *Client) GetAssignedDeviceManagementServiceIDForADevice(ctx context.Context, deviceID string) (*OrgDeviceAssignedServerLinkageResponse, 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 (*Client) GetAssignedDeviceManagementServiceInformationByDeviceID

func (c *Client) GetAssignedDeviceManagementServiceInformationByDeviceID(ctx context.Context, deviceID string, opts *GetAssignedServerInfoOptions) (*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 (*Client) GetDeviceManagementServices

func (c *Client) GetDeviceManagementServices(ctx context.Context, opts *GetMDMServersOptions) (*MDMServersResponse, 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 (*Client) UnassignDevicesFromServer

func (c *Client) UnassignDevicesFromServer(ctx context.Context, mdmServerID string, deviceIDs []string) (*OrgDeviceActivityResponse, 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 GetAssignedServerInfoOptions

type GetAssignedServerInfoOptions struct {
	// Field selection - fields to return for mdmServers
	// Possible values: serverName, serverType, createdDateTime, updatedDateTime, devices
	Fields []string `json:"fields,omitempty"`
}

GetAssignedServerInfoOptions represents the query parameters for getting assigned server info

type GetMDMServerDeviceLinkagesOptions

type GetMDMServerDeviceLinkagesOptions struct {
	// Limit the number of included related resources to return (max 1000)
	Limit int `json:"limit,omitempty"`
}

GetMDMServerDeviceLinkagesOptions represents the query parameters for getting MDM server device linkages

type GetMDMServersOptions

type GetMDMServersOptions 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"`
}

GetMDMServersOptions represents the query parameters for getting MDM servers

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 MDMServerDevicesLinkagesResponse

type MDMServerDevicesLinkagesResponse struct {
	Data  []MDMServerDeviceLinkage `json:"data"`
	Links *axm.Links               `json:"links,omitempty"`
	Meta  *axm.Meta                `json:"meta,omitempty"`
}

MDMServerDevicesLinkagesResponse represents the response for getting device linkages for an MDM server

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 *axm.Links `json:"links,omitempty"`
}

MDMServerResponse represents the response for getting a single MDM server

type MDMServersResponse

type MDMServersResponse struct {
	Data  []MDMServer `json:"data"`
	Meta  *axm.Meta   `json:"meta,omitempty"`
	Links *axm.Links  `json:"links,omitempty"`
}

MDMServersResponse represents the response for getting MDM servers

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 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 OrgDeviceActivityResponse

type OrgDeviceActivityResponse struct {
	Data  OrgDeviceActivity `json:"data"`
	Links *axm.Links        `json:"links,omitempty"`
}

OrgDeviceActivityResponse represents the response for creating an org device activity

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 OrgDeviceAssignedServerLinkageResponse

type OrgDeviceAssignedServerLinkageResponse struct {
	Data  OrgDeviceAssignedServerLinkage `json:"data"`
	Links *AssignedServerLinks           `json:"links,omitempty"`
}

OrgDeviceAssignedServerLinkageResponse represents the response for getting assigned server linkage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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