smplkit 3.0.7 → 3.0.9

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/api_keys_api.rb +7 -0
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +16 -464
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_types_api.rb +7 -0
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/contexts_api.rb +7 -0
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/environments_api.rb +7 -0
  7. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/invitations_api.rb +7 -0
  8. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/metrics_api.rb +23 -2
  9. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/plans_api.rb +9 -2
  10. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/products_api.rb +9 -2
  11. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/services_api.rb +7 -0
  12. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/subscription_api.rb +289 -0
  13. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/users_api.rb +7 -0
  14. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_response.rb → admin_subscription_request.rb} +9 -20
  15. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/admin_subscription_request_attributes.rb +190 -0
  16. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_data.rb → admin_subscription_request_resource.rb} +46 -12
  17. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{next_tier_meta.rb → next_tier_response.rb} +6 -6
  18. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_change_projection.rb +321 -0
  19. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_attributes.rb → subscription_item_request.rb} +10 -21
  20. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_attributes.rb → subscription_item_response.rb} +66 -77
  21. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_attributes.rb +390 -0
  22. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_resource.rb +241 -0
  23. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{plan_change_request.rb → subscription_preview_response.rb} +20 -21
  24. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_body.rb → subscription_request.rb} +5 -5
  25. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_attributes.rb +179 -0
  26. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_resource.rb +227 -0
  27. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb +4 -2
  28. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb +1 -1
  29. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_meta.rb → subscription_response_attributes.rb} +135 -62
  30. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +15 -8
  31. data/lib/smplkit/_generated/app/spec/api/api_keys_api_spec.rb +1 -0
  32. data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +3 -86
  33. data/lib/smplkit/_generated/app/spec/api/context_types_api_spec.rb +1 -0
  34. data/lib/smplkit/_generated/app/spec/api/contexts_api_spec.rb +1 -0
  35. data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +1 -0
  36. data/lib/smplkit/_generated/app/spec/api/invitations_api_spec.rb +1 -0
  37. data/lib/smplkit/_generated/app/spec/api/metrics_api_spec.rb +4 -1
  38. data/lib/smplkit/_generated/app/spec/api/plans_api_spec.rb +2 -1
  39. data/lib/smplkit/_generated/app/spec/api/products_api_spec.rb +2 -1
  40. data/lib/smplkit/_generated/app/spec/api/services_api_spec.rb +1 -0
  41. data/lib/smplkit/_generated/app/spec/api/subscription_api_spec.rb +83 -0
  42. data/lib/smplkit/_generated/app/spec/api/users_api_spec.rb +1 -0
  43. data/lib/smplkit/_generated/app/spec/models/{create_subscription_attributes_spec.rb → admin_subscription_request_attributes_spec.rb} +9 -9
  44. data/lib/smplkit/_generated/app/spec/models/admin_subscription_request_resource_spec.rb +52 -0
  45. data/lib/smplkit/_generated/app/spec/models/{plan_change_request_spec.rb → admin_subscription_request_spec.rb} +7 -7
  46. data/lib/smplkit/_generated/app/spec/models/{next_tier_meta_spec.rb → next_tier_response_spec.rb} +6 -6
  47. data/lib/smplkit/_generated/app/spec/models/{subscription_list_meta_spec.rb → subscription_change_projection_spec.rb} +20 -14
  48. data/lib/smplkit/_generated/app/spec/models/{create_subscription_data_spec.rb → subscription_item_request_spec.rb} +8 -8
  49. data/lib/smplkit/_generated/app/spec/models/{subscription_attributes_spec.rb → subscription_item_response_spec.rb} +12 -18
  50. data/lib/smplkit/_generated/app/spec/models/subscription_preview_attributes_spec.rb +88 -0
  51. data/lib/smplkit/_generated/app/spec/models/subscription_preview_resource_spec.rb +56 -0
  52. data/lib/smplkit/_generated/app/spec/models/subscription_preview_response_spec.rb +36 -0
  53. data/lib/smplkit/_generated/app/spec/models/{subscription_list_response_spec.rb → subscription_request_attributes_spec.rb} +8 -8
  54. data/lib/smplkit/_generated/app/spec/models/subscription_request_resource_spec.rb +52 -0
  55. data/lib/smplkit/_generated/app/spec/models/{create_subscription_body_spec.rb → subscription_request_spec.rb} +6 -6
  56. data/lib/smplkit/_generated/app/spec/models/subscription_response_attributes_spec.rb +100 -0
  57. metadata +31 -17
