Skip to content

Commit b463e61

Browse files
committed
add DeviceDetails to godep
1 parent 30a24c5 commit b463e61

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

godep/device.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,22 @@ func IsCursorInvalid(err error) bool {
109109
func IsCursorExpired(err error) bool {
110110
return httpErrorContains(err, http.StatusBadRequest, "EXPIRED_CURSOR")
111111
}
112+
113+
// DeviceListResponse corresponds to the Apple API "DeviceListResponse" structure.
114+
// See https://developer.apple.com/documentation/devicemanagement/devicelistresponse
115+
type DeviceListResponse struct {
116+
Devices map[string]Device `json:"devices"`
117+
}
118+
119+
// DeviceDetails uses the Apple "Get Device Details" API endpoint to get the
120+
// details on a set of devices.
121+
// See https://developer.apple.com/documentation/devicemanagement/get_device_details
122+
func (c *Client) DeviceDetails(ctx context.Context, name string, devices ...string) (*DeviceListResponse, error) {
123+
req := struct {
124+
Devices []string `json:"devices"`
125+
}{
126+
Devices: devices,
127+
}
128+
resp := new(DeviceListResponse)
129+
return resp, c.do(ctx, name, http.MethodPost, "/devices", req, resp)
130+
}

0 commit comments

Comments
 (0)