Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions goaxm/abm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package goaxm

import (
"context"
"net/http"
"net/url"

"github.com/micromdm/nanoaxm/goaxm/abm"
)

// ABMv1MDMServers calls the Apple Business Manager API "v1" to
// Get a list of device management services in an organization.
// Query parameters may be provided in v, otherwise nil.
// See https://developer.apple.com/documentation/applebusinessmanagerapi/get-mdm-servers
func (c *Client) ABMv1MDMServers(ctx context.Context, axmName string, v url.Values) (*abm.MdmServersResponseJson, error) {
var q string
if v != nil {
q = "?" + v.Encode()
}
out := new(abm.MdmServersResponseJson)
return out, c.Do(ctx, axmName, "GET", "https://api-business.apple.com/v1/mdmServers"+q, nil, out, 0, nil)
}

func (c *Client) ABMv1OrgDeviceActivities(ctx context.Context, axmName string, req *abm.OrgDeviceActivityCreateRequestJson) (*abm.OrgDeviceActivityResponseJson, error) {
out := new(abm.OrgDeviceActivityResponseJson)
return out, c.Do(ctx, axmName, http.MethodPost, "https://api-business.apple.com/v1/orgDeviceActivities", req, out, 201, []int{400, 401, 403, 409, 422, 429})
}
3 changes: 3 additions & 0 deletions goaxm/abm/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package abm

//go:generate go-jsonschema -p $GOPACKAGE --tags json --only-models --output schema.go apple-device-services/abm/schemas/ErrorResponse.json apple-device-services/abm/schemas/MdmServersResponse.json apple-device-services/abm/schemas/OrgDeviceActivityCreateRequest.json apple-device-services/abm/schemas/OrgDeviceActivityResponse.json
Loading
Loading