This repository has been archived by the owner on Jun 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathnew_payload.go
94 lines (70 loc) · 2.42 KB
/
new_payload.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// generated by go:generate, DO NOT EDIT
package mdm
import "fmt"
func NewPayload(request *CommandRequest) (*Payload, error) {
requestType := request.RequestType
payload := newPayload(requestType)
switch requestType {
case "DeviceInformation":
payload.Command.DeviceInformation = request.DeviceInformation
case "InstallApplication":
payload.Command.InstallApplication = request.InstallApplication
case "AccountConfiguration":
payload.Command.AccountConfiguration = request.AccountConfiguration
case "ScheduleOSUpdateScan":
payload.Command.ScheduleOSUpdateScan = request.ScheduleOSUpdateScan
case "ScheduleOSUpdate":
payload.Command.ScheduleOSUpdate = request.ScheduleOSUpdate
case "InstallProfile":
payload.Command.InstallProfile = request.InstallProfile
case "RemoveProfile":
payload.Command.RemoveProfile = request.RemoveProfile
case "InstallProvisioningProfile":
payload.Command.InstallProvisioningProfile = request.InstallProvisioningProfile
case "RemoveProvisioningProfile":
payload.Command.RemoveProvisioningProfile = request.RemoveProvisioningProfile
case "InstalledApplicationList":
payload.Command.InstalledApplicationList = request.InstalledApplicationList
case "DeviceLock":
payload.Command.DeviceLock = request.DeviceLock
case "ClearPasscode":
payload.Command.ClearPasscode = request.ClearPasscode
case "EraseDevice":
payload.Command.EraseDevice = request.EraseDevice
case "RequestMirroring":
payload.Command.RequestMirroring = request.RequestMirroring
case "DeleteUser":
payload.Command.DeleteUser = request.DeleteUser
case "EnableLostMode":
payload.Command.EnableLostMode = request.EnableLostMode
case "ApplyRedemptionCode":
payload.Command.ApplyRedemptionCode = request.ApplyRedemptionCode
case "InstallMedia":
payload.Command.InstallMedia = request.InstallMedia
case "RemoveMedia":
payload.Command.RemoveMedia = request.RemoveMedia
case "Settings":
payload.Command.Settings = request.Settings
case "ProfileList",
"ProvisioningProfileList",
"CertificateList",
"SecurityInfo",
"StopMirroring",
"ClearRestrictionsPassword",
"UserList",
"LogOutUser",
"DisableLostMode",
"DeviceLocation",
"ManagedMediaList",
"OSUpdateStatus",
"DeviceConfigured",
"AvailableOSUpdates",
"Restrictions",
"ShutDownDevice",
"RestartDevice":
return payload, nil
default:
return nil, fmt.Errorf("Unsupported MDM RequestType %v", requestType)
}
return payload, nil
}