-
Notifications
You must be signed in to change notification settings - Fork 6
/
subscriber.go
48 lines (41 loc) · 1.74 KB
/
subscriber.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
package revcatgo
import (
"time"
"gopkg.in/guregu/null.v4"
)
type SubscriberResponse struct {
RequestDateAt milliseconds `json:"request_date_ms"`
Subscriber Subscriber `json:"subscriber"`
}
type Subscriber struct {
Entitlements map[string]Entitlement `json:"entitlements"`
FirstSeen time.Time `json:"first_seen"`
LastSeen time.Time `json:"last_seen"`
ManagementURL null.String `json:"management_url"`
OriginalAppUserID null.String `json:"original_app_user_id"`
Subscriptions map[string]Subscription `json:"subscriptions"`
NonSubscription map[string][]NonSubscription `json:"non_subscriptions"`
}
type Entitlement struct {
ProductIdentifier string `json:"product_identifier"`
ExpiresDate time.Time `json:"expires_date"`
GracePeriodExpiresDate null.Time `json:"grace_period_expires_date"`
PurchaseDate time.Time `json:"purchase_dat"`
}
type Subscription struct {
ExpiresDate time.Time `json:"expires_date"`
GracePeriodExpiresDate null.Time `json:"grace_period_expires_date"`
PurchaseDate time.Time `json:"purchase_date"`
OriginalPurchaseDate time.Time `json:"original_purchase_date"`
PeriodType periodType `json:"period_type"`
Store store `json:"store"`
IsSandBox bool `json:"is_sandbox"`
UnsubscribeDetectedAt null.Time `json:"unsubscribe_detected_at"`
BillingIssueDetectedAt null.Time `json:"billing_issue_detected_at"`
}
type NonSubscription struct {
ID string `json:"id"`
Store store `json:"store"`
PurchaseDate time.Time `json:"purchase_date"`
IsSandBox bool `json:"is_sandbox"`
}