@@ -14,25 +14,40 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # Discount and totals summary attached to a subscription collection response.
18
- class SubscriptionListMeta < ApiModelBase
19
- # Sum of list prices across all subscriptions in cents.
20
- attr_accessor :subtotal_cents
17
+ # Customer's subscription as returned by the API.
18
+ class SubscriptionResponseAttributes < ApiModelBase
19
+ # Lifecycle state of the subscription. `ACTIVE` while billing is current; `PAST_DUE` after a failed charge; `CANCELED` once the subscription has ended; `null` when the subscription has no billing object (fully comped at 100% discount).
20
+ attr_accessor :status
21
21
 
22
- # Effective discount percentage applied.
23
- attr_accessor :discount_pct
22
+ # ISO-8601 timestamp of the current billing period's start.
23
+ attr_accessor :current_period_start
24
24
 
25
- # Discount amount in cents.
26
- attr_accessor :discount_amount_cents
25
+ # ISO-8601 timestamp of the current billing period's end. Scheduled plan changes take effect at this moment.
26
+ attr_accessor :current_period_end
27
+
28
+ # Effective discount percentage applied to the subscription's monthly invoice. This is the value locked at the time of the customer's last subscription change; subsequent changes to the public discount schedule do not affect this customer until they themselves change their subscription.
29
+ attr_accessor :discount_pct
27
30
 
28
- # Source of the discount. `VOLUME` indicates the standard volume-discount schedule; `OVERRIDE` indicates a custom discount set on the account.
31
+ # `VOLUME` when the discount comes from the multi-product discount schedule; `OVERRIDE` when an administrator has applied a custom discount.
29
32
  attr_accessor :discount_source
30
33
 
31
- # Final monthly total in cents after the discount.
34
+ # Sum of all item list prices in cents, before discount.
35
+ attr_accessor :subtotal_cents
36
+
37
+ # Amount discounted from the subtotal in cents.
38
+ attr_accessor :discount_amount_cents
39
+
40
+ # Final monthly total in cents after the discount is applied.
32
41
  attr_accessor :total_cents
33
42
 
34
43
  attr_accessor :next_tier
35
44
 
45
+ # Identifier of the default payment method used to bill this subscription. `null` when the subscription has no associated payment method (e.g. fully comped).
46
+ attr_accessor :payment_method
47
+
48
+ # One entry per product currently enrolled on the subscription.
49
+ attr_accessor :items
50
+
36
51
  class EnumAttributeValidator
37
52
  attr_reader :datatype
38
53
  attr_reader :allowable_values
@@ -58,12 +73,17 @@ module SmplkitGeneratedClient::App
58
73
  # Attribute mapping from ruby-style variable name to JSON key.
59
74
  def self.attribute_map
60
75
  {
61
- :'subtotal_cents' => :'subtotal_cents',
76
+ :'status' => :'status',
77
+ :'current_period_start' => :'current_period_start',
78
+ :'current_period_end' => :'current_period_end',
62
79
  :'discount_pct' => :'discount_pct',
63
- :'discount_amount_cents' => :'discount_amount_cents',
64
80
  :'discount_source' => :'discount_source',
81
+ :'subtotal_cents' => :'subtotal_cents',
82
+ :'discount_amount_cents' => :'discount_amount_cents',
65
83
  :'total_cents' => :'total_cents',
66
- :'next_tier' => :'next_tier'
84
+ :'next_tier' => :'next_tier',
85
+ :'payment_method' => :'payment_method',
86
+ :'items' => :'items'
67
87
  }
68
88
  end
69
89
 
@@ -80,18 +100,27 @@ module SmplkitGeneratedClient::App
80
100
  # Attribute type mapping.
81
101
  def self.openapi_types
82
102
  {
83
- :'subtotal_cents' => :'Integer',
103
+ :'status' => :'String',
104
+ :'current_period_start' => :'String',
105
+ :'current_period_end' => :'String',
84
106
  :'discount_pct' => :'Integer',
85
- :'discount_amount_cents' => :'Integer',
86
107
  :'discount_source' => :'String',
108
+ :'subtotal_cents' => :'Integer',
109
+ :'discount_amount_cents' => :'Integer',
87
110
  :'total_cents' => :'Integer',
88
- :'next_tier' => :'NextTierMeta'
111
+ :'next_tier' => :'NextTierResponse',
112
+ :'payment_method' => :'String',
113
+ :'items' => :'Array<SubscriptionItemResponse>'
89
114
  }
