forked from twoscott/patreon-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.go
More file actions
124 lines (113 loc) · 3.68 KB
/
resources.go
File metadata and controls
124 lines (113 loc) · 3.68 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package patreon
// Address represents a patron's shipping address.
type Address struct {
*AddressAttributes
ID string
// The user this address belongs to.
User *User
// The campaigns that have access to the address.
Campaigns []*Campaign
}
// Benefit represents a benefit added to the campaign, which can be added to a tier to be delivered to the patron.
type Benefit struct {
*BenefitAttributes
ID string
// The Tiers the benefit has been added to.
Tiers []*Tier
// The Deliverables that have been generated by the Benefit
Deliverables []*Deliverables
// The Campaign the benefit belongs to
Campaign *Campaign
}
// Campaign represents the creator's page, and the top-level object for accessing lists of members, tiers, etc.
type Campaign struct {
*CampaignAttributes
ID string
// The campaign's tiers.
Tiers []*Tier
// The campaign owner.
Creator *User
// The campaign's benefits.
Benefits []*Benefit
// The campaign's goals.
Goals []*Goal
}
// Deliverables represents the record of whether or not a patron has been delivered the benefitthey are owed
// because of their member tier.
type Deliverables struct {
*DeliverableAttributes
ID string
// The Campaign the Deliverables were generated for.
Campaign *Campaign
// The Benefit the Deliverables were generated for.
Benefit *Benefit
// The member who has been granted the deliverable.
Member *Member
// The user who has been granted the deliverable. This user is the same as the member user.
User *User
}
// Goal represents a funding goal in USD set by a creator on a campaign.
type Goal struct {
*GoalAttributes
ID string
// The campaign trying to reach the goal
Campaign *Campaign
}
// Media represents a file uploaded to patreon.com, usually an image.
type Media struct {
*MediaAttributes
ID string
}
// Member represents the record of a user's membership to a campaign. Remains consistent across months of pledging.
type Member struct {
*MemberAttributes
ID string
// The member's shipping address that they entered for the campaign.Requires the campaign.members.address scope.
Address *Address
// The campaign that the membership is for.
Campaign *Campaign
// The tiers that the member is entitled to. This includes a current pledge,
// or payment that covers the current payment period.
CurrentlyEntitledTiers []*Tier
// The user who is pledging to the campaign.
User *User
}
// OAuthClient represents a client created by a developer, used for getting OAuth2 access tokens.
type OAuthClient struct {
*OAuthClientAttributes
// The user who created the OAuth Client.
User *User
// The campaign of the user who created the OAuth Client.
Campaign *Campaign
// The token of the user who created the client.
CreatorToken string
}
// Tier represents a membership level on a campaign, which can have benefits attached to it.
type Tier struct {
*TierAttributes
ID string
// The campaign the tier belongs to.
Campaign *Campaign
// The image file associated with the tier.
TierImage *Media
// The benefits attached to the tier, which are used for generating deliverables
Benefits []*Benefit
}
// User represents the Patreon user, which can be both patron and creator.
type User struct {
*UserAttributes
ID string
// Usually a zero or one-element array with the user's membership to the token creator's campaign,
// if they are a member. With the identity.memberships scope, this returns memberships to ALL campaigns the user is
// a member of.
Memberships []*Member
Campaign *Campaign
}
// Webhook represents an event happening on a particular campaign.
type Webhook struct {
WebhookAttributes
// The client which created the webhook
Client *OAuthClient
// The campaign whose events trigger the webhook.
Campaign *Campaign
}