1
1
// jamfproapi_mobile_device_prestages.go
2
2
// Jamf Pro Api - Mobile Device Prestages
3
- // api reference: https://developer.jamf.com/jamf-pro/reference/get_v2 -mobile-device-prestages
3
+ // api reference: https://developer.jamf.com/jamf-pro/reference/get_v3 -mobile-device-prestages
4
4
// Jamf Pro API requires the structs to support a JSON data structure.
5
5
6
6
package jamfpro
@@ -12,7 +12,10 @@ import (
12
12
"github.com/mitchellh/mapstructure"
13
13
)
14
14
15
- const uriMobileDevicePrestages = "/api/v2/mobile-device-prestages"
15
+ const (
16
+ uriMobileDevicePrestagesV2 = "/api/v2/mobile-device-prestages"
17
+ uriMobileDevicePrestagesV3 = "/api/v3/mobile-device-prestages"
18
+ )
16
19
17
20
// List
18
21
@@ -94,6 +97,7 @@ type ResourceMobileDevicePrestage struct {
94
97
MinimumOsSpecificVersionIpad string `json:"minimumOsSpecificVersionIpad,omitempty"`
95
98
RTSEnabled * bool `json:"rtsEnabled,omitempty"`
96
99
RTSConfigProfileId string `json:"rtsConfigProfileId,omitempty"`
100
+ PreserveManagedApps * bool `json:"preserveManagedApps,omitempty"`
97
101
}
98
102
99
103
// Subsets & Containers
@@ -140,6 +144,10 @@ type MobileDevicePrestageSubsetSkipSetupItems struct {
140
144
Welcome * bool `json:"Welcome"`
141
145
SafetyAndHandling * bool `json:"SafetyAndHandling"`
142
146
TapToSetup * bool `json:"TapToSetup"`
147
+ SpokenLanguage * bool `json:"SpokenLanguage,omitempty"`
148
+ Keyboard * bool `json:"Keyboard,omitempty"`
149
+ Multitasking * bool `json:"Multitasking,omitempty"`
150
+ OSShowcase * bool `json:"OSShowcase,omitempty"`
143
151
}
144
152
145
153
type MobileDevicePrestageSubsetLocationInformation struct {
@@ -192,7 +200,7 @@ type MobileDevicePrestageSubsetNamesName struct {
192
200
193
201
// GetMobileDevicePrestages retrieves a list of all mobile prestages
194
202
func (c * Client ) GetMobileDevicePrestages (params url.Values ) (* ResponseMobileDevicePrestagesList , error ) {
195
- endpoint := uriMobileDevicePrestages
203
+ endpoint := uriMobileDevicePrestagesV3
196
204
resp , err := c .DoPaginatedGet (endpoint , params )
197
205
if err != nil {
198
206
return nil , fmt .Errorf (errMsgFailedPaginatedGet , "mobile device prestages" , err )
@@ -215,7 +223,7 @@ func (c *Client) GetMobileDevicePrestages(params url.Values) (*ResponseMobileDev
215
223
216
224
// GetMobileDevicePrestageByID retrieves a single mobile prestage from the supplied ID
217
225
func (c * Client ) GetMobileDevicePrestageByID (id string ) (* ResourceMobileDevicePrestage , error ) {
218
- endpoint := fmt .Sprintf ("%s/%s" , uriMobileDevicePrestages , id )
226
+ endpoint := fmt .Sprintf ("%s/%s" , uriMobileDevicePrestagesV3 , id )
219
227
var out ResourceMobileDevicePrestage
220
228
221
229
resp , err := c .HTTP .DoRequest ("GET" , endpoint , nil , & out )
@@ -248,7 +256,7 @@ func (c *Client) GetMobileDevicePrestageByName(name string) (*ResourceMobileDevi
248
256
249
257
// CreateMobileDevicePrestage creates a new mobile prestage and returns the id
250
258
func (c * Client ) CreateMobileDevicePrestage (newPrestage ResourceMobileDevicePrestage ) (* ResponseMobileDevicePrestageCreate , error ) {
251
- endpoint := uriMobileDevicePrestages
259
+ endpoint := uriMobileDevicePrestagesV3
252
260
var out ResponseMobileDevicePrestageCreate
253
261
resp , err := c .HTTP .DoRequest ("POST" , endpoint , newPrestage , & out )
254
262
if err != nil {
@@ -264,7 +272,7 @@ func (c *Client) CreateMobileDevicePrestage(newPrestage ResourceMobileDevicePres
264
272
265
273
// UpdateMobileDevicePrestageByID updates a mobile device prestage by its ID.
266
274
func (c * Client ) UpdateMobileDevicePrestageByID (id string , prestageUpdate * ResourceMobileDevicePrestage ) (* ResourceMobileDevicePrestage , error ) {
267
- endpoint := fmt .Sprintf ("%s/%s" , uriMobileDevicePrestages , id )
275
+ endpoint := fmt .Sprintf ("%s/%s" , uriMobileDevicePrestagesV3 , id )
268
276
269
277
var updatedPrestage ResourceMobileDevicePrestage
270
278
resp , err := c .HTTP .DoRequest ("PUT" , endpoint , prestageUpdate , & updatedPrestage )
@@ -298,7 +306,7 @@ func (c *Client) UpdateMobileDevicePrestageByName(name string, prestageUpdate *R
298
306
299
307
// DeleteMobileDevicePrestageByID a mobile prestage at the given id
300
308
func (c * Client ) DeleteMobileDevicePrestageByID (id string ) error {
301
- endpoint := fmt .Sprintf ("%s/%s" , uriMobileDevicePrestages , id )
309
+ endpoint := fmt .Sprintf ("%s/%s" , uriMobileDevicePrestagesV3 , id )
302
310
resp , err := c .HTTP .DoRequest ("DELETE" , endpoint , nil , nil )
303
311
if err != nil {
304
312
return fmt .Errorf (errMsgFailedDeleteByID , "mobile device prestage" , id , err )
@@ -330,7 +338,7 @@ func (c *Client) DeleteMobileDevicePrestageByName(name string) error {
330
338
331
339
// GetDeviceScopeForMobileDevicePrestage retrieves the device scope for a specific mobile device prestage by its ID.
332
340
func (c * Client ) GetDeviceScopeForMobileDevicePrestageByID (id string ) (* ResponseMobileDeviceScope , error ) {
333
- endpoint := fmt .Sprintf ("%s/%s/scope" , uriMobileDevicePrestages , id )
341
+ endpoint := fmt .Sprintf ("%s/%s/scope" , uriMobileDevicePrestagesV2 , id )
334
342
335
343
var deviceScope ResponseMobileDeviceScope
336
344
resp , err := c .HTTP .DoRequest ("GET" , endpoint , nil , & deviceScope )
0 commit comments