90
115
  end
91
116
 
92
117
  # List of attributes with nullable: true
93
118
  def self.openapi_nullable
94
119
  Set.new([
120
+ :'status',
121
+ :'current_period_start',
122
+ :'current_period_end',
123
+ :'payment_method',
95
124
  ])
96
125
  end
97
126
 
@@ -99,22 +128,28 @@ module SmplkitGeneratedClient::App
99
128
  # @param [Hash] attributes Model attributes in the form of hash
100
129
  def initialize(attributes = {})
101
130
  if (!attributes.is_a?(Hash))
102
- fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionListMeta` initialize method"
131
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionResponseAttributes` initialize method"
103
132
  end
104
133
 
105
134
  # check to see if the attribute exists and convert string to symbol for hash key
106
135
  acceptable_attribute_map = self.class.acceptable_attribute_map
107
136
  attributes = attributes.each_with_object({}) { |(k, v), h|
108
137
  if (!acceptable_attribute_map.key?(k.to_sym))
109
- fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionListMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
138
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionResponseAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
139
  end
111
140
  h[k.to_sym] = v
112
141
  }
113
142
 
114
- if attributes.key?(:'subtotal_cents')
115
- self.subtotal_cents = attributes[:'subtotal_cents']
116
- else
117
- self.subtotal_cents = nil
143
+ if attributes.key?(:'status')
144
+ self.status = attributes[:'status']
145
+ end
146
+
147
+ if attributes.key?(:'current_period_start')
148
+ self.current_period_start = attributes[:'current_period_start']
149
+ end
150
+
151
+ if attributes.key?(:'current_period_end')
152
+ self.current_period_end = attributes[:'current_period_end']
118
153
  end
119
154
 
120
155
  if attributes.key?(:'discount_pct')
@@ -123,18 +158,24 @@ module SmplkitGeneratedClient::App
123
158
  self.discount_pct = nil
124
159
  end
125
160
 
126
- if attributes.key?(:'discount_amount_cents')
127
- self.discount_amount_cents = attributes[:'discount_amount_cents']
128
- else
129
- self.discount_amount_cents = nil
130
- end
131
-
132
161
  if attributes.key?(:'discount_source')
133
162
  self.discount_source = attributes[:'discount_source']
134
163
  else
135
164
  self.discount_source = nil
136
165
  end
137
166
 
167
+ if attributes.key?(:'subtotal_cents')
168
+ self.subtotal_cents = attributes[:'subtotal_cents']
169
+ else
170
+ self.subtotal_cents = nil
171
+ end
172
+
173
+ if attributes.key?(:'discount_amount_cents')
174
+ self.discount_amount_cents = attributes[:'discount_amount_cents']
175
+ else
176
+ self.discount_amount_cents = nil
177
+ end
178
+
138
179
  if attributes.key?(:'total_cents')
139
180
  self.total_cents = attributes[:'total_cents']
140
181
  else
@@ -144,6 +185,18 @@ module SmplkitGeneratedClient::App
144
185
  if attributes.key?(:'next_tier')
145
186
  self.next_tier = attributes[:'next_tier']
146
187
  end
188
+
189
+ if attributes.key?(:'payment_method')
190
+ self.payment_method = attributes[:'payment_method']
191
+ end
192
+
193
+ if attributes.key?(:'items')
194
+ if (value = attributes[:'items']).is_a?(Array)
195
+ self.items = value
196
+ end
197
+ else
198
+ self.items = nil
199
+ end
147
200
  end
148
201
 
149
202
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -151,26 +204,30 @@ module SmplkitGeneratedClient::App
151
204
  def list_invalid_properties
152
205
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
153
206
  invalid_properties = Array.new
154
- if @subtotal_cents.nil?
155
- invalid_properties.push('invalid value for "subtotal_cents", subtotal_cents cannot be nil.')
156
- end
157
-
158
207
  if @discount_pct.nil?
159
208
  invalid_properties.push('invalid value for "discount_pct", discount_pct cannot be nil.')
160
209
  end
161
210
 
162
- if @discount_amount_cents.nil?
163
- invalid_properties.push('invalid value for "discount_amount_cents", discount_amount_cents cannot be nil.')
164
- end
165
-
166
211
  if @discount_source.nil?
167
212
  invalid_properties.push('invalid value for "discount_source", discount_source cannot be nil.')
168
213
  end
169
214
 
