/
device_administration_profiles.go
47 lines (34 loc) · 1.21 KB
/
device_administration_profiles.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
package isegosdk
import (
"fmt"
"github.com/go-resty/resty/v2"
)
type DeviceAdministrationProfilesService service
type ResponseDeviceAdministrationProfilesGetDeviceAdminProfiles struct {
ID string `json:"id,omitempty"` //
Name string `json:"name,omitempty"` //
}
//GetDeviceAdminProfiles Device Admin - Returns list of profiles.
/* Device Admin Returns list of profiles.
(Other CRUD APIs available throught ERS)
*/
func (s *DeviceAdministrationProfilesService) GetDeviceAdminProfiles() (*[]ResponseDeviceAdministrationProfilesGetDeviceAdminProfiles, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/policy/device-admin/profiles"
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&[]ResponseDeviceAdministrationProfilesGetDeviceAdminProfiles{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetDeviceAdminProfiles")
}
getCSFRToken(response.Header())
result := response.Result().(*[]ResponseDeviceAdministrationProfilesGetDeviceAdminProfiles)
return result, response, err
}