stigg 0.1.0.pre.alpha.2 → 0.1.0.pre.alpha.3

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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/stigg/internal/type/base_model.rb +2 -2
  5. data/lib/stigg/models/v1/{coupon_create_response.rb → coupon.rb} +24 -24
  6. data/lib/stigg/models/v1/customer_import_params.rb +75 -0
  7. data/lib/stigg/models/v1/customer_import_response.rb +35 -0
  8. data/lib/stigg/models/v1/{customer_create_params.rb → customer_provision_params.rb} +16 -16
  9. data/lib/stigg/models/v1/customer_response.rb +1 -1
  10. data/lib/stigg/models/v1/customers/promotional_entitlement_grant_params.rb +296 -0
  11. data/lib/stigg/models/v1/customers/promotional_entitlement_grant_response.rb +341 -0
  12. data/lib/stigg/models/v1/customers/promotional_entitlement_revoke_params.rb +24 -0
  13. data/lib/stigg/models/v1/customers/promotional_entitlement_revoke_response.rb +342 -0
  14. data/lib/stigg/models/v1/event_report_params.rb +91 -0
  15. data/lib/stigg/models/v1/event_report_response.rb +25 -0
  16. data/lib/stigg/models/v1/{subscription_retrieve_response.rb → subscription.rb} +30 -29
  17. data/lib/stigg/models/v1/subscription_cancel_params.rb +75 -0
  18. data/lib/stigg/models/v1/subscription_import_params.rb +92 -0
  19. data/lib/stigg/models/v1/subscription_import_response.rb +32 -0
  20. data/lib/stigg/models/v1/{subscription_create_params.rb → subscription_provision_params.rb} +118 -118
  21. data/lib/stigg/models/v1/{subscription_create_response.rb → subscription_provision_response.rb} +76 -75
  22. data/lib/stigg/models/v1/subscription_update_params.rb +1114 -0
  23. data/lib/stigg/models/v1/subscriptions/{future_update_cancel_pending_payment_response.rb → cancel_subscription.rb} +7 -5
  24. data/lib/stigg/models/v1/usage_history_params.rb +54 -0
  25. data/lib/stigg/models/v1/usage_history_response.rb +155 -0
  26. data/lib/stigg/models/v1/usage_report_params.rb +114 -0
  27. data/lib/stigg/models/v1/usage_report_response.rb +120 -0
  28. data/lib/stigg/models.rb +0 -4
  29. data/lib/stigg/resources/v1/coupons.rb +4 -4
  30. data/lib/stigg/resources/v1/customers/promotional_entitlements.rb +69 -0
  31. data/lib/stigg/resources/v1/customers.rb +59 -37
  32. data/lib/stigg/resources/v1/events.rb +38 -0
  33. data/lib/stigg/resources/v1/subscriptions/future_update.rb +4 -4
  34. data/lib/stigg/resources/v1/subscriptions.rb +166 -64
  35. data/lib/stigg/resources/v1/usage.rb +79 -0
  36. data/lib/stigg/resources/v1.rb +6 -42
  37. data/lib/stigg/version.rb +1 -1
  38. data/lib/stigg.rb +25 -16
  39. data/rbi/stigg/models/v1/{coupon_create_response.rbi → coupon.rbi} +156 -252
  40. data/rbi/stigg/models/v1/customer_import_params.rbi +130 -0
  41. data/rbi/stigg/models/v1/customer_import_response.rbi +76 -0
  42. data/rbi/stigg/models/v1/{customer_create_params.rbi → customer_provision_params.rbi} +35 -35
  43. data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_params.rbi +640 -0
  44. data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_response.rbi +690 -0
  45. data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_params.rbi +42 -0
  46. data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbi +696 -0
  47. data/rbi/stigg/models/v1/event_report_params.rbi +168 -0
  48. data/rbi/stigg/models/v1/event_report_response.rbi +35 -0
  49. data/rbi/stigg/models/v1/{subscription_migrate_response.rbi → subscription.rbi} +66 -117
  50. data/rbi/stigg/models/v1/subscription_cancel_params.rbi +182 -0
  51. data/rbi/stigg/models/v1/subscription_import_params.rbi +148 -0
  52. data/rbi/stigg/models/v1/subscription_import_response.rbi +69 -0
  53. data/rbi/stigg/models/v1/{subscription_create_params.rbi → subscription_provision_params.rbi} +794 -773
  54. data/rbi/stigg/models/v1/{subscription_create_response.rbi → subscription_provision_response.rbi} +481 -481
  55. data/rbi/stigg/models/v1/subscription_update_params.rbi +3578 -0
  56. data/rbi/stigg/models/v1/subscriptions/{future_update_cancel_schedule_response.rbi → cancel_subscription.rbi} +9 -16
  57. data/rbi/stigg/models/v1/usage_history_params.rbi +79 -0
  58. data/rbi/stigg/models/v1/usage_history_response.rbi +347 -0
  59. data/rbi/stigg/models/v1/usage_report_params.rbi +227 -0
  60. data/rbi/stigg/models/v1/usage_report_response.rbi +162 -0
  61. data/rbi/stigg/models.rbi +0 -4
  62. data/rbi/stigg/resources/v1/coupons.rbi +2 -2
  63. data/rbi/stigg/resources/v1/customers/promotional_entitlements.rbi +57 -0
  64. data/rbi/stigg/resources/v1/customers.rbi +53 -36
  65. data/rbi/stigg/resources/v1/events.rbi +28 -0
  66. data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +2 -6
  67. data/rbi/stigg/resources/v1/subscriptions.rbi +179 -74
  68. data/rbi/stigg/resources/v1/usage.rbi +57 -0
  69. data/rbi/stigg/resources/v1.rbi +4 -26
  70. data/sig/stigg/models/v1/{coupon_create_response.rbs → coupon.rbs} +29 -32
  71. data/sig/stigg/models/v1/customer_import_params.rbs +74 -0
  72. data/sig/stigg/models/v1/customer_import_response.rbs +30 -0
  73. data/sig/stigg/models/v1/{customer_create_params.rbs → customer_provision_params.rbs} +22 -22
  74. data/sig/stigg/models/v1/customers/promotional_entitlement_grant_params.rbs +234 -0
  75. data/sig/stigg/models/v1/customers/promotional_entitlement_grant_response.rbs +281 -0
  76. data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_params.rbs +27 -0
  77. data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbs +281 -0
  78. data/sig/stigg/models/v1/event_report_params.rbs +82 -0
  79. data/sig/stigg/models/v1/event_report_response.rbs +15 -0
  80. data/sig/stigg/models/v1/{subscription_retrieve_response.rbs → subscription.rbs} +36 -41
  81. data/sig/stigg/models/v1/subscription_cancel_params.rbs +79 -0
  82. data/sig/stigg/models/v1/subscription_import_params.rbs +84 -0
  83. data/sig/stigg/models/v1/subscription_import_response.rbs +30 -0
  84. data/sig/stigg/models/v1/{subscription_create_params.rbs → subscription_provision_params.rbs} +200 -200
  85. data/sig/stigg/models/v1/{subscription_create_response.rbs → subscription_provision_response.rbs} +106 -106
  86. data/sig/stigg/models/v1/subscription_update_params.rbs +1544 -0
  87. data/sig/stigg/models/v1/subscriptions/cancel_subscription.rbs +34 -0
  88. data/sig/stigg/models/v1/usage_history_params.rbs +52 -0
  89. data/sig/stigg/models/v1/usage_history_response.rbs +129 -0
  90. data/sig/stigg/models/v1/usage_report_params.rbs +102 -0
  91. data/sig/stigg/models/v1/usage_report_response.rbs +87 -0
  92. data/sig/stigg/models.rbs +0 -4
  93. data/sig/stigg/resources/v1/coupons.rbs +2 -2
  94. data/sig/stigg/resources/v1/customers/promotional_entitlements.rbs +23 -0
  95. data/sig/stigg/resources/v1/customers.rbs +17 -12
  96. data/sig/stigg/resources/v1/events.rbs +14 -0
  97. data/sig/stigg/resources/v1/subscriptions/future_update.rbs +2 -2
  98. data/sig/stigg/resources/v1/subscriptions.rbs +65 -32
  99. data/sig/stigg/resources/v1/usage.rbs +24 -0
  100. data/sig/stigg/resources/v1.rbs +2 -8
  101. metadata +77 -50
  102. data/lib/stigg/models/v1/coupon_retrieve_response.rb +0 -322
  103. data/lib/stigg/models/v1/subscription_delegate_response.rb +0 -314
  104. data/lib/stigg/models/v1/subscription_migrate_response.rb +0 -314
  105. data/lib/stigg/models/v1/subscription_transfer_response.rb +0 -314
  106. data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +0 -34
  107. data/lib/stigg/models/v1_create_event_params.rb +0 -89
  108. data/lib/stigg/models/v1_create_event_response.rb +0 -23
  109. data/lib/stigg/models/v1_create_usage_params.rb +0 -112
  110. data/lib/stigg/models/v1_create_usage_response.rb +0 -118
  111. data/lib/stigg/resources/v1/customers/usage.rb +0 -18
  112. data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +0 -987
  113. data/rbi/stigg/models/v1/subscription_delegate_response.rbi +0 -618
  114. data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +0 -618
  115. data/rbi/stigg/models/v1/subscription_transfer_response.rbi +0 -618
  116. data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +0 -80
  117. data/rbi/stigg/models/v1_create_event_params.rbi +0 -161
  118. data/rbi/stigg/models/v1_create_event_response.rbi +0 -30
  119. data/rbi/stigg/models/v1_create_usage_params.rbi +0 -217
  120. data/rbi/stigg/models/v1_create_usage_response.rbi +0 -157
  121. data/rbi/stigg/resources/v1/customers/usage.rbi +0 -16
  122. data/sig/stigg/models/v1/coupon_retrieve_response.rbs +0 -394
  123. data/sig/stigg/models/v1/subscription_delegate_response.rbs +0 -255
  124. data/sig/stigg/models/v1/subscription_migrate_response.rbs +0 -255
  125. data/sig/stigg/models/v1/subscription_transfer_response.rbs +0 -255
  126. data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +0 -34
  127. data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +0 -34
  128. data/sig/stigg/models/v1_create_event_params.rbs +0 -80
  129. data/sig/stigg/models/v1_create_event_response.rbs +0 -13
  130. data/sig/stigg/models/v1_create_usage_params.rbs +0 -100
  131. data/sig/stigg/models/v1_create_usage_response.rbs +0 -85
  132. data/sig/stigg/resources/v1/customers/usage.rbs +0 -11
