-
Notifications
You must be signed in to change notification settings - Fork 5
/
jamfproapi_conditional_access.go
34 lines (26 loc) · 1.16 KB
/
jamfproapi_conditional_access.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
// jamfproapi_conditional_access.go
// Jamf Pro Api - Conditional Access
// api reference: undocumented
// Jamf Pro API requires the structs to support a JSON data structure.
package jamfpro
import (
"fmt"
)
const uriConditionalAccess = "/api/v1/conditional-access"
// ResourceConditionalAccessDeviceComplianceStatus represents the resource object.
type ResourceConditionalAccessDeviceComplianceStatus struct {
SharedDeviceFeatureEnabled bool `json:"sharedDeviceFeatureEnabled"`
}
// GetConditionalAccessDeviceComplianceFeatureEnablement retrieves the enablement state of the device compliance settinfs for CA.
func (c *Client) GetConditionalAccessDeviceComplianceFeatureEnablement() (*ResourceConditionalAccessDeviceComplianceStatus, error) {
endpoint := uriConditionalAccess + "/device-compliance/feature-toggle"
var defaultCloudIdPServer ResourceConditionalAccessDeviceComplianceStatus
resp, err := c.HTTP.DoRequest("GET", endpoint, nil, &defaultCloudIdPServer)
if err != nil {
return nil, fmt.Errorf(errMsgFailedGet, "Conditional Access Device Compliance", err)
}
if resp != nil && resp.Body != nil {
defer resp.Body.Close()
}
return &defaultCloudIdPServer, nil
}