|
1
|
|
|
package stubs |
|
2
|
|
|
|
|
3
|
|
|
// SubscriptionItemGetResponse returns a dummy response to GET /v1/subscription-items/:id endpoint |
|
4
|
|
|
func SubscriptionItemGetResponse() []byte { |
|
5
|
|
|
return []byte(` |
|
6
|
|
|
{ |
|
7
|
|
|
"jsonapi": { |
|
8
|
|
|
"version": "1.0" |
|
9
|
|
|
}, |
|
10
|
|
|
"links": { |
|
11
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-item/1" |
|
12
|
|
|
}, |
|
13
|
|
|
"data": { |
|
14
|
|
|
"type": "subscription-items", |
|
15
|
|
|
"id": "1", |
|
16
|
|
|
"attributes": { |
|
17
|
|
|
"subscription_id": 1, |
|
18
|
|
|
"price_id": 1, |
|
19
|
|
|
"quantity": 1, |
|
20
|
|
|
"is_usage_based": false, |
|
21
|
|
|
"created_at": "2023-07-18T12:16:24.000000Z", |
|
22
|
|
|
"updated_at": "2023-07-18T12:16:24.000000Z" |
|
23
|
|
|
}, |
|
24
|
|
|
"relationships": { |
|
25
|
|
|
"subscription": { |
|
26
|
|
|
"links": { |
|
27
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/subscription", |
|
28
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/subscription" |
|
29
|
|
|
} |
|
30
|
|
|
}, |
|
31
|
|
|
"price": { |
|
32
|
|
|
"links": { |
|
33
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/price", |
|
34
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/price" |
|
35
|
|
|
} |
|
36
|
|
|
}, |
|
37
|
|
|
"usage-records": { |
|
38
|
|
|
"links": { |
|
39
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/usage-records", |
|
40
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/usage-records" |
|
41
|
|
|
} |
|
42
|
|
|
} |
|
43
|
|
|
}, |
|
44
|
|
|
"links": { |
|
45
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1" |
|
46
|
|
|
} |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
`) |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
// SubscriptionItemUpdateResponse is a dummy response to the PATCH /v1/subscription-items/:id endpoint |
|
53
|
|
|
func SubscriptionItemUpdateResponse() []byte { |
|
54
|
|
|
return []byte(` |
|
55
|
|
|
{ |
|
56
|
|
|
"jsonapi": { |
|
57
|
|
|
"version": "1.0" |
|
58
|
|
|
}, |
|
59
|
|
|
"links": { |
|
60
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-item/1" |
|
61
|
|
|
}, |
|
62
|
|
|
"data": { |
|
63
|
|
|
"type": "subscription-items", |
|
64
|
|
|
"id": "1", |
|
65
|
|
|
"attributes": { |
|
66
|
|
|
"subscription_id": 1, |
|
67
|
|
|
"price_id": 1, |
|
68
|
|
|
"quantity": 10, |
|
69
|
|
|
"is_usage_based": false, |
|
70
|
|
|
"created_at": "2023-07-18T12:16:24.000000Z", |
|
71
|
|
|
"updated_at": "2023-07-18T12:23:18.000000Z" |
|
72
|
|
|
}, |
|
73
|
|
|
"relationships": { |
|
74
|
|
|
"subscription": { |
|
75
|
|
|
"links": { |
|
76
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/subscription", |
|
77
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/subscription" |
|
78
|
|
|
} |
|
79
|
|
|
}, |
|
80
|
|
|
"price": { |
|
81
|
|
|
"links": { |
|
82
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/price", |
|
83
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/price" |
|
84
|
|
|
} |
|
85
|
|
|
}, |
|
86
|
|
|
"usage-records": { |
|
87
|
|
|
"links": { |
|
88
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/usage-records", |
|
89
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/usage-records" |
|
90
|
|
|
} |
|
91
|
|
|
} |
|
92
|
|
|
}, |
|
93
|
|
|
"links": { |
|
94
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1" |
|
95
|
|
|
} |
|
96
|
|
|
} |
|
97
|
|
|
} |
|
98
|
|
|
`) |
|
99
|
|
|
} |
|
100
|
|
|
|
|
101
|
|
|
// SubscriptionItemsListResponse returns a dummy response to GET /v1/subscription-items endpoint |
|
102
|
|
|
func SubscriptionItemsListResponse() []byte { |
|
103
|
|
|
return []byte(` |
|
104
|
|
|
{ |
|
105
|
|
|
"meta": { |
|
106
|
|
|
"page": { |
|
107
|
|
|
"currentPage": 1, |
|
108
|
|
|
"from": 1, |
|
109
|
|
|
"lastPage": 1, |
|
110
|
|
|
"perPage": 10, |
|
111
|
|
|
"to": 10, |
|
112
|
|
|
"total": 10 |
|
113
|
|
|
} |
|
114
|
|
|
}, |
|
115
|
|
|
"jsonapi": { |
|
116
|
|
|
"version": "1.0" |
|
117
|
|
|
}, |
|
118
|
|
|
"links": { |
|
119
|
|
|
"first": "https://api.lemonsqueezy.com/v1/subscription-items?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=-created_at", |
|
120
|
|
|
"last": "https://api.lemonsqueezy.com/v1/subscription-items?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=-created_at" |
|
121
|
|
|
}, |
|
122
|
|
|
"data": [ |
|
123
|
|
|
{ |
|
124
|
|
|
"type": "subscription-items", |
|
125
|
|
|
"id": "1", |
|
126
|
|
|
"attributes": { |
|
127
|
|
|
"subscription_id": 1, |
|
128
|
|
|
"price_id": 1, |
|
129
|
|
|
"quantity": 1, |
|
130
|
|
|
"is_usage_based": false, |
|
131
|
|
|
"created_at": "2023-07-18T12:16:24.000000Z", |
|
132
|
|
|
"updated_at": "2023-07-18T12:16:24.000000Z" |
|
133
|
|
|
}, |
|
134
|
|
|
"relationships": { |
|
135
|
|
|
"subscription": { |
|
136
|
|
|
"links": { |
|
137
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/subscription", |
|
138
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/subscription" |
|
139
|
|
|
} |
|
140
|
|
|
}, |
|
141
|
|
|
"price": { |
|
142
|
|
|
"links": { |
|
143
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/price", |
|
144
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/price" |
|
145
|
|
|
} |
|
146
|
|
|
}, |
|
147
|
|
|
"usage-records": { |
|
148
|
|
|
"links": { |
|
149
|
|
|
"related": "https://api.lemonsqueezy.com/v1/subscription-items/1/usage-records", |
|
150
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/usage-records" |
|
151
|
|
|
} |
|
152
|
|
|
} |
|
153
|
|
|
}, |
|
154
|
|
|
"links": { |
|
155
|
|
|
"self": "https://api.lemonsqueezy.com/v1/subscription-items/1" |
|
156
|
|
|
} |
|
157
|
|
|
} |
|
158
|
|
|
] |
|
159
|
|
|
} |
|
160
|
|
|
`) |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
// SubscriptionItemCurrentUsageResponse returns a dummy response to GET /v1/subscription-items/:id/current-usage endpoint |
|
164
|
|
|
func SubscriptionItemCurrentUsageResponse() []byte { |
|
165
|
|
|
return []byte(` |
|
166
|
|
|
{ |
|
167
|
|
|
"jsonapi": { |
|
168
|
|
|
"version": "1.0" |
|
169
|
|
|
}, |
|
170
|
|
|
"meta": { |
|
171
|
|
|
"period_start": "2023-08-10T13:08:16.000000Z", |
|
172
|
|
|
"period_end": "2023-09-10T13:03:16.000000Z", |
|
173
|
|
|
"quantity": 5, |
|
174
|
|
|
"interval_unit": "month", |
|
175
|
|
|
"interval_quantity": 1 |
|
176
|
|
|
} |
|
177
|
|
|
} |
|
178
|
|
|
`) |
|
179
|
|
|
} |
|
180
|
|
|
|