stigg 0.1.0.pre.alpha.1 → 0.1.0.pre.alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +29 -1
- data/lib/stigg/internal/my_cursor_id_page.rb +32 -4
- data/lib/stigg/models/v1/coupon_create_params.rb +2 -0
- data/lib/stigg/models/v1/coupon_create_response.rb +11 -6
- data/lib/stigg/models/v1/coupon_list_params.rb +14 -14
- data/lib/stigg/models/v1/coupon_list_response.rb +262 -278
- data/lib/stigg/models/v1/coupon_retrieve_response.rb +11 -6
- data/lib/stigg/models/v1/customer_create_params.rb +2 -0
- data/lib/stigg/models/v1/customer_list_params.rb +14 -14
- data/lib/stigg/models/v1/customer_list_response.rb +160 -174
- data/lib/stigg/models/v1/customer_response.rb +8 -1
- data/lib/stigg/models/v1/customer_update_params.rb +2 -0
- data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +3 -1
- data/lib/stigg/models/v1/subscription_create_params.rb +1485 -6
- data/lib/stigg/models/v1/subscription_create_response.rb +703 -4
- data/lib/stigg/models/v1/subscription_delegate_params.rb +7 -2
- data/lib/stigg/models/v1/subscription_delegate_response.rb +42 -2
- data/lib/stigg/models/v1/subscription_list_params.rb +20 -24
- data/lib/stigg/models/v1/subscription_list_response.rb +255 -236
- data/lib/stigg/models/v1/subscription_migrate_params.rb +3 -3
- data/lib/stigg/models/v1/subscription_migrate_response.rb +42 -2
- data/lib/stigg/models/v1/subscription_preview_params.rb +139 -46
- data/lib/stigg/models/v1/subscription_preview_response.rb +164 -49
- data/lib/stigg/models/v1/subscription_retrieve_response.rb +42 -2
- data/lib/stigg/models/v1/subscription_transfer_params.rb +2 -6
- data/lib/stigg/models/v1/subscription_transfer_response.rb +42 -2
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rb +2 -0
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +2 -0
- data/lib/stigg/models/v1_create_event_params.rb +2 -0
- data/lib/stigg/models/v1_create_event_response.rb +8 -1
- data/lib/stigg/models/v1_create_usage_params.rb +19 -3
- data/lib/stigg/models/v1_create_usage_response.rb +7 -1
- data/lib/stigg/resources/v1/coupons.rb +12 -10
- data/lib/stigg/resources/v1/customers/payment_method.rb +6 -5
- data/lib/stigg/resources/v1/customers/usage.rb +0 -41
- data/lib/stigg/resources/v1/customers.rb +20 -20
- data/lib/stigg/resources/v1/subscriptions/future_update.rb +6 -4
- data/lib/stigg/resources/v1/subscriptions.rb +74 -49
- data/lib/stigg/resources/v1.rb +2 -2
- data/lib/stigg/version.rb +1 -1
- data/lib/stigg.rb +0 -7
- data/rbi/stigg/internal/my_cursor_id_page.rbi +27 -0
- data/rbi/stigg/models/v1/coupon_create_params.rbi +1 -0
- data/rbi/stigg/models/v1/coupon_create_response.rbi +11 -10
- data/rbi/stigg/models/v1/coupon_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/coupon_list_response.rbi +812 -869
- data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +11 -10
- data/rbi/stigg/models/v1/customer_create_params.rbi +1 -0
- data/rbi/stigg/models/v1/customer_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/customer_list_response.rbi +307 -347
- data/rbi/stigg/models/v1/customer_response.rbi +8 -1
- data/rbi/stigg/models/v1/customer_update_params.rbi +1 -0
- data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +3 -0
- data/rbi/stigg/models/v1/subscription_create_params.rbi +4975 -84
- data/rbi/stigg/models/v1/subscription_create_response.rbi +2508 -1
- data/rbi/stigg/models/v1/subscription_delegate_params.rbi +6 -2
- data/rbi/stigg/models/v1/subscription_delegate_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscription_list_params.rbi +26 -28
- data/rbi/stigg/models/v1/subscription_list_response.rbi +460 -435
- data/rbi/stigg/models/v1/subscription_migrate_params.rbi +3 -3
- data/rbi/stigg/models/v1/subscription_migrate_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscription_preview_params.rbi +112 -14
- data/rbi/stigg/models/v1/subscription_preview_response.rbi +139 -6
- data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscription_transfer_params.rbi +2 -4
- data/rbi/stigg/models/v1/subscription_transfer_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +1 -0
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbi +1 -0
- data/rbi/stigg/models/v1_create_event_params.rbi +1 -0
- data/rbi/stigg/models/v1_create_event_response.rbi +8 -1
- data/rbi/stigg/models/v1_create_usage_params.rbi +44 -4
- data/rbi/stigg/models/v1_create_usage_response.rbi +8 -1
- data/rbi/stigg/resources/v1/coupons.rbi +20 -12
- data/rbi/stigg/resources/v1/customers/payment_method.rbi +9 -3
- data/rbi/stigg/resources/v1/customers/usage.rbi +0 -29
- data/rbi/stigg/resources/v1/customers.rbi +34 -20
- data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +12 -4
- data/rbi/stigg/resources/v1/subscriptions.rbi +102 -23
- data/rbi/stigg/resources/v1.rbi +2 -2
- data/sig/stigg/internal/my_cursor_id_page.rbs +17 -0
- data/sig/stigg/models/v1/coupon_create_response.rbs +4 -4
- data/sig/stigg/models/v1/coupon_list_params.rbs +11 -11
- data/sig/stigg/models/v1/coupon_list_response.rbs +331 -351
- data/sig/stigg/models/v1/coupon_retrieve_response.rbs +4 -4
- data/sig/stigg/models/v1/customer_list_params.rbs +11 -11
- data/sig/stigg/models/v1/customer_list_response.rbs +133 -153
- data/sig/stigg/models/v1/subscription_create_params.rbs +2029 -5
- data/sig/stigg/models/v1/subscription_create_response.rbs +1022 -0
- data/sig/stigg/models/v1/subscription_delegate_response.rbs +31 -0
- data/sig/stigg/models/v1/subscription_list_params.rbs +14 -14
- data/sig/stigg/models/v1/subscription_list_response.rbs +196 -189
- data/sig/stigg/models/v1/subscription_migrate_response.rbs +31 -0
- data/sig/stigg/models/v1/subscription_preview_params.rbs +2 -6
- data/sig/stigg/models/v1/subscription_retrieve_response.rbs +31 -0
- data/sig/stigg/models/v1/subscription_transfer_response.rbs +31 -0
- data/sig/stigg/models/v1_create_usage_params.rbs +15 -5
- data/sig/stigg/resources/v1/coupons.rbs +3 -3
- data/sig/stigg/resources/v1/customers/usage.rbs +0 -10
- data/sig/stigg/resources/v1/customers.rbs +3 -5
- data/sig/stigg/resources/v1/subscriptions.rbs +19 -4
- metadata +2 -23
- data/lib/stigg/models/v1/customers/promotional_create_params.rb +0 -294
- data/lib/stigg/models/v1/customers/promotional_create_response.rb +0 -268
- data/lib/stigg/models/v1/customers/promotional_revoke_params.rb +0 -24
- data/lib/stigg/models/v1/customers/promotional_revoke_response.rb +0 -268
- data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +0 -56
- data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +0 -145
- data/lib/stigg/resources/v1/customers/promotional.rb +0 -69
- data/rbi/stigg/models/v1/customers/promotional_create_params.rbi +0 -639
- data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +0 -495
- data/rbi/stigg/models/v1/customers/promotional_revoke_params.rbi +0 -42
- data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +0 -497
- data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +0 -84
- data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +0 -353
- data/rbi/stigg/resources/v1/customers/promotional.rbi +0 -53
- data/sig/stigg/models/v1/customers/promotional_create_params.rbs +0 -234
- data/sig/stigg/models/v1/customers/promotional_create_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/promotional_revoke_params.rbs +0 -27
- data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +0 -54
- data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +0 -134
- data/sig/stigg/resources/v1/customers/promotional.rbs +0 -23
|
@@ -6,16 +6,20 @@ module Stigg
|
|
|
6
6
|
# @see Stigg::Resources::V1::Subscriptions#preview
|
|
7
7
|
class SubscriptionPreviewResponse < Stigg::Internal::Type::BaseModel
|
|
8
8
|
# @!attribute data
|
|
9
|
+
# Pricing preview with invoices
|
|
9
10
|
#
|
|
10
11
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data]
|
|
11
12
|
required :data, -> { Stigg::Models::V1::SubscriptionPreviewResponse::Data }
|
|
12
13
|
|
|
13
14
|
# @!method initialize(data:)
|
|
14
|
-
#
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
17
|
+
# @param data [Stigg::Models::V1::SubscriptionPreviewResponse::Data] Pricing preview with invoices
|
|
15
18
|
|
|
16
19
|
# @see Stigg::Models::V1::SubscriptionPreviewResponse#data
|
|
17
20
|
class Data < Stigg::Internal::Type::BaseModel
|
|
18
21
|
# @!attribute immediate_invoice
|
|
22
|
+
# Invoice due immediately
|
|
19
23
|
#
|
|
20
24
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice]
|
|
21
25
|
required :immediate_invoice,
|
|
@@ -23,6 +27,7 @@ module Stigg
|
|
|
23
27
|
api_name: :immediateInvoice
|
|
24
28
|
|
|
25
29
|
# @!attribute billing_period_range
|
|
30
|
+
# Billing period range
|
|
26
31
|
#
|
|
27
32
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data::BillingPeriodRange, nil]
|
|
28
33
|
optional :billing_period_range,
|
|
@@ -30,6 +35,7 @@ module Stigg
|
|
|
30
35
|
api_name: :billingPeriodRange
|
|
31
36
|
|
|
32
37
|
# @!attribute free_items
|
|
38
|
+
# Free items included
|
|
33
39
|
#
|
|
34
40
|
# @return [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::FreeItem>, nil]
|
|
35
41
|
optional :free_items,
|
|
@@ -37,16 +43,19 @@ module Stigg
|
|
|
37
43
|
api_name: :freeItems
|
|
38
44
|
|
|
39
45
|
# @!attribute has_scheduled_updates
|
|
46
|
+
# Whether updates are scheduled
|
|
40
47
|
#
|
|
41
48
|
# @return [Boolean, nil]
|
|
42
49
|
optional :has_scheduled_updates, Stigg::Internal::Type::Boolean, api_name: :hasScheduledUpdates
|
|
43
50
|
|
|
44
51
|
# @!attribute is_plan_downgrade
|
|
52
|
+
# Whether this is a downgrade
|
|
45
53
|
#
|
|
46
54
|
# @return [Boolean, nil]
|
|
47
55
|
optional :is_plan_downgrade, Stigg::Internal::Type::Boolean, api_name: :isPlanDowngrade
|
|
48
56
|
|
|
49
57
|
# @!attribute recurring_invoice
|
|
58
|
+
# Recurring invoice preview
|
|
50
59
|
#
|
|
51
60
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice, nil]
|
|
52
61
|
optional :recurring_invoice,
|
|
@@ -54,26 +63,36 @@ module Stigg
|
|
|
54
63
|
api_name: :recurringInvoice
|
|
55
64
|
|
|
56
65
|
# @!method initialize(immediate_invoice:, billing_period_range: nil, free_items: nil, has_scheduled_updates: nil, is_plan_downgrade: nil, recurring_invoice: nil)
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
# @param
|
|
60
|
-
#
|
|
61
|
-
# @param
|
|
62
|
-
#
|
|
66
|
+
# Pricing preview with invoices
|
|
67
|
+
#
|
|
68
|
+
# @param immediate_invoice [Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice] Invoice due immediately
|
|
69
|
+
#
|
|
70
|
+
# @param billing_period_range [Stigg::Models::V1::SubscriptionPreviewResponse::Data::BillingPeriodRange] Billing period range
|
|
71
|
+
#
|
|
72
|
+
# @param free_items [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::FreeItem>] Free items included
|
|
73
|
+
#
|
|
74
|
+
# @param has_scheduled_updates [Boolean] Whether updates are scheduled
|
|
75
|
+
#
|
|
76
|
+
# @param is_plan_downgrade [Boolean] Whether this is a downgrade
|
|
77
|
+
#
|
|
78
|
+
# @param recurring_invoice [Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice] Recurring invoice preview
|
|
63
79
|
|
|
64
80
|
# @see Stigg::Models::V1::SubscriptionPreviewResponse::Data#immediate_invoice
|
|
65
81
|
class ImmediateInvoice < Stigg::Internal::Type::BaseModel
|
|
66
82
|
# @!attribute sub_total
|
|
83
|
+
# Subtotal before discounts
|
|
67
84
|
#
|
|
68
85
|
# @return [Float]
|
|
69
86
|
required :sub_total, Float, api_name: :subTotal
|
|
70
87
|
|
|
71
88
|
# @!attribute total
|
|
89
|
+
# Invoice total
|
|
72
90
|
#
|
|
73
91
|
# @return [Float]
|
|
74
92
|
required :total, Float
|
|
75
93
|
|
|
76
94
|
# @!attribute billing_period_range
|
|
95
|
+
# Billing period covered
|
|
77
96
|
#
|
|
78
97
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::BillingPeriodRange, nil]
|
|
79
98
|
optional :billing_period_range,
|
|
@@ -81,16 +100,19 @@ module Stigg
|
|
|
81
100
|
api_name: :billingPeriodRange
|
|
82
101
|
|
|
83
102
|
# @!attribute currency
|
|
103
|
+
# Currency code
|
|
84
104
|
#
|
|
85
105
|
# @return [String, nil]
|
|
86
106
|
optional :currency, String, nil?: true
|
|
87
107
|
|
|
88
108
|
# @!attribute discount
|
|
109
|
+
# Total discount amount
|
|
89
110
|
#
|
|
90
111
|
# @return [Float, nil]
|
|
91
112
|
optional :discount, Float
|
|
92
113
|
|
|
93
114
|
# @!attribute discount_details
|
|
115
|
+
# Discount breakdown
|
|
94
116
|
#
|
|
95
117
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::DiscountDetails, nil]
|
|
96
118
|
optional :discount_details,
|
|
@@ -98,32 +120,45 @@ module Stigg
|
|
|
98
120
|
api_name: :discountDetails
|
|
99
121
|
|
|
100
122
|
# @!attribute discounts
|
|
123
|
+
# Applied discounts
|
|
101
124
|
#
|
|
102
125
|
# @return [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::Discount>, nil]
|
|
103
126
|
optional :discounts,
|
|
104
127
|
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::Discount] }
|
|
105
128
|
|
|
106
129
|
# @!attribute lines
|
|
130
|
+
# Line items
|
|
107
131
|
#
|
|
108
132
|
# @return [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::Line>, nil]
|
|
109
133
|
optional :lines,
|
|
110
134
|
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::Line] }
|
|
111
135
|
|
|
112
136
|
# @!attribute tax
|
|
137
|
+
# Tax amount
|
|
113
138
|
#
|
|
114
139
|
# @return [Float, nil]
|
|
115
140
|
optional :tax, Float
|
|
116
141
|
|
|
117
142
|
# @!method initialize(sub_total:, total:, billing_period_range: nil, currency: nil, discount: nil, discount_details: nil, discounts: nil, lines: nil, tax: nil)
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
# @param
|
|
121
|
-
#
|
|
122
|
-
# @param
|
|
123
|
-
#
|
|
124
|
-
# @param
|
|
125
|
-
#
|
|
126
|
-
# @param
|
|
143
|
+
# Invoice due immediately
|
|
144
|
+
#
|
|
145
|
+
# @param sub_total [Float] Subtotal before discounts
|
|
146
|
+
#
|
|
147
|
+
# @param total [Float] Invoice total
|
|
148
|
+
#
|
|
149
|
+
# @param billing_period_range [Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::BillingPeriodRange] Billing period covered
|
|
150
|
+
#
|
|
151
|
+
# @param currency [String, nil] Currency code
|
|
152
|
+
#
|
|
153
|
+
# @param discount [Float] Total discount amount
|
|
154
|
+
#
|
|
155
|
+
# @param discount_details [Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::DiscountDetails] Discount breakdown
|
|
156
|
+
#
|
|
157
|
+
# @param discounts [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::Discount>] Applied discounts
|
|
158
|
+
#
|
|
159
|
+
# @param lines [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice::Line>] Line items
|
|
160
|
+
#
|
|
161
|
+
# @param tax [Float] Tax amount
|
|
127
162
|
|
|
128
163
|
# @see Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice#billing_period_range
|
|
129
164
|
class BillingPeriodRange < Stigg::Internal::Type::BaseModel
|
|
@@ -140,6 +175,8 @@ module Stigg
|
|
|
140
175
|
required :start, Time
|
|
141
176
|
|
|
142
177
|
# @!method initialize(end_:, start:)
|
|
178
|
+
# Billing period covered
|
|
179
|
+
#
|
|
143
180
|
# @param end_ [Time] Billing period end date
|
|
144
181
|
#
|
|
145
182
|
# @param start [Time] Billing period start date
|
|
@@ -148,80 +185,105 @@ module Stigg
|
|
|
148
185
|
# @see Stigg::Models::V1::SubscriptionPreviewResponse::Data::ImmediateInvoice#discount_details
|
|
149
186
|
class DiscountDetails < Stigg::Internal::Type::BaseModel
|
|
150
187
|
# @!attribute code
|
|
188
|
+
# Promo code used
|
|
151
189
|
#
|
|
152
190
|
# @return [String, nil]
|
|
153
191
|
optional :code, String
|
|
154
192
|
|
|
155
193
|
# @!attribute fixed_amount
|
|
194
|
+
# Fixed discount amount
|
|
156
195
|
#
|
|
157
196
|
# @return [Float, nil]
|
|
158
197
|
optional :fixed_amount, Float, api_name: :fixedAmount
|
|
159
198
|
|
|
160
199
|
# @!attribute percentage
|
|
200
|
+
# Percentage discount
|
|
161
201
|
#
|
|
162
202
|
# @return [Float, nil]
|
|
163
203
|
optional :percentage, Float
|
|
164
204
|
|
|
165
205
|
# @!method initialize(code: nil, fixed_amount: nil, percentage: nil)
|
|
166
|
-
#
|
|
167
|
-
#
|
|
168
|
-
# @param
|
|
206
|
+
# Discount breakdown
|
|
207
|
+
#
|
|
208
|
+
# @param code [String] Promo code used
|
|
209
|
+
#
|
|
210
|
+
# @param fixed_amount [Float] Fixed discount amount
|
|
211
|
+
#
|
|
212
|
+
# @param percentage [Float] Percentage discount
|
|
169
213
|
end
|
|
170
214
|
|
|
171
215
|
class Discount < Stigg::Internal::Type::BaseModel
|
|
172
216
|
# @!attribute amount
|
|
217
|
+
# Discount amount
|
|
173
218
|
#
|
|
174
219
|
# @return [Float]
|
|
175
220
|
required :amount, Float
|
|
176
221
|
|
|
177
222
|
# @!attribute currency
|
|
223
|
+
# Currency code
|
|
178
224
|
#
|
|
179
225
|
# @return [String]
|
|
180
226
|
required :currency, String
|
|
181
227
|
|
|
182
228
|
# @!attribute description
|
|
229
|
+
# Discount description
|
|
183
230
|
#
|
|
184
231
|
# @return [String]
|
|
185
232
|
required :description, String
|
|
186
233
|
|
|
187
234
|
# @!method initialize(amount:, currency:, description:)
|
|
188
|
-
#
|
|
189
|
-
#
|
|
190
|
-
# @param
|
|
235
|
+
# Applied discount amount
|
|
236
|
+
#
|
|
237
|
+
# @param amount [Float] Discount amount
|
|
238
|
+
#
|
|
239
|
+
# @param currency [String] Currency code
|
|
240
|
+
#
|
|
241
|
+
# @param description [String] Discount description
|
|
191
242
|
end
|
|
192
243
|
|
|
193
244
|
class Line < Stigg::Internal::Type::BaseModel
|
|
194
245
|
# @!attribute currency
|
|
246
|
+
# Currency code
|
|
195
247
|
#
|
|
196
248
|
# @return [String]
|
|
197
249
|
required :currency, String
|
|
198
250
|
|
|
199
251
|
# @!attribute description
|
|
252
|
+
# Line item description
|
|
200
253
|
#
|
|
201
254
|
# @return [String]
|
|
202
255
|
required :description, String
|
|
203
256
|
|
|
204
257
|
# @!attribute sub_total
|
|
258
|
+
# Line subtotal
|
|
205
259
|
#
|
|
206
260
|
# @return [Float]
|
|
207
261
|
required :sub_total, Float, api_name: :subTotal
|
|
208
262
|
|
|
209
263
|
# @!attribute unit_price
|
|
264
|
+
# Price per unit
|
|
210
265
|
#
|
|
211
266
|
# @return [Float]
|
|
212
267
|
required :unit_price, Float, api_name: :unitPrice
|
|
213
268
|
|
|
214
269
|
# @!attribute quantity
|
|
270
|
+
# Quantity
|
|
215
271
|
#
|
|
216
272
|
# @return [Float, nil]
|
|
217
273
|
optional :quantity, Float
|
|
218
274
|
|
|
219
275
|
# @!method initialize(currency:, description:, sub_total:, unit_price:, quantity: nil)
|
|
220
|
-
#
|
|
221
|
-
#
|
|
222
|
-
# @param
|
|
223
|
-
#
|
|
224
|
-
# @param
|
|
276
|
+
# Invoice line item
|
|
277
|
+
#
|
|
278
|
+
# @param currency [String] Currency code
|
|
279
|
+
#
|
|
280
|
+
# @param description [String] Line item description
|
|
281
|
+
#
|
|
282
|
+
# @param sub_total [Float] Line subtotal
|
|
283
|
+
#
|
|
284
|
+
# @param unit_price [Float] Price per unit
|
|
285
|
+
#
|
|
286
|
+
# @param quantity [Float] Quantity
|
|
225
287
|
end
|
|
226
288
|
end
|
|
227
289
|
|
|
@@ -240,6 +302,8 @@ module Stigg
|
|
|
240
302
|
optional :start, Time
|
|
241
303
|
|
|
242
304
|
# @!method initialize(end_: nil, start: nil)
|
|
305
|
+
# Billing period range
|
|
306
|
+
#
|
|
243
307
|
# @param end_ [Time] Billing period end date
|
|
244
308
|
#
|
|
245
309
|
# @param start [Time] Billing period start date
|
|
@@ -247,33 +311,41 @@ module Stigg
|
|
|
247
311
|
|
|
248
312
|
class FreeItem < Stigg::Internal::Type::BaseModel
|
|
249
313
|
# @!attribute addon_id
|
|
314
|
+
# Addon ID
|
|
250
315
|
#
|
|
251
316
|
# @return [String]
|
|
252
317
|
required :addon_id, String, api_name: :addonId
|
|
253
318
|
|
|
254
319
|
# @!attribute quantity
|
|
320
|
+
# Quantity
|
|
255
321
|
#
|
|
256
322
|
# @return [Float]
|
|
257
323
|
required :quantity, Float
|
|
258
324
|
|
|
259
325
|
# @!method initialize(addon_id:, quantity:)
|
|
260
|
-
#
|
|
261
|
-
#
|
|
326
|
+
# Free item in subscription
|
|
327
|
+
#
|
|
328
|
+
# @param addon_id [String] Addon ID
|
|
329
|
+
#
|
|
330
|
+
# @param quantity [Float] Quantity
|
|
262
331
|
end
|
|
263
332
|
|
|
264
333
|
# @see Stigg::Models::V1::SubscriptionPreviewResponse::Data#recurring_invoice
|
|
265
334
|
class RecurringInvoice < Stigg::Internal::Type::BaseModel
|
|
266
335
|
# @!attribute sub_total
|
|
336
|
+
# Subtotal before discounts
|
|
267
337
|
#
|
|
268
338
|
# @return [Float]
|
|
269
339
|
required :sub_total, Float, api_name: :subTotal
|
|
270
340
|
|
|
271
341
|
# @!attribute total
|
|
342
|
+
# Invoice total
|
|
272
343
|
#
|
|
273
344
|
# @return [Float]
|
|
274
345
|
required :total, Float
|
|
275
346
|
|
|
276
347
|
# @!attribute billing_period_range
|
|
348
|
+
# Billing period covered
|
|
277
349
|
#
|
|
278
350
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::BillingPeriodRange, nil]
|
|
279
351
|
optional :billing_period_range,
|
|
@@ -281,16 +353,19 @@ module Stigg
|
|
|
281
353
|
api_name: :billingPeriodRange
|
|
282
354
|
|
|
283
355
|
# @!attribute currency
|
|
356
|
+
# Currency code
|
|
284
357
|
#
|
|
285
358
|
# @return [String, nil]
|
|
286
359
|
optional :currency, String, nil?: true
|
|
287
360
|
|
|
288
361
|
# @!attribute discount
|
|
362
|
+
# Total discount amount
|
|
289
363
|
#
|
|
290
364
|
# @return [Float, nil]
|
|
291
365
|
optional :discount, Float
|
|
292
366
|
|
|
293
367
|
# @!attribute discount_details
|
|
368
|
+
# Discount breakdown
|
|
294
369
|
#
|
|
295
370
|
# @return [Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::DiscountDetails, nil]
|
|
296
371
|
optional :discount_details,
|
|
@@ -298,32 +373,45 @@ module Stigg
|
|
|
298
373
|
api_name: :discountDetails
|
|
299
374
|
|
|
300
375
|
# @!attribute discounts
|
|
376
|
+
# Applied discounts
|
|
301
377
|
#
|
|
302
378
|
# @return [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::Discount>, nil]
|
|
303
379
|
optional :discounts,
|
|
304
380
|
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::Discount] }
|
|
305
381
|
|
|
306
382
|
# @!attribute lines
|
|
383
|
+
# Line items
|
|
307
384
|
#
|
|
308
385
|
# @return [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::Line>, nil]
|
|
309
386
|
optional :lines,
|
|
310
387
|
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::Line] }
|
|
311
388
|
|
|
312
389
|
# @!attribute tax
|
|
390
|
+
# Tax amount
|
|
313
391
|
#
|
|
314
392
|
# @return [Float, nil]
|
|
315
393
|
optional :tax, Float
|
|
316
394
|
|
|
317
395
|
# @!method initialize(sub_total:, total:, billing_period_range: nil, currency: nil, discount: nil, discount_details: nil, discounts: nil, lines: nil, tax: nil)
|
|
318
|
-
#
|
|
319
|
-
#
|
|
320
|
-
# @param
|
|
321
|
-
#
|
|
322
|
-
# @param
|
|
323
|
-
#
|
|
324
|
-
# @param
|
|
325
|
-
#
|
|
326
|
-
# @param
|
|
396
|
+
# Recurring invoice preview
|
|
397
|
+
#
|
|
398
|
+
# @param sub_total [Float] Subtotal before discounts
|
|
399
|
+
#
|
|
400
|
+
# @param total [Float] Invoice total
|
|
401
|
+
#
|
|
402
|
+
# @param billing_period_range [Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::BillingPeriodRange] Billing period covered
|
|
403
|
+
#
|
|
404
|
+
# @param currency [String, nil] Currency code
|
|
405
|
+
#
|
|
406
|
+
# @param discount [Float] Total discount amount
|
|
407
|
+
#
|
|
408
|
+
# @param discount_details [Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::DiscountDetails] Discount breakdown
|
|
409
|
+
#
|
|
410
|
+
# @param discounts [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::Discount>] Applied discounts
|
|
411
|
+
#
|
|
412
|
+
# @param lines [Array<Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice::Line>] Line items
|
|
413
|
+
#
|
|
414
|
+
# @param tax [Float] Tax amount
|
|
327
415
|
|
|
328
416
|
# @see Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice#billing_period_range
|
|
329
417
|
class BillingPeriodRange < Stigg::Internal::Type::BaseModel
|
|
@@ -340,6 +428,8 @@ module Stigg
|
|
|
340
428
|
required :start, Time
|
|
341
429
|
|
|
342
430
|
# @!method initialize(end_:, start:)
|
|
431
|
+
# Billing period covered
|
|
432
|
+
#
|
|
343
433
|
# @param end_ [Time] Billing period end date
|
|
344
434
|
#
|
|
345
435
|
# @param start [Time] Billing period start date
|
|
@@ -348,80 +438,105 @@ module Stigg
|
|
|
348
438
|
# @see Stigg::Models::V1::SubscriptionPreviewResponse::Data::RecurringInvoice#discount_details
|
|
349
439
|
class DiscountDetails < Stigg::Internal::Type::BaseModel
|
|
350
440
|
# @!attribute code
|
|
441
|
+
# Promo code used
|
|
351
442
|
#
|
|
352
443
|
# @return [String, nil]
|
|
353
444
|
optional :code, String
|
|
354
445
|
|
|
355
446
|
# @!attribute fixed_amount
|
|
447
|
+
# Fixed discount amount
|
|
356
448
|
#
|
|
357
449
|
# @return [Float, nil]
|
|
358
450
|
optional :fixed_amount, Float, api_name: :fixedAmount
|
|
359
451
|
|
|
360
452
|
# @!attribute percentage
|
|
453
|
+
# Percentage discount
|
|
361
454
|
#
|
|
362
455
|
# @return [Float, nil]
|
|
363
456
|
optional :percentage, Float
|
|
364
457
|
|
|
365
458
|
# @!method initialize(code: nil, fixed_amount: nil, percentage: nil)
|
|
366
|
-
#
|
|
367
|
-
#
|
|
368
|
-
# @param
|
|
459
|
+
# Discount breakdown
|
|
460
|
+
#
|
|
461
|
+
# @param code [String] Promo code used
|
|
462
|
+
#
|
|
463
|
+
# @param fixed_amount [Float] Fixed discount amount
|
|
464
|
+
#
|
|
465
|
+
# @param percentage [Float] Percentage discount
|
|
369
466
|
end
|
|
370
467
|
|
|
371
468
|
class Discount < Stigg::Internal::Type::BaseModel
|
|
372
469
|
# @!attribute amount
|
|
470
|
+
# Discount amount
|
|
373
471
|
#
|
|
374
472
|
# @return [Float]
|
|
375
473
|
required :amount, Float
|
|
376
474
|
|
|
377
475
|
# @!attribute currency
|
|
476
|
+
# Currency code
|
|
378
477
|
#
|
|
379
478
|
# @return [String]
|
|
380
479
|
required :currency, String
|
|
381
480
|
|
|
382
481
|
# @!attribute description
|
|
482
|
+
# Discount description
|
|
383
483
|
#
|
|
384
484
|
# @return [String]
|
|
385
485
|
required :description, String
|
|
386
486
|
|
|
387
487
|
# @!method initialize(amount:, currency:, description:)
|
|
388
|
-
#
|
|
389
|
-
#
|
|
390
|
-
# @param
|
|
488
|
+
# Applied discount amount
|
|
489
|
+
#
|
|
490
|
+
# @param amount [Float] Discount amount
|
|
491
|
+
#
|
|
492
|
+
# @param currency [String] Currency code
|
|
493
|
+
#
|
|
494
|
+
# @param description [String] Discount description
|
|
391
495
|
end
|
|
392
496
|
|
|
393
497
|
class Line < Stigg::Internal::Type::BaseModel
|
|
394
498
|
# @!attribute currency
|
|
499
|
+
# Currency code
|
|
395
500
|
#
|
|
396
501
|
# @return [String]
|
|
397
502
|
required :currency, String
|
|
398
503
|
|
|
399
504
|
# @!attribute description
|
|
505
|
+
# Line item description
|
|
400
506
|
#
|
|
401
507
|
# @return [String]
|
|
402
508
|
required :description, String
|
|
403
509
|
|
|
404
510
|
# @!attribute sub_total
|
|
511
|
+
# Line subtotal
|
|
405
512
|
#
|
|
406
513
|
# @return [Float]
|
|
407
514
|
required :sub_total, Float, api_name: :subTotal
|
|
408
515
|
|
|
409
516
|
# @!attribute unit_price
|
|
517
|
+
# Price per unit
|
|
410
518
|
#
|
|
411
519
|
# @return [Float]
|
|
412
520
|
required :unit_price, Float, api_name: :unitPrice
|
|
413
521
|
|
|
414
522
|
# @!attribute quantity
|
|
523
|
+
# Quantity
|
|
415
524
|
#
|
|
416
525
|
# @return [Float, nil]
|
|
417
526
|
optional :quantity, Float
|
|
418
527
|
|
|
419
528
|
# @!method initialize(currency:, description:, sub_total:, unit_price:, quantity: nil)
|
|
420
|
-
#
|
|
421
|
-
#
|
|
422
|
-
# @param
|
|
423
|
-
#
|
|
424
|
-
# @param
|
|
529
|
+
# Invoice line item
|
|
530
|
+
#
|
|
531
|
+
# @param currency [String] Currency code
|
|
532
|
+
#
|
|
533
|
+
# @param description [String] Line item description
|
|
534
|
+
#
|
|
535
|
+
# @param sub_total [Float] Line subtotal
|
|
536
|
+
#
|
|
537
|
+
# @param unit_price [Float] Price per unit
|
|
538
|
+
#
|
|
539
|
+
# @param quantity [Float] Quantity
|
|
425
540
|
end
|
|
426
541
|
end
|
|
427
542
|
end
|
|
@@ -6,12 +6,15 @@ module Stigg
|
|
|
6
6
|
# @see Stigg::Resources::V1::Subscriptions#retrieve
|
|
7
7
|
class SubscriptionRetrieveResponse < Stigg::Internal::Type::BaseModel
|
|
8
8
|
# @!attribute data
|
|
9
|
+
# Customer subscription to a plan
|
|
9
10
|
#
|
|
10
11
|
# @return [Stigg::Models::V1::SubscriptionRetrieveResponse::Data]
|
|
11
12
|
required :data, -> { Stigg::Models::V1::SubscriptionRetrieveResponse::Data }
|
|
12
13
|
|
|
13
14
|
# @!method initialize(data:)
|
|
14
|
-
#
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
17
|
+
# @param data [Stigg::Models::V1::SubscriptionRetrieveResponse::Data] Customer subscription to a plan
|
|
15
18
|
|
|
16
19
|
# @see Stigg::Models::V1::SubscriptionRetrieveResponse#data
|
|
17
20
|
class Data < Stigg::Internal::Type::BaseModel
|
|
@@ -133,6 +136,12 @@ module Stigg
|
|
|
133
136
|
api_name: :paymentCollectionMethod,
|
|
134
137
|
nil?: true
|
|
135
138
|
|
|
139
|
+
# @!attribute prices
|
|
140
|
+
#
|
|
141
|
+
# @return [Array<Stigg::Models::V1::SubscriptionRetrieveResponse::Data::Price>, nil]
|
|
142
|
+
optional :prices,
|
|
143
|
+
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionRetrieveResponse::Data::Price] }
|
|
144
|
+
|
|
136
145
|
# @!attribute resource_id
|
|
137
146
|
# Resource ID
|
|
138
147
|
#
|
|
@@ -145,7 +154,9 @@ module Stigg
|
|
|
145
154
|
# @return [Time, nil]
|
|
146
155
|
optional :trial_end_date, Time, api_name: :trialEndDate, nil?: true
|
|
147
156
|
|
|
148
|
-
# @!method initialize(id:, billing_id:, created_at:, customer_id:, payment_collection:, plan_id:, pricing_type:, start_date:, status:, cancellation_date: nil, cancel_reason: nil, current_billing_period_end: nil, current_billing_period_start: nil, effective_end_date: nil, end_date: nil, metadata: nil, paying_customer_id: nil, payment_collection_method: nil, resource_id: nil, trial_end_date: nil)
|
|
157
|
+
# @!method initialize(id:, billing_id:, created_at:, customer_id:, payment_collection:, plan_id:, pricing_type:, start_date:, status:, cancellation_date: nil, cancel_reason: nil, current_billing_period_end: nil, current_billing_period_start: nil, effective_end_date: nil, end_date: nil, metadata: nil, paying_customer_id: nil, payment_collection_method: nil, prices: nil, resource_id: nil, trial_end_date: nil)
|
|
158
|
+
# Customer subscription to a plan
|
|
159
|
+
#
|
|
149
160
|
# @param id [String] Subscription ID
|
|
150
161
|
#
|
|
151
162
|
# @param billing_id [String, nil] Billing ID
|
|
@@ -182,6 +193,8 @@ module Stigg
|
|
|
182
193
|
#
|
|
183
194
|
# @param payment_collection_method [Symbol, Stigg::Models::V1::SubscriptionRetrieveResponse::Data::PaymentCollectionMethod, nil] The method used to collect payments for a subscription
|
|
184
195
|
#
|
|
196
|
+
# @param prices [Array<Stigg::Models::V1::SubscriptionRetrieveResponse::Data::Price>]
|
|
197
|
+
#
|
|
185
198
|
# @param resource_id [String, nil] Resource ID
|
|
186
199
|
#
|
|
187
200
|
# @param trial_end_date [Time, nil] Subscription trial end date
|
|
@@ -267,6 +280,33 @@ module Stigg
|
|
|
267
280
|
# @!method self.values
|
|
268
281
|
# @return [Array<Symbol>]
|
|
269
282
|
end
|
|
283
|
+
|
|
284
|
+
class Price < Stigg::Internal::Type::BaseModel
|
|
285
|
+
# @!attribute id
|
|
286
|
+
# Price ID
|
|
287
|
+
#
|
|
288
|
+
# @return [String]
|
|
289
|
+
required :id, String
|
|
290
|
+
|
|
291
|
+
# @!attribute created_at
|
|
292
|
+
# Creation timestamp
|
|
293
|
+
#
|
|
294
|
+
# @return [String]
|
|
295
|
+
required :created_at, String, api_name: :createdAt
|
|
296
|
+
|
|
297
|
+
# @!attribute updated_at
|
|
298
|
+
# Last update timestamp
|
|
299
|
+
#
|
|
300
|
+
# @return [String]
|
|
301
|
+
required :updated_at, String, api_name: :updatedAt
|
|
302
|
+
|
|
303
|
+
# @!method initialize(id:, created_at:, updated_at:)
|
|
304
|
+
# @param id [String] Price ID
|
|
305
|
+
#
|
|
306
|
+
# @param created_at [String] Creation timestamp
|
|
307
|
+
#
|
|
308
|
+
# @param updated_at [String] Last update timestamp
|
|
309
|
+
end
|
|
270
310
|
end
|
|
271
311
|
end
|
|
272
312
|
end
|
|
@@ -9,17 +9,13 @@ module Stigg
|
|
|
9
9
|
include Stigg::Internal::Type::RequestParameters
|
|
10
10
|
|
|
11
11
|
# @!attribute destination_resource_id
|
|
12
|
-
#
|
|
13
|
-
# belong to the same customer.
|
|
12
|
+
# Resource ID to transfer the subscription to
|
|
14
13
|
#
|
|
15
14
|
# @return [String]
|
|
16
15
|
required :destination_resource_id, String, api_name: :destinationResourceId
|
|
17
16
|
|
|
18
17
|
# @!method initialize(destination_resource_id:, request_options: {})
|
|
19
|
-
#
|
|
20
|
-
# {Stigg::Models::V1::SubscriptionTransferParams} for more details.
|
|
21
|
-
#
|
|
22
|
-
# @param destination_resource_id [String] The resource ID to transfer the subscription to. The destination resource must b
|
|
18
|
+
# @param destination_resource_id [String] Resource ID to transfer the subscription to
|
|
23
19
|
#
|
|
24
20
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
|
|
25
21
|
end
|