forked from go-auth0/auth0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom_domain.go
59 lines (43 loc) · 1.67 KB
/
custom_domain.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
package management
type CustomDomain struct {
// The id of the custom domain
ID string `json:"custom_domain_id,omitempty"`
// The custom domain.
Domain string `json:"domain,omitempty"`
// The custom domain provisioning type. Can be either "auth0_managed_certs"
// or "self_managed_certs"
Type string `json:"type,omitempty"`
// Primary is true if the domain was marked as "primary", false otherwise.
Primary bool `json:"primary,omitempty"`
// The custom domain configuration status. Can be any of the following:
//
// "disabled", "pending", "pending_verification" or "ready"
Status string `json:"status,omitempty"`
// The custom domain verification method. The only allowed value is "txt".
VerificationMethod string `json:"verification_method,omitempty"`
Verification *CustomDomainVerification `json:"verification,omitempty"`
}
type CustomDomainVerification struct {
// The custom domain verification methods.
Methods []map[string]interface{} `json:"methods,omitempty"`
}
type CustomDomainManager struct {
m *Management
}
func NewCustomDomainManager(m *Management) *CustomDomainManager {
return &CustomDomainManager{m}
}
func (cm *CustomDomainManager) Create(c *CustomDomain) (err error) {
return cm.m.post(cm.m.getURI("custom-domains"), c)
}
func (cm *CustomDomainManager) Read(id string) (*CustomDomain, error) {
c := new(CustomDomain)
err := cm.m.get(cm.m.getURI("custom-domains", id), c)
return c, err
}
func (cm *CustomDomainManager) Update(id string, c *CustomDomain) (err error) {
return cm.m.patch(cm.m.getURI("custom-domains", id), c)
}
func (cm *CustomDomainManager) Delete(id string) (err error) {
return cm.m.delete(cm.m.getURI("custom-domains", id))
}