@@ -1,314 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stigg
4
- module Models
5
- module V1
6
- # @see Stigg::Resources::V1::Subscriptions#delegate
7
- class SubscriptionDelegateResponse < Stigg::Internal::Type::BaseModel
8
- # @!attribute data
9
- # Customer subscription to a plan
10
- #
11
- # @return [Stigg::Models::V1::SubscriptionDelegateResponse::Data]
12
- required :data, -> { Stigg::Models::V1::SubscriptionDelegateResponse::Data }
13
-
14
- # @!method initialize(data:)
15
- # Response object
16
- #
17
- # @param data [Stigg::Models::V1::SubscriptionDelegateResponse::Data] Customer subscription to a plan
18
-
19
- # @see Stigg::Models::V1::SubscriptionDelegateResponse#data
20
- class Data < Stigg::Internal::Type::BaseModel
21
- # @!attribute id
22
- # Subscription ID
23
- #
24
- # @return [String]
25
- required :id, String
26
-
27
- # @!attribute billing_id
28
- # Billing ID
29
- #
30
- # @return [String, nil]
31
- required :billing_id, String, api_name: :billingId, nil?: true
32
-
33
- # @!attribute created_at
34
- # Created at
35
- #
36
- # @return [Time]
37
- required :created_at, Time, api_name: :createdAt
38
-
39
- # @!attribute customer_id
40
- # Customer ID
41
- #
42
- # @return [String]
43
- required :customer_id, String, api_name: :customerId
44
-
45
- # @!attribute payment_collection
46
- # Payment collection
47
- #
48
- # @return [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::PaymentCollection]
49
- required :payment_collection,
50
- enum: -> { Stigg::Models::V1::SubscriptionDelegateResponse::Data::PaymentCollection },
51
- api_name: :paymentCollection
52
-
53
- # @!attribute plan_id
54
- # Plan ID
55
- #
56
- # @return [String]
57
- required :plan_id, String, api_name: :planId
58
-
59
- # @!attribute pricing_type
60
- # Pricing type
61
- #
62
- # @return [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::PricingType]
63
- required :pricing_type,
64
- enum: -> { Stigg::Models::V1::SubscriptionDelegateResponse::Data::PricingType },
65
- api_name: :pricingType
66
-
67
- # @!attribute start_date
68
- # Subscription start date
69
- #
70
- # @return [Time]
71
- required :start_date, Time, api_name: :startDate
72
-
73
- # @!attribute status
74
- # Subscription status
75
- #
76
- # @return [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::Status]
77
- required :status, enum: -> { Stigg::Models::V1::SubscriptionDelegateResponse::Data::Status }
78
-
79
- # @!attribute cancellation_date
80
- # Subscription cancellation date
81
- #
82
- # @return [Time, nil]
83
- optional :cancellation_date, Time, api_name: :cancellationDate, nil?: true
84
-
85
- # @!attribute cancel_reason
86
- # Subscription cancel reason
87
- #
88
- # @return [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::CancelReason, nil]
89
- optional :cancel_reason,
90
- enum: -> { Stigg::Models::V1::SubscriptionDelegateResponse::Data::CancelReason },
91
- api_name: :cancelReason,
92
- nil?: true
93
-
94
- # @!attribute current_billing_period_end
95
- # End of the current billing period
96
- #
97
- # @return [Time, nil]
98
- optional :current_billing_period_end, Time, api_name: :currentBillingPeriodEnd, nil?: true
99
-
100
- # @!attribute current_billing_period_start
101
- # Start of the current billing period
102
- #
103
- # @return [Time, nil]
104
- optional :current_billing_period_start, Time, api_name: :currentBillingPeriodStart, nil?: true
105
-
106
- # @!attribute effective_end_date
107
- # Subscription effective end date
108
- #
109
- # @return [Time, nil]
110
- optional :effective_end_date, Time, api_name: :effectiveEndDate, nil?: true
111
-
112
- # @!attribute end_date
113
- # Subscription end date
114
- #
115
- # @return [Time, nil]
116
- optional :end_date, Time, api_name: :endDate, nil?: true
117
-
118
- # @!attribute metadata
119
- # Additional metadata for the subscription
120
- #
121
- # @return [Hash{Symbol=>String}, nil]
122
- optional :metadata, Stigg::Internal::Type::HashOf[String]
123
-
124
- # @!attribute paying_customer_id
125
- # Paying customer ID for delegated billing
126
- #
127
- # @return [String, nil]
128
- optional :paying_customer_id, String, api_name: :payingCustomerId, nil?: true
129
-
130
- # @!attribute payment_collection_method
131
- # The method used to collect payments for a subscription
132
- #
133
- # @return [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::PaymentCollectionMethod, nil]
134
- optional :payment_collection_method,
135
- enum: -> { Stigg::Models::V1::SubscriptionDelegateResponse::Data::PaymentCollectionMethod },
136
- api_name: :paymentCollectionMethod,
137
- nil?: true
138
-
139
- # @!attribute prices
140
- #
141
- # @return [Array<Stigg::Models::V1::SubscriptionDelegateResponse::Data::Price>, nil]
142
- optional :prices,
143
- -> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionDelegateResponse::Data::Price] }
144
-
145
- # @!attribute resource_id
146
- # Resource ID
147
- #
148
- # @return [String, nil]
149
- optional :resource_id, String, api_name: :resourceId, nil?: true
150
-
151
- # @!attribute trial_end_date
152
- # Subscription trial end date
153
- #
154
- # @return [Time, nil]
155
- optional :trial_end_date, Time, api_name: :trialEndDate, nil?: true
156
-
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
- #
160
- # @param id [String] Subscription ID
161
- #
162
- # @param billing_id [String, nil] Billing ID
163
- #
164
- # @param created_at [Time] Created at
165
- #
166
- # @param customer_id [String] Customer ID
167
- #
168
- # @param payment_collection [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::PaymentCollection] Payment collection
169
- #
170
- # @param plan_id [String] Plan ID
171
- #
172
- # @param pricing_type [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::PricingType] Pricing type
173
- #
174
- # @param start_date [Time] Subscription start date
175
- #
176
- # @param status [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::Status] Subscription status
177
- #
178
- # @param cancellation_date [Time, nil] Subscription cancellation date
179
- #
180
- # @param cancel_reason [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::CancelReason, nil] Subscription cancel reason
181
- #
182
- # @param current_billing_period_end [Time, nil] End of the current billing period
183
- #
184
- # @param current_billing_period_start [Time, nil] Start of the current billing period
185
- #
186
- # @param effective_end_date [Time, nil] Subscription effective end date
187
- #
188
- # @param end_date [Time, nil] Subscription end date
189
- #
190
- # @param metadata [Hash{Symbol=>String}] Additional metadata for the subscription
191
- #
192
- # @param paying_customer_id [String, nil] Paying customer ID for delegated billing
193
- #
194
- # @param payment_collection_method [Symbol, Stigg::Models::V1::SubscriptionDelegateResponse::Data::PaymentCollectionMethod, nil] The method used to collect payments for a subscription
195
- #
196
- # @param prices [Array<Stigg::Models::V1::SubscriptionDelegateResponse::Data::Price>]
197
- #
198
- # @param resource_id [String, nil] Resource ID
199
- #
200
- # @param trial_end_date [Time, nil] Subscription trial end date
201
-
202
- # Payment collection
203
- #
204
- # @see Stigg::Models::V1::SubscriptionDelegateResponse::Data#payment_collection
205
- module PaymentCollection
206
- extend Stigg::Internal::Type::Enum
207
-
208
- NOT_REQUIRED = :NOT_REQUIRED
209
- PROCESSING = :PROCESSING
210
- FAILED = :FAILED
211
- ACTION_REQUIRED = :ACTION_REQUIRED
212
-
213
- # @!method self.values
214
- # @return [Array<Symbol>]
215
- end
216
-
217
- # Pricing type
218
- #
219
- # @see Stigg::Models::V1::SubscriptionDelegateResponse::Data#pricing_type
220
- module PricingType
221
- extend Stigg::Internal::Type::Enum
222
-
223
- FREE = :FREE
224
- PAID = :PAID
225
- CUSTOM = :CUSTOM
226
-
227
- # @!method self.values
228
- # @return [Array<Symbol>]
229
- end
230
-
231
- # Subscription status
232
- #
233
- # @see Stigg::Models::V1::SubscriptionDelegateResponse::Data#status
234
- module Status
235
- extend Stigg::Internal::Type::Enum
236
-
237
- PAYMENT_PENDING = :PAYMENT_PENDING
238
- ACTIVE = :ACTIVE
239
- EXPIRED = :EXPIRED
240
- IN_TRIAL = :IN_TRIAL
241
- CANCELED = :CANCELED
242
- NOT_STARTED = :NOT_STARTED
243
-
244
- # @!method self.values
245
- # @return [Array<Symbol>]
246
- end
247
-
248
- # Subscription cancel reason
249
- #
250
- # @see Stigg::Models::V1::SubscriptionDelegateResponse::Data#cancel_reason
251
- module CancelReason
252
- extend Stigg::Internal::Type::Enum
253
-
254
- UPGRADE_OR_DOWNGRADE = :UPGRADE_OR_DOWNGRADE
255
- CANCELLED_BY_BILLING = :CANCELLED_BY_BILLING
256
- EXPIRED = :EXPIRED
257
- DETACH_BILLING = :DETACH_BILLING
258
- TRIAL_ENDED = :TRIAL_ENDED
259
- IMMEDIATE = :Immediate
260
- TRIAL_CONVERTED = :TRIAL_CONVERTED
261
- PENDING_PAYMENT_EXPIRED = :PENDING_PAYMENT_EXPIRED
262
- SCHEDULED_CANCELLATION = :ScheduledCancellation
263
- CUSTOMER_ARCHIVED = :CustomerArchived
264
- AUTO_CANCELLATION_RULE = :AutoCancellationRule
265
-
266
- # @!method self.values
267
- # @return [Array<Symbol>]
268
- end
269
-
270
- # The method used to collect payments for a subscription
271
- #
272
- # @see Stigg::Models::V1::SubscriptionDelegateResponse::Data#payment_collection_method
273
- module PaymentCollectionMethod
274
- extend Stigg::Internal::Type::Enum
275
-
276
- CHARGE = :CHARGE
277
- INVOICE = :INVOICE
278
- NONE = :NONE
279
-
280
- # @!method self.values
281
- # @return [Array<Symbol>]
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
310
- end
311
- end
312
- end
313
- end
314
- end
@@ -1,314 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stigg
4
- module Models
5
- module V1
6
- # @see Stigg::Resources::V1::Subscriptions#migrate
7
- class SubscriptionMigrateResponse < Stigg::Internal::Type::BaseModel
8
- # @!attribute data
9
- # Customer subscription to a plan
10
- #
11
- # @return [Stigg::Models::V1::SubscriptionMigrateResponse::Data]
12
- required :data, -> { Stigg::Models::V1::SubscriptionMigrateResponse::Data }
13
-
14
- # @!method initialize(data:)
15
- # Response object
16
- #
17
- # @param data [Stigg::Models::V1::SubscriptionMigrateResponse::Data] Customer subscription to a plan
18
-
19
- # @see Stigg::Models::V1::SubscriptionMigrateResponse#data
20
- class Data < Stigg::Internal::Type::BaseModel
21
- # @!attribute id
22
- # Subscription ID
23
- #
24
- # @return [String]
25
- required :id, String
26
-
27
- # @!attribute billing_id
28
- # Billing ID
29
- #
30
- # @return [String, nil]
31
- required :billing_id, String, api_name: :billingId, nil?: true
32
-
33
- # @!attribute created_at
34
- # Created at
35
- #
36
- # @return [Time]
37
- required :created_at, Time, api_name: :createdAt
38
-
39
- # @!attribute customer_id
40
- # Customer ID
41
- #
42
- # @return [String]
43
- required :customer_id, String, api_name: :customerId
44
-
45
- # @!attribute payment_collection
46
- # Payment collection
47
- #
48
- # @return [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::PaymentCollection]
49
- required :payment_collection,
50
- enum: -> { Stigg::Models::V1::SubscriptionMigrateResponse::Data::PaymentCollection },
51
- api_name: :paymentCollection
52
-
53
- # @!attribute plan_id
54
- # Plan ID
55
- #
56
- # @return [String]
57
- required :plan_id, String, api_name: :planId
58
-
59
- # @!attribute pricing_type
60
- # Pricing type
61
- #
62
- # @return [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::PricingType]
63
- required :pricing_type,
64
- enum: -> { Stigg::Models::V1::SubscriptionMigrateResponse::Data::PricingType },
65
- api_name: :pricingType
66
-
67
- # @!attribute start_date
68
- # Subscription start date
69
- #
70
- # @return [Time]
71
- required :start_date, Time, api_name: :startDate
72
-
73
- # @!attribute status
74
- # Subscription status
75
- #
76
- # @return [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::Status]
77
- required :status, enum: -> { Stigg::Models::V1::SubscriptionMigrateResponse::Data::Status }
78
-
79
- # @!attribute cancellation_date
80
- # Subscription cancellation date
81
- #
82
- # @return [Time, nil]
83
- optional :cancellation_date, Time, api_name: :cancellationDate, nil?: true
84
-
85
- # @!attribute cancel_reason
86
- # Subscription cancel reason
87
- #
88
- # @return [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::CancelReason, nil]
89
- optional :cancel_reason,
90
- enum: -> { Stigg::Models::V1::SubscriptionMigrateResponse::Data::CancelReason },
91
- api_name: :cancelReason,
92
- nil?: true
93
-
94
- # @!attribute current_billing_period_end
95
- # End of the current billing period
96
- #
97
- # @return [Time, nil]
98
- optional :current_billing_period_end, Time, api_name: :currentBillingPeriodEnd, nil?: true
99
-
100
- # @!attribute current_billing_period_start
101
- # Start of the current billing period
102
- #
103
- # @return [Time, nil]
104
- optional :current_billing_period_start, Time, api_name: :currentBillingPeriodStart, nil?: true
105
-
106
- # @!attribute effective_end_date
107
- # Subscription effective end date
108
- #
109
- # @return [Time, nil]
110
- optional :effective_end_date, Time, api_name: :effectiveEndDate, nil?: true
111
-
112
- # @!attribute end_date
113
- # Subscription end date
114
- #
115
- # @return [Time, nil]
116
- optional :end_date, Time, api_name: :endDate, nil?: true
117
-
118
- # @!attribute metadata
119
- # Additional metadata for the subscription
120
- #
121
- # @return [Hash{Symbol=>String}, nil]
122
- optional :metadata, Stigg::Internal::Type::HashOf[String]
123
-
124
- # @!attribute paying_customer_id
125
- # Paying customer ID for delegated billing
126
- #
127
- # @return [String, nil]
128
- optional :paying_customer_id, String, api_name: :payingCustomerId, nil?: true
129
-
130
- # @!attribute payment_collection_method
131
- # The method used to collect payments for a subscription
132
- #
133
- # @return [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::PaymentCollectionMethod, nil]
134
- optional :payment_collection_method,
135
- enum: -> { Stigg::Models::V1::SubscriptionMigrateResponse::Data::PaymentCollectionMethod },
136
- api_name: :paymentCollectionMethod,
137
- nil?: true
138
-
139
- # @!attribute prices
140
- #
141
- # @return [Array<Stigg::Models::V1::SubscriptionMigrateResponse::Data::Price>, nil]
142
- optional :prices,
143
- -> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionMigrateResponse::Data::Price] }
144
-
145
- # @!attribute resource_id
146
- # Resource ID
147
- #
148
- # @return [String, nil]
149
- optional :resource_id, String, api_name: :resourceId, nil?: true
150
-
151
- # @!attribute trial_end_date
152
- # Subscription trial end date
153
- #
154
- # @return [Time, nil]
155
- optional :trial_end_date, Time, api_name: :trialEndDate, nil?: true
156
-
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
- #
160
- # @param id [String] Subscription ID
161
- #
162
- # @param billing_id [String, nil] Billing ID
163
- #
164
- # @param created_at [Time] Created at
165
- #
166
- # @param customer_id [String] Customer ID
167
- #
168
- # @param payment_collection [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::PaymentCollection] Payment collection
169
- #
170
- # @param plan_id [String] Plan ID
171
- #
172
- # @param pricing_type [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::PricingType] Pricing type
173
- #
174
- # @param start_date [Time] Subscription start date
175
- #
176
- # @param status [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::Status] Subscription status
177
- #
178
- # @param cancellation_date [Time, nil] Subscription cancellation date
179
- #
180
- # @param cancel_reason [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::CancelReason, nil] Subscription cancel reason
181
- #
182
- # @param current_billing_period_end [Time, nil] End of the current billing period
183
- #
184
- # @param current_billing_period_start [Time, nil] Start of the current billing period
185
- #
186
- # @param effective_end_date [Time, nil] Subscription effective end date
187
- #
188
- # @param end_date [Time, nil] Subscription end date
189
- #
190
- # @param metadata [Hash{Symbol=>String}] Additional metadata for the subscription
191
- #
192
- # @param paying_customer_id [String, nil] Paying customer ID for delegated billing
193
- #
194
- # @param payment_collection_method [Symbol, Stigg::Models::V1::SubscriptionMigrateResponse::Data::PaymentCollectionMethod, nil] The method used to collect payments for a subscription
195
- #
196
- # @param prices [Array<Stigg::Models::V1::SubscriptionMigrateResponse::Data::Price>]
197
- #
198
- # @param resource_id [String, nil] Resource ID
199
- #
200
- # @param trial_end_date [Time, nil] Subscription trial end date
201
-
202
- # Payment collection
203
- #
204
- # @see Stigg::Models::V1::SubscriptionMigrateResponse::Data#payment_collection
205
- module PaymentCollection
206
- extend Stigg::Internal::Type::Enum
207
-
208
- NOT_REQUIRED = :NOT_REQUIRED
209
- PROCESSING = :PROCESSING
210
- FAILED = :FAILED
211
- ACTION_REQUIRED = :ACTION_REQUIRED
212
-
213
- # @!method self.values
214
- # @return [Array<Symbol>]
215
- end
216
-
217
- # Pricing type
218
- #
219
- # @see Stigg::Models::V1::SubscriptionMigrateResponse::Data#pricing_type
220
- module PricingType
221
- extend Stigg::Internal::Type::Enum
222
-
223
- FREE = :FREE
224
- PAID = :PAID
225
- CUSTOM = :CUSTOM
226
-
227
- # @!method self.values
228
- # @return [Array<Symbol>]
229
- end
230
-
231
- # Subscription status
232
- #
233
- # @see Stigg::Models::V1::SubscriptionMigrateResponse::Data#status
234
- module Status
235
- extend Stigg::Internal::Type::Enum
236
-
237
- PAYMENT_PENDING = :PAYMENT_PENDING
238
- ACTIVE = :ACTIVE
239
- EXPIRED = :EXPIRED
240
- IN_TRIAL = :IN_TRIAL
241
- CANCELED = :CANCELED
242
- NOT_STARTED = :NOT_STARTED
243
-
244
- # @!method self.values
245
- # @return [Array<Symbol>]
246
- end
247
-
248
- # Subscription cancel reason
249
- #
250
- # @see Stigg::Models::V1::SubscriptionMigrateResponse::Data#cancel_reason
251
- module CancelReason
252
- extend Stigg::Internal::Type::Enum
253
-
254
- UPGRADE_OR_DOWNGRADE = :UPGRADE_OR_DOWNGRADE
255
- CANCELLED_BY_BILLING = :CANCELLED_BY_BILLING
256
- EXPIRED = :EXPIRED
257
- DETACH_BILLING = :DETACH_BILLING
258
- TRIAL_ENDED = :TRIAL_ENDED
259
- IMMEDIATE = :Immediate
260
- TRIAL_CONVERTED = :TRIAL_CONVERTED
261
- PENDING_PAYMENT_EXPIRED = :PENDING_PAYMENT_EXPIRED
262
- SCHEDULED_CANCELLATION = :ScheduledCancellation
263
- CUSTOMER_ARCHIVED = :CustomerArchived
264
- AUTO_CANCELLATION_RULE = :AutoCancellationRule
265
-
266
- # @!method self.values
267
- # @return [Array<Symbol>]
268
- end
269
-
270
- # The method used to collect payments for a subscription
271
- #
272
- # @see Stigg::Models::V1::SubscriptionMigrateResponse::Data#payment_collection_method
273
- module PaymentCollectionMethod
274
- extend Stigg::Internal::Type::Enum
275
-
276
- CHARGE = :CHARGE
277
- INVOICE = :INVOICE
278
- NONE = :NONE
279
-
280
- # @!method self.values
281
- # @return [Array<Symbol>]
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
310
- end
311
- end
312
- end
313
- end
314
- end