215
+ if @subtotal_cents.nil?
216
+ invalid_properties.push('invalid value for "subtotal_cents", subtotal_cents cannot be nil.')
217
+ end
218
+
219
+ if @discount_amount_cents.nil?
220
+ invalid_properties.push('invalid value for "discount_amount_cents", discount_amount_cents cannot be nil.')
221
+ end
222
+
170
223
  if @total_cents.nil?
171
224
  invalid_properties.push('invalid value for "total_cents", total_cents cannot be nil.')
172
225
  end
173
226
 
227
+ if @items.nil?
228
+ invalid_properties.push('invalid value for "items", items cannot be nil.')
229
+ end
230
+
174
231
  invalid_properties
175
232
  end
176
233
 
@@ -178,26 +235,17 @@ module SmplkitGeneratedClient::App
178
235
  # @return true if the model is valid
179
236
  def valid?
180
237
  warn '[DEPRECATED] the `valid?` method is obsolete'
181
- return false if @subtotal_cents.nil?
182
238
  return false if @discount_pct.nil?
183
- return false if @discount_amount_cents.nil?
184
239
  return false if @discount_source.nil?
185
240
  discount_source_validator = EnumAttributeValidator.new('String', ["VOLUME", "OVERRIDE"])
186
241
  return false unless discount_source_validator.valid?(@discount_source)
242
+ return false if @subtotal_cents.nil?
243
+ return false if @discount_amount_cents.nil?
187
244
  return false if @total_cents.nil?
245
+ return false if @items.nil?
188
246
  true
189
247
  end
190
248
 
191
- # Custom attribute writer method with validation
192
- # @param [Object] subtotal_cents Value to be assigned
193
- def subtotal_cents=(subtotal_cents)
194
- if subtotal_cents.nil?
195
- fail ArgumentError, 'subtotal_cents cannot be nil'
196
- end
197
-
198
- @subtotal_cents = subtotal_cents
199
- end
200
-
201
249
  # Custom attribute writer method with validation
202
250
  # @param [Object] discount_pct Value to be assigned
203
251
  def discount_pct=(discount_pct)
@@ -208,16 +256,6 @@ module SmplkitGeneratedClient::App
208
256
  @discount_pct = discount_pct
209
257
  end
210
258
 
211
- # Custom attribute writer method with validation
212
- # @param [Object] discount_amount_cents Value to be assigned
213
- def discount_amount_cents=(discount_amount_cents)
214
- if discount_amount_cents.nil?
215
- fail ArgumentError, 'discount_amount_cents cannot be nil'
216
- end
217
-
218
- @discount_amount_cents = discount_amount_cents
219
- end
220
-
221
259
  # Custom attribute writer method checking allowed values (enum).
222
260
  # @param [Object] discount_source Object to be assigned
223
261
  def discount_source=(discount_source)
@@ -228,6 +266,26 @@ module SmplkitGeneratedClient::App
228
266
  @discount_source = discount_source
229
267
  end
230
268
 
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] subtotal_cents Value to be assigned
271
+ def subtotal_cents=(subtotal_cents)
272
+ if subtotal_cents.nil?
273
+ fail ArgumentError, 'subtotal_cents cannot be nil'
274
+ end
275
+
276
+ @subtotal_cents = subtotal_cents
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] discount_amount_cents Value to be assigned
281
+ def discount_amount_cents=(discount_amount_cents)
282
+ if discount_amount_cents.nil?
283
+ fail ArgumentError, 'discount_amount_cents cannot be nil'
284
+ end
285
+
286
+ @discount_amount_cents = discount_amount_cents
287
+ end
288
+
231
289
  # Custom attribute writer method with validation
232
290
  # @param [Object] total_cents Value to be assigned
233
291
  def total_cents=(total_cents)
@@ -238,17 +296,32 @@ module SmplkitGeneratedClient::App
238
296
  @total_cents = total_cents
239
297
  end
240
298
 
299
+ # Custom attribute writer method with validation
300
+ # @param [Object] items Value to be assigned
301
+ def items=(items)
302
+ if items.nil?
303
+ fail ArgumentError, 'items cannot be nil'
304
+ end
305
+
306
+ @items = items
307
+ end
308
+
241
309
  # Checks equality by comparing each attribute.
242
310
  # @param [Object] Object to be compared
243
311
  def ==(o)
244
312
  return true if self.equal?(o)
245
313
  self.class == o.class &&
246
- subtotal_cents == o.subtotal_cents &&
314
+ status == o.status &&
315
+ current_period_start == o.current_period_start &&
316
+ current_period_end == o.current_period_end &&
247
317
  discount_pct == o.discount_pct &&
