-
Notifications
You must be signed in to change notification settings - Fork 5
/
jamfproapi_cloud_ldap_keystore.go
44 lines (33 loc) · 1.13 KB
/
jamfproapi_cloud_ldap_keystore.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
// jamfproapi_cloud_ldap_keystore.go
// Jamf Pro Api - Cloud LDAP
// api reference: https://developer.jamf.com/jamf-pro/reference/post_v2-cloud-ldaps
// Jamf Pro API requires the structs to support a JSON data structure.
package jamfpro
import "fmt"
const uriCloudLdapKeystore = "/api/v1/ldap-keystore/verify"
// Payload
type PayloadCloudLdapVerifyKeystore struct {
Password string `json:"password"`
FileBytes string `json:"fileBytes"`
FileName string `json:"fileName"`
}
// Response
type ResponseCloudLdapVerifyKeystore struct {
Type string `json:"type"`
ExpirationDate string `json:"expirationDate"`
Subject string `json:"subject"`
FileName string `json:"fileName"`
}
// CRUD
func (c *Client) ValidateCloudLdapKeystore(payload PayloadCloudLdapVerifyKeystore) (*ResponseCloudLdapVerifyKeystore, error) {
endpoint := uriCloudLdapKeystore
var out ResponseCloudLdapVerifyKeystore
resp, err := c.HTTP.DoRequest("POST", endpoint, payload, &out)
if err != nil {
return nil, fmt.Errorf(errMsgFailedValidateCloudLdapKeystore, err)
}
if resp != nil && resp.Body != nil {
resp.Body.Close()
}
return &out, nil
}