-
Notifications
You must be signed in to change notification settings - Fork 0
/
domains_data.go
71 lines (62 loc) · 2.07 KB
/
domains_data.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
60
61
62
63
64
65
66
67
68
69
70
71
package rebrandly
import (
"time"
)
// DomainsFilters represents the filters used to make a Domains query.
// https://developers.rebrandly.com/docs/domains-list-endpoint
type DomainsFilters struct {
Active *bool `urlQuery:"active"`
Type *DomainsType `urlQuery:"type"`
OrderBy *OrderBy `urlQuery:"orderBy"`
OrderDir *OrderDir `urlQuery:"orderDir"`
Limit *int `urlQuery:"limit"`
Last *string `urlQuery:"last"`
}
// DomainsType represent a domain type
type DomainsType string
const (
// DomainsTypeUser represents the "user" type for a DomainsType
DomainsTypeUser DomainsType = "user"
// DomainsTypeService represents the "service" type for DomainsType
DomainsTypeService DomainsType = "service"
)
// DomainsCountFilters represents the filer usable within a DomainsCount request
type DomainsCountFilters struct {
Active *bool `urlQuery:"active"`
Type *DomainsType `urlQuery:"active"`
}
// Domains represents a list domains
type Domains []Domain
// Domain represents a single custom domain
type Domain struct {
ID string `json:"id"`
FullName string `json:"fullName"`
TopLevelDomain string `json:"topLevelDomain"`
Level int `json:"level"`
CreationDate time.Time `json:"creationDate"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
OwnerID string `json:"ownerId"`
Type string `json:"type"`
Subdomains int `json:"subdomains"`
Managed bool `json:"managed"`
Status struct {
DNS string `json:"dns"`
Encryption string `json:"encryption"`
} `json:"status"`
HTTPS bool `json:"https"`
Active bool `json:"active"`
Clicks int `json:"clicks"`
Sessions int `json:"sessions"`
LastClickAt time.Time `json:"lastClickAt"`
Correlation struct {
Status string `json:"status"`
} `json:"correlation"`
}
type domainCountQuery struct {
Active bool `json:"active"`
Type string `json:"type"`
}
type domainCountResponse struct {
Count int `json:"count"`
}