248
- discount_amount_cents == o.discount_amount_cents &&
249
318
  discount_source == o.discount_source &&
319
+ subtotal_cents == o.subtotal_cents &&
320
+ discount_amount_cents == o.discount_amount_cents &&
250
321
  total_cents == o.total_cents &&
251
- next_tier == o.next_tier
322
+ next_tier == o.next_tier &&
323
+ payment_method == o.payment_method &&
324
+ items == o.items
252
325
  end
253
326
 
254
327
  # @see the `==` method
@@ -260,7 +333,7 @@ module SmplkitGeneratedClient::App
260
333
  # Calculates hash code according to all attributes.
261
334
  # @return [Integer] Hash code
262
335
  def hash
263
- [subtotal_cents, discount_pct, discount_amount_cents, discount_source, total_cents, next_tier].hash
336
+ [status, current_period_start, current_period_end, discount_pct, discount_source, subtotal_cents, discount_amount_cents, total_cents, next_tier, payment_method, items].hash
264
337
  end
265
338
 
266
339
  # Builds the object from hash
@@ -26,6 +26,9 @@ require 'smplkit_app_client/models/account_wipe_request'
26
26
  require 'smplkit_app_client/models/add_payment_method_attributes'
27
27
  require 'smplkit_app_client/models/add_payment_method_body'
28
28
  require 'smplkit_app_client/models/add_payment_method_data'
29
+ require 'smplkit_app_client/models/admin_subscription_request'
30
+ require 'smplkit_app_client/models/admin_subscription_request_attributes'
31
+ require 'smplkit_app_client/models/admin_subscription_request_resource'
29
32
  require 'smplkit_app_client/models/api_key'
30
33
  require 'smplkit_app_client/models/api_key_list_response'
31
34
  require 'smplkit_app_client/models/api_key_request'
@@ -46,9 +49,6 @@ require 'smplkit_app_client/models/context_type_list_response'
46
49
  require 'smplkit_app_client/models/context_type_request'
47
50
  require 'smplkit_app_client/models/context_type_resource'
48
51
  require 'smplkit_app_client/models/context_type_response'
49
- require 'smplkit_app_client/models/create_subscription_attributes'
50
- require 'smplkit_app_client/models/create_subscription_body'
51
- require 'smplkit_app_client/models/create_subscription_data'
52
52
  require 'smplkit_app_client/models/email'
53
53
  require 'smplkit_app_client/models/email_resource'
54
54
  require 'smplkit_app_client/models/email_response'
@@ -84,7 +84,7 @@ require 'smplkit_app_client/models/metric_resource'
84
84
  require 'smplkit_app_client/models/metric_rollup_attributes'
85
85
  require 'smplkit_app_client/models/metric_rollup_list_response'
86
86
  require 'smplkit_app_client/models/metric_rollup_resource'
87
- require 'smplkit_app_client/models/next_tier_meta'
87
+ require 'smplkit_app_client/models/next_tier_response'
88
88
  require 'smplkit_app_client/models/oidc_provider'
89
89
  require 'smplkit_app_client/models/page_meta'
90
90
  require 'smplkit_app_client/models/payment_method'
@@ -93,7 +93,6 @@ require 'smplkit_app_client/models/payment_method_request'
93
93
  require 'smplkit_app_client/models/payment_method_resource'
94
94
  require 'smplkit_app_client/models/payment_method_response'
95
95
  require 'smplkit_app_client/models/plan'
96
- require 'smplkit_app_client/models/plan_change_request'
97
96
  require 'smplkit_app_client/models/plan_definition'
98
97
  require 'smplkit_app_client/models/plan_list_response'
99
98
  require 'smplkit_app_client/models/plan_resource'
@@ -109,11 +108,18 @@ require 'smplkit_app_client/models/service_response'
109
108
  require 'smplkit_app_client/models/setup_intent_attributes'
110
109
  require 'smplkit_app_client/models/setup_intent_resource'
111
110
  require 'smplkit_app_client/models/setup_intent_response'
