/
device_administration_identity_stores.go
49 lines (35 loc) · 1.57 KB
/
device_administration_identity_stores.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
package isegosdk
import (
"fmt"
"github.com/go-resty/resty/v2"
)
type DeviceAdministrationIDentityStoresService service
type ResponseDeviceAdministrationIDentityStoresGetDeviceAdminIDentityStores []ResponseItemDeviceAdministrationIDentityStoresGetDeviceAdminIDentityStores // Array of ResponseDeviceAdministrationIDentityStoresGetDeviceAdminIdentityStores
type ResponseItemDeviceAdministrationIDentityStoresGetDeviceAdminIDentityStores struct {
ID string `json:"id,omitempty"` //
Name string `json:"name,omitempty"` //
}
//GetDeviceAdminIDentityStores Device Admin - Return list of identity stores for authentication.
/* Device Admin Return list of identity stores for authentication.
(Other CRUD APIs available through ERS)
*/
func (s *DeviceAdministrationIDentityStoresService) GetDeviceAdminIDentityStores() (*ResponseDeviceAdministrationIDentityStoresGetDeviceAdminIDentityStores, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/policy/device-admin/identity-stores"
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseDeviceAdministrationIDentityStoresGetDeviceAdminIDentityStores{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetDeviceAdminIdentityStores")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseDeviceAdministrationIDentityStoresGetDeviceAdminIDentityStores)
return result, response, err
}