112
- require 'smplkit_app_client/models/subscription_attributes'
113
- require 'smplkit_app_client/models/subscription_list_meta'
114
- require 'smplkit_app_client/models/subscription_list_response'
111
+ require 'smplkit_app_client/models/subscription_change_projection'
112
+ require 'smplkit_app_client/models/subscription_item_request'
113
+ require 'smplkit_app_client/models/subscription_item_response'
114
+ require 'smplkit_app_client/models/subscription_preview_attributes'
115
+ require 'smplkit_app_client/models/subscription_preview_resource'
116
+ require 'smplkit_app_client/models/subscription_preview_response'
117
+ require 'smplkit_app_client/models/subscription_request'
118
+ require 'smplkit_app_client/models/subscription_request_attributes'
119
+ require 'smplkit_app_client/models/subscription_request_resource'
115
120
  require 'smplkit_app_client/models/subscription_resource'
116
121
  require 'smplkit_app_client/models/subscription_response'
122
+ require 'smplkit_app_client/models/subscription_response_attributes'
117
123
  require 'smplkit_app_client/models/user'
118
124
  require 'smplkit_app_client/models/user_list_meta'
119
125
  require 'smplkit_app_client/models/user_list_response'
@@ -138,6 +144,7 @@ require 'smplkit_app_client/api/metrics_api'
138
144
  require 'smplkit_app_client/api/plans_api'
139
145
  require 'smplkit_app_client/api/products_api'
140
146
  require 'smplkit_app_client/api/services_api'
147
+ require 'smplkit_app_client/api/subscription_api'
141
148
  require 'smplkit_app_client/api/users_api'
142
149
 
143
150
  module SmplkitGeneratedClient::App
@@ -73,6 +73,7 @@ describe 'APIKeysApi' do
73
73
  # List all API keys for the authenticated account.
74
74
  # @param [Hash] opts the optional parameters
75
75
  # @option opts [String] :filter_status
76
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;expires_at&#x60;, &#x60;-expires_at&#x60;, &#x60;last_used_at&#x60;, &#x60;-last_used_at&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;status&#x60;, &#x60;-status&#x60;.
76
77
  # @return [ApiKeyListResponse]
77
78
  describe 'list_api_keys test' do
78
79
  it 'should work' do
@@ -32,18 +32,6 @@ describe 'BillingApi' do
32
32
  end
33
33
  end
34
34
 
35
- # unit tests for cancel_subscription
36
- # Cancel Subscription
37
- # Cancel a subscription at end of the current billing period.
38
- # @param id
39
- # @param [Hash] opts the optional parameters
40
- # @return [SubscriptionResponse]
41
- describe 'cancel_subscription test' do
42
- it 'should work' do
43
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
44
- end
45
- end
46
-
47
35
  # unit tests for create_payment_method
48
36
  # Add Payment Method
49
37
  # Register a Stripe payment method (&#x60;pm_...&#x60;) on the account. The client first creates the Stripe payment method using a SetupIntent and Stripe Elements, then submits its identifier here to persist it.
@@ -56,18 +44,6 @@ describe 'BillingApi' do
56
44
  end
57
45
  end
58
46
 
59
- # unit tests for create_subscription
60
- # Create Subscription
61
- # Create a new paid subscription for a product.
62
- # @param create_subscription_body
63
- # @param [Hash] opts the optional parameters
64
- # @return [SubscriptionResponse]
65
- describe 'create_subscription test' do
66
- it 'should work' do
67
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
68
- end
69
- end
70
-
71
47
  # unit tests for delete_payment_method
72
48
  # Delete Payment Method
73
49
  # Delete a payment method. Returns 409 if this is the only payment method on file and the account has an active paid subscription. If the deleted payment method was the default, the oldest remaining payment method is promoted to default.
@@ -80,19 +56,6 @@ describe 'BillingApi' do
80
56
  end
81
57
  end
82
58
 
83
- # unit tests for downgrade_subscription
84
- # Downgrade Subscription
85
- # Downgrade an existing paid subscription to a lower plan.
86
- # @param id
87
- # @param plan_change_request
88
- # @param [Hash] opts the optional parameters
89
- # @return [SubscriptionResponse]
90
- describe 'downgrade_subscription test' do
91
- it 'should work' do
92
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
93
- end
94
- end
95
-
96
59
  # unit tests for execute_setup_intent
97
60
  # Execute Setup Intent
98
61
  # Create a Stripe SetupIntent for adding a payment method without an immediate charge. Returns the &#x60;client_secret&#x60; to pass to Stripe Elements in the browser.
@@ -130,8 +93,9 @@ describe 'BillingApi' do
130
93
 
131
94
  # unit tests for list_invoices
132
95
  # List Invoices
133
- # Return invoice history for the account from Stripe.
96
+ # Return invoice history for the account from Stripe. Default sort is &#x60;-created_at&#x60; (newest first).
134
97
  # @param [Hash] opts the optional parameters
98
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-created_at&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;status&#x60;, &#x60;-status&#x60;, &#x60;total&#x60;, &#x60;-total&#x60;.
135
99
  # @return [InvoiceListResponse]
136
100
  describe 'list_invoices test' do
137
101
  it 'should work' do
@@ -143,6 +107,7 @@ describe 'BillingApi' do
143
107
  # List Payment Methods
144
108
  # List all payment methods for the account. Default is returned first, then newest first.
145
109
  # @param [Hash] opts the optional parameters
110
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-created_at&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;exp_year&#x60;, &#x60;-exp_year&#x60;, &#x60;is_default&#x60;, &#x60;-is_default&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;.
146
111
  # @return [PaymentMethodListResponse]
147
112
  describe 'list_payment_methods test' do
148
113
  it 'should work' do
@@ -150,17 +115,6 @@ describe 'BillingApi' do
150
115
  end
151
116
  end
152
117
 
153
- # unit tests for list_subscriptions
154
- # List Subscriptions
155
- # Return subscription rows for the authenticated account.
156
- # @param [Hash] opts the optional parameters
157
- # @return [SubscriptionListResponse]
158
- describe 'list_subscriptions test' do
159
- it 'should work' do
160
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
161
- end
162
- end
163
-
164
118
  # unit tests for set_default_payment_method
165
119
  # Set Default Payment Method
166
120
  # Mark this payment method as the account&#39;s default. Idempotent: returns 200 with no changes when the payment method is already the default.
@@ -173,30 +127,6 @@ describe 'BillingApi' do
173
127
  end
174
128
  end
175
129
 
176
- # unit tests for uncancel_subscription
177
- # Undo Cancellation
178
- # Reverse a pending cancellation; subscription will renew as normal.
179
- # @param id
180
- # @param [Hash] opts the optional parameters
181
- # @return [SubscriptionResponse]
182
- describe 'uncancel_subscription test' do
183
- it 'should work' do
184
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
185
- end
186
- end
187
-
188
- # unit tests for undowngrade_subscription
189
- # Undo Pending Downgrade
190
- # Reverse a pending downgrade scheduled for end of the current billing period.
191
- # @param id
192
- # @param [Hash] opts the optional parameters
193
- # @return [SubscriptionResponse]
194
- describe 'undowngrade_subscription test' do
195
- it 'should work' do
196
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
197
- end
198
- end
199
-
200
130
  # unit tests for update_payment_method
201
131
  # Update Payment Method
202
132
  # Update the mutable fields of a payment method (&#x60;billing_details&#x60;, &#x60;exp_month&#x60;, &#x60;exp_year&#x60;). The &#x60;default&#x60; flag is not mutable via PUT — use the &#x60;set_default&#x60; action instead.
@@ -210,17 +140,4 @@ describe 'BillingApi' do
210
140
  end
211
141
  end
212
142
 
213
- # unit tests for upgrade_subscription
214
- # Upgrade Subscription
215
- # Upgrade an existing paid subscription to a higher plan.
216
- # @param id
217
- # @param plan_change_request
218
- # @param [Hash] opts the optional parameters
219
- # @return [SubscriptionResponse]
220
- describe 'upgrade_subscription test' do
221
- it 'should work' do
222
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
223
- end
224
- end
225
-
226
143
  end
@@ -72,6 +72,7 @@ describe 'ContextTypesApi' do
72
72
  # List Context Types
73
73
  # List all context types for the authenticated account.
74
74
  # @param [Hash] opts the optional parameters
75
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;key&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;.
75
76
  # @return [ContextTypeListResponse]
76
77
  describe 'list_context_types test' do
77
78
  it 'should work' do
@@ -73,6 +73,7 @@ describe 'ContextsApi' do
73
73
  # List all context instances for the authenticated account.
74
74
  # @param [Hash] opts the optional parameters
75
75
  # @option opts [String] :filter_context_type
76
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;key&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;.
76
77
  # @return [ContextListResponse]
77
78
  describe 'list_contexts test' do
78
79
  it 'should work' do
@@ -85,6 +85,7 @@ describe 'EnvironmentsApi' do
85
85
  # List Environments
86
86
  # List all environments for the authenticated account.
87
87
  # @param [Hash] opts the optional parameters
88
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;.
88
89
  # @return [EnvironmentListResponse]
89
90
  describe 'list_environments test' do
90
91
  it 'should work' do
@@ -62,6 +62,7 @@ describe 'InvitationsApi' do
62
62
  # @param [Hash] opts the optional parameters
63
63
  # @option opts [String] :filter_status
64
64
  # @option opts [String] :filter_token
65
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-created_at&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;email&#x60;, &#x60;-email&#x60;, &#x60;status&#x60;, &#x60;-status&#x60;.
65
66
  # @return [InvitationListResponse]
66
67
  describe 'list_invitations test' do
67
68
  it 'should work' do
@@ -46,8 +46,9 @@ describe 'MetricsApi' do
46
46
 
47
47
  # unit tests for list_metric_names
48
48
  # List Metric Names
49
- # Return distinct metric names recorded for the account, each with a representative unit. Plain-JSON response (not JSON:API) — this is metadata for discovery, not a metric resource.
49
+ # Return distinct metric names recorded for the account, each with a representative unit. Plain-JSON response (not JSON:API) — this is metadata for discovery, not a metric resource. Default sort is &#x60;name&#x60; ascending.
50
50
  # @param [Hash] opts the optional parameters
51
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;name&#x60;, &#x60;-name&#x60;.
51
52
  # @return [MetricNamesResponse]
52
53
  describe 'list_metric_names test' do
53
54
  it 'should work' do
@@ -62,6 +63,7 @@ describe 'MetricsApi' do
62
63
  # @param filter_rollup
63
64
  # @param [Hash] opts the optional parameters
64
65
  # @option opts [String] :filter_recorded_at
66
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;bucket&#x60;. Allowed values: &#x60;bucket&#x60;, &#x60;-bucket&#x60;.
65
67
  # @return [MetricRollupListResponse]
66
68
  describe 'list_metric_rollups test' do
67
69
  it 'should work' do
@@ -75,6 +77,7 @@ describe 'MetricsApi' do
75
77
  # @param filter_name
76
78
  # @param [Hash] opts the optional parameters
77
79
  # @option opts [String] :filter_recorded_at
80
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;-recorded_at&#x60;. Allowed values: &#x60;recorded_at&#x60;, &#x60;-recorded_at&#x60;, &#x60;value&#x60;, &#x60;-value&#x60;.
78
81
  # @return [MetricListResponse]
79
82
  describe 'list_metrics test' do
80
83
  it 'should work' do
@@ -34,8 +34,9 @@ describe 'PlansApi' do
34
34
 
35
35
  # unit tests for list_plans
36
36
  # List Plans
37
- # Return all plan tier definitions as JSON:API resources.
37
+ # Return all plan tier definitions as JSON:API resources. Default sort is &#x60;sort_order&#x60; ascending — the natural ladder defined in &#x60;plans.yaml&#x60;. Pass &#x60;sort&#x3D;display_name&#x60; for an alphabetical view.
38
38
  # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;sort_order&#x60;. Allowed values: &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;id&#x60;, &#x60;-id&#x60;, &#x60;sort_order&#x60;, &#x60;-sort_order&#x60;.
39
40
  # @return [PlanListResponse]
40
41
  describe 'list_plans test' do
41
42
  it 'should work' do
@@ -34,8 +34,9 @@ describe 'ProductsApi' do
34
34
 
35
35
  # unit tests for list_products
36
36
  # List Products
37
- # Return all flag-enabled products with their plans, limits, and marketing content.
37
+ # Return all flag-enabled products with their plans, limits, and marketing content. Default sort is &#x60;display_name&#x60; ascending.
38
38
  # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;display_name&#x60;. Allowed values: &#x60;display_name&#x60;, &#x60;-display_name&#x60;, &#x60;id&#x60;, &#x60;-id&#x60;.
39
40
  # @return [ProductListResponse]
40
41
  describe 'list_products test' do
41
42
  it 'should work' do
@@ -72,6 +72,7 @@ describe 'ServicesApi' do
72
72
  # List Services
73
73
  # List all services for the authenticated account.
74
74
  # @param [Hash] opts the optional parameters
75
+ # @option opts [String] :sort Field to sort by. Prefix with &#x60;-&#x60; for descending order. Default: &#x60;name&#x60;. Allowed values: &#x60;created_at&#x60;, &#x60;-created_at&#x60;, &#x60;key&#x60;, &#x60;-key&#x60;, &#x60;name&#x60;, &#x60;-name&#x60;, &#x60;updated_at&#x60;, &#x60;-updated_at&#x60;.
75
76
  # @return [ServiceListResponse]
76
77
  describe 'list_services test' do
77
78
  it 'should work' do