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.
- checksums.yaml +4 -4
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/api_keys_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +16 -464
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_types_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/contexts_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/environments_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/invitations_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/metrics_api.rb +23 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/plans_api.rb +9 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/products_api.rb +9 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/services_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/subscription_api.rb +289 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/users_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_response.rb → admin_subscription_request.rb} +9 -20
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/admin_subscription_request_attributes.rb +190 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_data.rb → admin_subscription_request_resource.rb} +46 -12
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{next_tier_meta.rb → next_tier_response.rb} +6 -6
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_change_projection.rb +321 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_attributes.rb → subscription_item_request.rb} +10 -21
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_attributes.rb → subscription_item_response.rb} +66 -77
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_attributes.rb +390 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_resource.rb +241 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{plan_change_request.rb → subscription_preview_response.rb} +20 -21
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_body.rb → subscription_request.rb} +5 -5
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_attributes.rb +179 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_resource.rb +227 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb +4 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb +1 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_meta.rb → subscription_response_attributes.rb} +135 -62
- data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +15 -8
- data/lib/smplkit/_generated/app/spec/api/api_keys_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +3 -86
- data/lib/smplkit/_generated/app/spec/api/context_types_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/contexts_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/invitations_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/metrics_api_spec.rb +4 -1
- data/lib/smplkit/_generated/app/spec/api/plans_api_spec.rb +2 -1
- data/lib/smplkit/_generated/app/spec/api/products_api_spec.rb +2 -1
- data/lib/smplkit/_generated/app/spec/api/services_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/subscription_api_spec.rb +83 -0
- data/lib/smplkit/_generated/app/spec/api/users_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/models/{create_subscription_attributes_spec.rb → admin_subscription_request_attributes_spec.rb} +9 -9
- data/lib/smplkit/_generated/app/spec/models/admin_subscription_request_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/{plan_change_request_spec.rb → admin_subscription_request_spec.rb} +7 -7
- data/lib/smplkit/_generated/app/spec/models/{next_tier_meta_spec.rb → next_tier_response_spec.rb} +6 -6
- data/lib/smplkit/_generated/app/spec/models/{subscription_list_meta_spec.rb → subscription_change_projection_spec.rb} +20 -14
- data/lib/smplkit/_generated/app/spec/models/{create_subscription_data_spec.rb → subscription_item_request_spec.rb} +8 -8
- data/lib/smplkit/_generated/app/spec/models/{subscription_attributes_spec.rb → subscription_item_response_spec.rb} +12 -18
- data/lib/smplkit/_generated/app/spec/models/subscription_preview_attributes_spec.rb +88 -0
- data/lib/smplkit/_generated/app/spec/models/subscription_preview_resource_spec.rb +56 -0
- data/lib/smplkit/_generated/app/spec/models/subscription_preview_response_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/{subscription_list_response_spec.rb → subscription_request_attributes_spec.rb} +8 -8
- data/lib/smplkit/_generated/app/spec/models/subscription_request_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/{create_subscription_body_spec.rb → subscription_request_spec.rb} +6 -6
- data/lib/smplkit/_generated/app/spec/models/subscription_response_attributes_spec.rb +100 -0
- metadata +31 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce4c31b86b8e8ea2077b471cad22fda0ae63ba69ad00ed8d502b967c040cf65b
|
|
4
|
+
data.tar.gz: b613a094bc73a92d16e7e5a055d40effdb7fe43b09e3446f76583afb99e992c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5086bd86123dc0d0ddee5776d297c4263a053ab25690ecfb567fdd704412150abbbf99c19c0d381a16a7ad374acfbb61764655efd050b4b3e6775ccef40fed70
|
|
7
|
+
data.tar.gz: 8053caf4b794b75532a01ec78880a90decbe1bfdc82b3e13115ceb47b42e1b1a54abbda52951b0f2289bdb9d5b7770b986ec87baceb9e38965036a45e285c9c9
|
|
@@ -217,6 +217,7 @@ module SmplkitGeneratedClient::App
|
|
|
217
217
|
# List all API keys for the authenticated account.
|
|
218
218
|
# @param [Hash] opts the optional parameters
|
|
219
219
|
# @option opts [String] :filter_status
|
|
220
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `name`. Allowed values: `created_at`, `-created_at`, `expires_at`, `-expires_at`, `last_used_at`, `-last_used_at`, `name`, `-name`, `status`, `-status`. (default to 'name')
|
|
220
221
|
# @return [ApiKeyListResponse]
|
|
221
222
|
def list_api_keys(opts = {})
|
|
222
223
|
data, _status_code, _headers = list_api_keys_with_http_info(opts)
|
|
@@ -227,17 +228,23 @@ module SmplkitGeneratedClient::App
|
|
|
227
228
|
# List all API keys for the authenticated account.
|
|
228
229
|
# @param [Hash] opts the optional parameters
|
|
229
230
|
# @option opts [String] :filter_status
|
|
231
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `name`. Allowed values: `created_at`, `-created_at`, `expires_at`, `-expires_at`, `last_used_at`, `-last_used_at`, `name`, `-name`, `status`, `-status`. (default to 'name')
|
|
230
232
|
# @return [Array<(ApiKeyListResponse, Integer, Hash)>] ApiKeyListResponse data, response status code and response headers
|
|
231
233
|
def list_api_keys_with_http_info(opts = {})
|
|
232
234
|
if @api_client.config.debugging
|
|
233
235
|
@api_client.config.logger.debug 'Calling API: APIKeysApi.list_api_keys ...'
|
|
234
236
|
end
|
|
237
|
+
allowable_values = ["created_at", "-created_at", "expires_at", "-expires_at", "last_used_at", "-last_used_at", "name", "-name", "status", "-status"]
|
|
238
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
239
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
240
|
+
end
|
|
235
241
|
# resource path
|
|
236
242
|
local_var_path = '/api/v1/api_keys'
|
|
237
243
|
|
|
238
244
|
# query parameters
|
|
239
245
|
query_params = opts[:query_params] || {}
|
|
240
246
|
query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil?
|
|
247
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
241
248
|
|
|
242
249
|
# header parameters
|
|
243
250
|
header_params = opts[:header_params] || {}
|
|
@@ -19,69 +19,6 @@ module SmplkitGeneratedClient::App
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
# Cancel Subscription
|
|
23
|
-
# Cancel a subscription at end of the current billing period.
|
|
24
|
-
# @param id [String]
|
|
25
|
-
# @param [Hash] opts the optional parameters
|
|
26
|
-
# @return [SubscriptionResponse]
|
|
27
|
-
def cancel_subscription(id, opts = {})
|
|
28
|
-
data, _status_code, _headers = cancel_subscription_with_http_info(id, opts)
|
|
29
|
-
data
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Cancel Subscription
|
|
33
|
-
# Cancel a subscription at end of the current billing period.
|
|
34
|
-
# @param id [String]
|
|
35
|
-
# @param [Hash] opts the optional parameters
|
|
36
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
37
|
-
def cancel_subscription_with_http_info(id, opts = {})
|
|
38
|
-
if @api_client.config.debugging
|
|
39
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.cancel_subscription ...'
|
|
40
|
-
end
|
|
41
|
-
# verify the required parameter 'id' is set
|
|
42
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.cancel_subscription"
|
|
44
|
-
end
|
|
45
|
-
# resource path
|
|
46
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/cancel'.sub('{id}', CGI.escape(id.to_s))
|
|
47
|
-
|
|
48
|
-
# query parameters
|
|
49
|
-
query_params = opts[:query_params] || {}
|
|
50
|
-
|
|
51
|
-
# header parameters
|
|
52
|
-
header_params = opts[:header_params] || {}
|
|
53
|
-
# HTTP header 'Accept' (if needed)
|
|
54
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
55
|
-
|
|
56
|
-
# form parameters
|
|
57
|
-
form_params = opts[:form_params] || {}
|
|
58
|
-
|
|
59
|
-
# http body (model)
|
|
60
|
-
post_body = opts[:debug_body]
|
|
61
|
-
|
|
62
|
-
# return_type
|
|
63
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
64
|
-
|
|
65
|
-
# auth_names
|
|
66
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
67
|
-
|
|
68
|
-
new_options = opts.merge(
|
|
69
|
-
:operation => :"BillingApi.cancel_subscription",
|
|
70
|
-
:header_params => header_params,
|
|
71
|
-
:query_params => query_params,
|
|
72
|
-
:form_params => form_params,
|
|
73
|
-
:body => post_body,
|
|
74
|
-
:auth_names => auth_names,
|
|
75
|
-
:return_type => return_type
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
79
|
-
if @api_client.config.debugging
|
|
80
|
-
@api_client.config.logger.debug "API called: BillingApi#cancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
-
end
|
|
82
|
-
return data, status_code, headers
|
|
83
|
-
end
|
|
84
|
-
|
|
85
22
|
# Add Payment Method
|
|
86
23
|
# Register a Stripe payment method (`pm_...`) 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.
|
|
87
24
|
# @param add_payment_method_body [AddPaymentMethodBody]
|
|
@@ -150,74 +87,6 @@ module SmplkitGeneratedClient::App
|
|
|
150
87
|
return data, status_code, headers
|
|
151
88
|
end
|
|
152
89
|
|
|
153
|
-
# Create Subscription
|
|
154
|
-
# Create a new paid subscription for a product.
|
|
155
|
-
# @param create_subscription_body [CreateSubscriptionBody]
|
|
156
|
-
# @param [Hash] opts the optional parameters
|
|
157
|
-
# @return [SubscriptionResponse]
|
|
158
|
-
def create_subscription(create_subscription_body, opts = {})
|
|
159
|
-
data, _status_code, _headers = create_subscription_with_http_info(create_subscription_body, opts)
|
|
160
|
-
data
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
# Create Subscription
|
|
164
|
-
# Create a new paid subscription for a product.
|
|
165
|
-
# @param create_subscription_body [CreateSubscriptionBody]
|
|
166
|
-
# @param [Hash] opts the optional parameters
|
|
167
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
168
|
-
def create_subscription_with_http_info(create_subscription_body, opts = {})
|
|
169
|
-
if @api_client.config.debugging
|
|
170
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.create_subscription ...'
|
|
171
|
-
end
|
|
172
|
-
# verify the required parameter 'create_subscription_body' is set
|
|
173
|
-
if @api_client.config.client_side_validation && create_subscription_body.nil?
|
|
174
|
-
fail ArgumentError, "Missing the required parameter 'create_subscription_body' when calling BillingApi.create_subscription"
|
|
175
|
-
end
|
|
176
|
-
# resource path
|
|
177
|
-
local_var_path = '/api/v1/subscriptions'
|
|
178
|
-
|
|
179
|
-
# query parameters
|
|
180
|
-
query_params = opts[:query_params] || {}
|
|
181
|
-
|
|
182
|
-
# header parameters
|
|
183
|
-
header_params = opts[:header_params] || {}
|
|
184
|
-
# HTTP header 'Accept' (if needed)
|
|
185
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
186
|
-
# HTTP header 'Content-Type'
|
|
187
|
-
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
188
|
-
if !content_type.nil?
|
|
189
|
-
header_params['Content-Type'] = content_type
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# form parameters
|
|
193
|
-
form_params = opts[:form_params] || {}
|
|
194
|
-
|
|
195
|
-
# http body (model)
|
|
196
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_subscription_body)
|
|
197
|
-
|
|
198
|
-
# return_type
|
|
199
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
200
|
-
|
|
201
|
-
# auth_names
|
|
202
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
203
|
-
|
|
204
|
-
new_options = opts.merge(
|
|
205
|
-
:operation => :"BillingApi.create_subscription",
|
|
206
|
-
:header_params => header_params,
|
|
207
|
-
:query_params => query_params,
|
|
208
|
-
:form_params => form_params,
|
|
209
|
-
:body => post_body,
|
|
210
|
-
:auth_names => auth_names,
|
|
211
|
-
:return_type => return_type
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
215
|
-
if @api_client.config.debugging
|
|
216
|
-
@api_client.config.logger.debug "API called: BillingApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
217
|
-
end
|
|
218
|
-
return data, status_code, headers
|
|
219
|
-
end
|
|
220
|
-
|
|
221
90
|
# Delete Payment Method
|
|
222
91
|
# 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.
|
|
223
92
|
# @param id [String]
|
|
@@ -281,80 +150,6 @@ module SmplkitGeneratedClient::App
|
|
|
281
150
|
return data, status_code, headers
|
|
282
151
|
end
|
|
283
152
|
|
|
284
|
-
# Downgrade Subscription
|
|
285
|
-
# Downgrade an existing paid subscription to a lower plan.
|
|
286
|
-
# @param id [String]
|
|
287
|
-
# @param plan_change_request [PlanChangeRequest]
|
|
288
|
-
# @param [Hash] opts the optional parameters
|
|
289
|
-
# @return [SubscriptionResponse]
|
|
290
|
-
def downgrade_subscription(id, plan_change_request, opts = {})
|
|
291
|
-
data, _status_code, _headers = downgrade_subscription_with_http_info(id, plan_change_request, opts)
|
|
292
|
-
data
|
|
293
|
-
end
|
|
294
|
-
|
|
295
|
-
# Downgrade Subscription
|
|
296
|
-
# Downgrade an existing paid subscription to a lower plan.
|
|
297
|
-
# @param id [String]
|
|
298
|
-
# @param plan_change_request [PlanChangeRequest]
|
|
299
|
-
# @param [Hash] opts the optional parameters
|
|
300
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
301
|
-
def downgrade_subscription_with_http_info(id, plan_change_request, opts = {})
|
|
302
|
-
if @api_client.config.debugging
|
|
303
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.downgrade_subscription ...'
|
|
304
|
-
end
|
|
305
|
-
# verify the required parameter 'id' is set
|
|
306
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
307
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.downgrade_subscription"
|
|
308
|
-
end
|
|
309
|
-
# verify the required parameter 'plan_change_request' is set
|
|
310
|
-
if @api_client.config.client_side_validation && plan_change_request.nil?
|
|
311
|
-
fail ArgumentError, "Missing the required parameter 'plan_change_request' when calling BillingApi.downgrade_subscription"
|
|
312
|
-
end
|
|
313
|
-
# resource path
|
|
314
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/downgrade'.sub('{id}', CGI.escape(id.to_s))
|
|
315
|
-
|
|
316
|
-
# query parameters
|
|
317
|
-
query_params = opts[:query_params] || {}
|
|
318
|
-
|
|
319
|
-
# header parameters
|
|
320
|
-
header_params = opts[:header_params] || {}
|
|
321
|
-
# HTTP header 'Accept' (if needed)
|
|
322
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
323
|
-
# HTTP header 'Content-Type'
|
|
324
|
-
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
325
|
-
if !content_type.nil?
|
|
326
|
-
header_params['Content-Type'] = content_type
|
|
327
|
-
end
|
|
328
|
-
|
|
329
|
-
# form parameters
|
|
330
|
-
form_params = opts[:form_params] || {}
|
|
331
|
-
|
|
332
|
-
# http body (model)
|
|
333
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(plan_change_request)
|
|
334
|
-
|
|
335
|
-
# return_type
|
|
336
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
337
|
-
|
|
338
|
-
# auth_names
|
|
339
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
340
|
-
|
|
341
|
-
new_options = opts.merge(
|
|
342
|
-
:operation => :"BillingApi.downgrade_subscription",
|
|
343
|
-
:header_params => header_params,
|
|
344
|
-
:query_params => query_params,
|
|
345
|
-
:form_params => form_params,
|
|
346
|
-
:body => post_body,
|
|
347
|
-
:auth_names => auth_names,
|
|
348
|
-
:return_type => return_type
|
|
349
|
-
)
|
|
350
|
-
|
|
351
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
352
|
-
if @api_client.config.debugging
|
|
353
|
-
@api_client.config.logger.debug "API called: BillingApi#downgrade_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
354
|
-
end
|
|
355
|
-
return data, status_code, headers
|
|
356
|
-
end
|
|
357
|
-
|
|
358
153
|
# Execute Setup Intent
|
|
359
154
|
# Create a Stripe SetupIntent for adding a payment method without an immediate charge. Returns the `client_secret` to pass to Stripe Elements in the browser.
|
|
360
155
|
# @param [Hash] opts the optional parameters
|
|
@@ -539,8 +334,9 @@ module SmplkitGeneratedClient::App
|
|
|
539
334
|
end
|
|
540
335
|
|
|
541
336
|
# List Invoices
|
|
542
|
-
# Return invoice history for the account from Stripe.
|
|
337
|
+
# Return invoice history for the account from Stripe. Default sort is `-created_at` (newest first).
|
|
543
338
|
# @param [Hash] opts the optional parameters
|
|
339
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`, `status`, `-status`, `total`, `-total`. (default to '-created_at')
|
|
544
340
|
# @return [InvoiceListResponse]
|
|
545
341
|
def list_invoices(opts = {})
|
|
546
342
|
data, _status_code, _headers = list_invoices_with_http_info(opts)
|
|
@@ -548,18 +344,24 @@ module SmplkitGeneratedClient::App
|
|
|
548
344
|
end
|
|
549
345
|
|
|
550
346
|
# List Invoices
|
|
551
|
-
# Return invoice history for the account from Stripe.
|
|
347
|
+
# Return invoice history for the account from Stripe. Default sort is `-created_at` (newest first).
|
|
552
348
|
# @param [Hash] opts the optional parameters
|
|
349
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`, `status`, `-status`, `total`, `-total`. (default to '-created_at')
|
|
553
350
|
# @return [Array<(InvoiceListResponse, Integer, Hash)>] InvoiceListResponse data, response status code and response headers
|
|
554
351
|
def list_invoices_with_http_info(opts = {})
|
|
555
352
|
if @api_client.config.debugging
|
|
556
353
|
@api_client.config.logger.debug 'Calling API: BillingApi.list_invoices ...'
|
|
557
354
|
end
|
|
355
|
+
allowable_values = ["created_at", "-created_at", "status", "-status", "total", "-total"]
|
|
356
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
357
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
358
|
+
end
|
|
558
359
|
# resource path
|
|
559
360
|
local_var_path = '/api/v1/invoices'
|
|
560
361
|
|
|
561
362
|
# query parameters
|
|
562
363
|
query_params = opts[:query_params] || {}
|
|
364
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
563
365
|
|
|
564
366
|
# header parameters
|
|
565
367
|
header_params = opts[:header_params] || {}
|
|
@@ -598,6 +400,7 @@ module SmplkitGeneratedClient::App
|
|
|
598
400
|
# List Payment Methods
|
|
599
401
|
# List all payment methods for the account. Default is returned first, then newest first.
|
|
600
402
|
# @param [Hash] opts the optional parameters
|
|
403
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`, `exp_year`, `-exp_year`, `is_default`, `-is_default`, `updated_at`, `-updated_at`. (default to '-created_at')
|
|
601
404
|
# @return [PaymentMethodListResponse]
|
|
602
405
|
def list_payment_methods(opts = {})
|
|
603
406
|
data, _status_code, _headers = list_payment_methods_with_http_info(opts)
|
|
@@ -607,16 +410,22 @@ module SmplkitGeneratedClient::App
|
|
|
607
410
|
# List Payment Methods
|
|
608
411
|
# List all payment methods for the account. Default is returned first, then newest first.
|
|
609
412
|
# @param [Hash] opts the optional parameters
|
|
413
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`, `exp_year`, `-exp_year`, `is_default`, `-is_default`, `updated_at`, `-updated_at`. (default to '-created_at')
|
|
610
414
|
# @return [Array<(PaymentMethodListResponse, Integer, Hash)>] PaymentMethodListResponse data, response status code and response headers
|
|
611
415
|
def list_payment_methods_with_http_info(opts = {})
|
|
612
416
|
if @api_client.config.debugging
|
|
613
417
|
@api_client.config.logger.debug 'Calling API: BillingApi.list_payment_methods ...'
|
|
614
418
|
end
|
|
419
|
+
allowable_values = ["created_at", "-created_at", "exp_year", "-exp_year", "is_default", "-is_default", "updated_at", "-updated_at"]
|
|
420
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
421
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
422
|
+
end
|
|
615
423
|
# resource path
|
|
616
424
|
local_var_path = '/api/v1/payment_methods'
|
|
617
425
|
|
|
618
426
|
# query parameters
|
|
619
427
|
query_params = opts[:query_params] || {}
|
|
428
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
620
429
|
|
|
621
430
|
# header parameters
|
|
622
431
|
header_params = opts[:header_params] || {}
|
|
@@ -652,63 +461,6 @@ module SmplkitGeneratedClient::App
|
|
|
652
461
|
return data, status_code, headers
|
|
653
462
|
end
|
|
654
463
|
|
|
655
|
-
# List Subscriptions
|
|
656
|
-
# Return subscription rows for the authenticated account.
|
|
657
|
-
# @param [Hash] opts the optional parameters
|
|
658
|
-
# @return [SubscriptionListResponse]
|
|
659
|
-
def list_subscriptions(opts = {})
|
|
660
|
-
data, _status_code, _headers = list_subscriptions_with_http_info(opts)
|
|
661
|
-
data
|
|
662
|
-
end
|
|
663
|
-
|
|
664
|
-
# List Subscriptions
|
|
665
|
-
# Return subscription rows for the authenticated account.
|
|
666
|
-
# @param [Hash] opts the optional parameters
|
|
667
|
-
# @return [Array<(SubscriptionListResponse, Integer, Hash)>] SubscriptionListResponse data, response status code and response headers
|
|
668
|
-
def list_subscriptions_with_http_info(opts = {})
|
|
669
|
-
if @api_client.config.debugging
|
|
670
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.list_subscriptions ...'
|
|
671
|
-
end
|
|
672
|
-
# resource path
|
|
673
|
-
local_var_path = '/api/v1/subscriptions'
|
|
674
|
-
|
|
675
|
-
# query parameters
|
|
676
|
-
query_params = opts[:query_params] || {}
|
|
677
|
-
|
|
678
|
-
# header parameters
|
|
679
|
-
header_params = opts[:header_params] || {}
|
|
680
|
-
# HTTP header 'Accept' (if needed)
|
|
681
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
682
|
-
|
|
683
|
-
# form parameters
|
|
684
|
-
form_params = opts[:form_params] || {}
|
|
685
|
-
|
|
686
|
-
# http body (model)
|
|
687
|
-
post_body = opts[:debug_body]
|
|
688
|
-
|
|
689
|
-
# return_type
|
|
690
|
-
return_type = opts[:debug_return_type] || 'SubscriptionListResponse'
|
|
691
|
-
|
|
692
|
-
# auth_names
|
|
693
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
694
|
-
|
|
695
|
-
new_options = opts.merge(
|
|
696
|
-
:operation => :"BillingApi.list_subscriptions",
|
|
697
|
-
:header_params => header_params,
|
|
698
|
-
:query_params => query_params,
|
|
699
|
-
:form_params => form_params,
|
|
700
|
-
:body => post_body,
|
|
701
|
-
:auth_names => auth_names,
|
|
702
|
-
:return_type => return_type
|
|
703
|
-
)
|
|
704
|
-
|
|
705
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
706
|
-
if @api_client.config.debugging
|
|
707
|
-
@api_client.config.logger.debug "API called: BillingApi#list_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
708
|
-
end
|
|
709
|
-
return data, status_code, headers
|
|
710
|
-
end
|
|
711
|
-
|
|
712
464
|
# Set Default Payment Method
|
|
713
465
|
# Mark this payment method as the account's default. Idempotent: returns 200 with no changes when the payment method is already the default.
|
|
714
466
|
# @param id [String]
|
|
@@ -772,132 +524,6 @@ module SmplkitGeneratedClient::App
|
|
|
772
524
|
return data, status_code, headers
|
|
773
525
|
end
|
|
774
526
|
|
|
775
|
-
# Undo Cancellation
|
|
776
|
-
# Reverse a pending cancellation; subscription will renew as normal.
|
|
777
|
-
# @param id [String]
|
|
778
|
-
# @param [Hash] opts the optional parameters
|
|
779
|
-
# @return [SubscriptionResponse]
|
|
780
|
-
def uncancel_subscription(id, opts = {})
|
|
781
|
-
data, _status_code, _headers = uncancel_subscription_with_http_info(id, opts)
|
|
782
|
-
data
|
|
783
|
-
end
|
|
784
|
-
|
|
785
|
-
# Undo Cancellation
|
|
786
|
-
# Reverse a pending cancellation; subscription will renew as normal.
|
|
787
|
-
# @param id [String]
|
|
788
|
-
# @param [Hash] opts the optional parameters
|
|
789
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
790
|
-
def uncancel_subscription_with_http_info(id, opts = {})
|
|
791
|
-
if @api_client.config.debugging
|
|
792
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.uncancel_subscription ...'
|
|
793
|
-
end
|
|
794
|
-
# verify the required parameter 'id' is set
|
|
795
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
796
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.uncancel_subscription"
|
|
797
|
-
end
|
|
798
|
-
# resource path
|
|
799
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/uncancel'.sub('{id}', CGI.escape(id.to_s))
|
|
800
|
-
|
|
801
|
-
# query parameters
|
|
802
|
-
query_params = opts[:query_params] || {}
|
|
803
|
-
|
|
804
|
-
# header parameters
|
|
805
|
-
header_params = opts[:header_params] || {}
|
|
806
|
-
# HTTP header 'Accept' (if needed)
|
|
807
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
808
|
-
|
|
809
|
-
# form parameters
|
|
810
|
-
form_params = opts[:form_params] || {}
|
|
811
|
-
|
|
812
|
-
# http body (model)
|
|
813
|
-
post_body = opts[:debug_body]
|
|
814
|
-
|
|
815
|
-
# return_type
|
|
816
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
817
|
-
|
|
818
|
-
# auth_names
|
|
819
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
820
|
-
|
|
821
|
-
new_options = opts.merge(
|
|
822
|
-
:operation => :"BillingApi.uncancel_subscription",
|
|
823
|
-
:header_params => header_params,
|
|
824
|
-
:query_params => query_params,
|
|
825
|
-
:form_params => form_params,
|
|
826
|
-
:body => post_body,
|
|
827
|
-
:auth_names => auth_names,
|
|
828
|
-
:return_type => return_type
|
|
829
|
-
)
|
|
830
|
-
|
|
831
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
832
|
-
if @api_client.config.debugging
|
|
833
|
-
@api_client.config.logger.debug "API called: BillingApi#uncancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
834
|
-
end
|
|
835
|
-
return data, status_code, headers
|
|
836
|
-
end
|
|
837
|
-
|
|
838
|
-
# Undo Pending Downgrade
|
|
839
|
-
# Reverse a pending downgrade scheduled for end of the current billing period.
|
|
840
|
-
# @param id [String]
|
|
841
|
-
# @param [Hash] opts the optional parameters
|
|
842
|
-
# @return [SubscriptionResponse]
|
|
843
|
-
def undowngrade_subscription(id, opts = {})
|
|
844
|
-
data, _status_code, _headers = undowngrade_subscription_with_http_info(id, opts)
|
|
845
|
-
data
|
|
846
|
-
end
|
|
847
|
-
|
|
848
|
-
# Undo Pending Downgrade
|
|
849
|
-
# Reverse a pending downgrade scheduled for end of the current billing period.
|
|
850
|
-
# @param id [String]
|
|
851
|
-
# @param [Hash] opts the optional parameters
|
|
852
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
853
|
-
def undowngrade_subscription_with_http_info(id, opts = {})
|
|
854
|
-
if @api_client.config.debugging
|
|
855
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.undowngrade_subscription ...'
|
|
856
|
-
end
|
|
857
|
-
# verify the required parameter 'id' is set
|
|
858
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
859
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.undowngrade_subscription"
|
|
860
|
-
end
|
|
861
|
-
# resource path
|
|
862
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/undowngrade'.sub('{id}', CGI.escape(id.to_s))
|
|
863
|
-
|
|
864
|
-
# query parameters
|
|
865
|
-
query_params = opts[:query_params] || {}
|
|
866
|
-
|
|
867
|
-
# header parameters
|
|
868
|
-
header_params = opts[:header_params] || {}
|
|
869
|
-
# HTTP header 'Accept' (if needed)
|
|
870
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
871
|
-
|
|
872
|
-
# form parameters
|
|
873
|
-
form_params = opts[:form_params] || {}
|
|
874
|
-
|
|
875
|
-
# http body (model)
|
|
876
|
-
post_body = opts[:debug_body]
|
|
877
|
-
|
|
878
|
-
# return_type
|
|
879
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
880
|
-
|
|
881
|
-
# auth_names
|
|
882
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
883
|
-
|
|
884
|
-
new_options = opts.merge(
|
|
885
|
-
:operation => :"BillingApi.undowngrade_subscription",
|
|
886
|
-
:header_params => header_params,
|
|
887
|
-
:query_params => query_params,
|
|
888
|
-
:form_params => form_params,
|
|
889
|
-
:body => post_body,
|
|
890
|
-
:auth_names => auth_names,
|
|
891
|
-
:return_type => return_type
|
|
892
|
-
)
|
|
893
|
-
|
|
894
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
895
|
-
if @api_client.config.debugging
|
|
896
|
-
@api_client.config.logger.debug "API called: BillingApi#undowngrade_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
897
|
-
end
|
|
898
|
-
return data, status_code, headers
|
|
899
|
-
end
|
|
900
|
-
|
|
901
527
|
# Update Payment Method
|
|
902
528
|
# Update the mutable fields of a payment method (`billing_details`, `exp_month`, `exp_year`). The `default` flag is not mutable via PUT — use the `set_default` action instead.
|
|
903
529
|
# @param id [String]
|
|
@@ -971,79 +597,5 @@ module SmplkitGeneratedClient::App
|
|
|
971
597
|
end
|
|
972
598
|
return data, status_code, headers
|
|
973
599
|
end
|
|
974
|
-
|
|
975
|
-
# Upgrade Subscription
|
|
976
|
-
# Upgrade an existing paid subscription to a higher plan.
|
|
977
|
-
# @param id [String]
|
|
978
|
-
# @param plan_change_request [PlanChangeRequest]
|
|
979
|
-
# @param [Hash] opts the optional parameters
|
|
980
|
-
# @return [SubscriptionResponse]
|
|
981
|
-
def upgrade_subscription(id, plan_change_request, opts = {})
|
|
982
|
-
data, _status_code, _headers = upgrade_subscription_with_http_info(id, plan_change_request, opts)
|
|
983
|
-
data
|
|
984
|
-
end
|
|
985
|
-
|
|
986
|
-
# Upgrade Subscription
|
|
987
|
-
# Upgrade an existing paid subscription to a higher plan.
|
|
988
|
-
# @param id [String]
|
|
989
|
-
# @param plan_change_request [PlanChangeRequest]
|
|
990
|
-
# @param [Hash] opts the optional parameters
|
|
991
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
992
|
-
def upgrade_subscription_with_http_info(id, plan_change_request, opts = {})
|
|
993
|
-
if @api_client.config.debugging
|
|
994
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.upgrade_subscription ...'
|
|
995
|
-
end
|
|
996
|
-
# verify the required parameter 'id' is set
|
|
997
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
998
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.upgrade_subscription"
|
|
999
|
-
end
|
|
1000
|
-
# verify the required parameter 'plan_change_request' is set
|
|
1001
|
-
if @api_client.config.client_side_validation && plan_change_request.nil?
|
|
1002
|
-
fail ArgumentError, "Missing the required parameter 'plan_change_request' when calling BillingApi.upgrade_subscription"
|
|
1003
|
-
end
|
|
1004
|
-
# resource path
|
|
1005
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/upgrade'.sub('{id}', CGI.escape(id.to_s))
|
|
1006
|
-
|
|
1007
|
-
# query parameters
|
|
1008
|
-
query_params = opts[:query_params] || {}
|
|
1009
|
-
|
|
1010
|
-
# header parameters
|
|
1011
|
-
header_params = opts[:header_params] || {}
|
|
1012
|
-
# HTTP header 'Accept' (if needed)
|
|
1013
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
1014
|
-
# HTTP header 'Content-Type'
|
|
1015
|
-
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
1016
|
-
if !content_type.nil?
|
|
1017
|
-
header_params['Content-Type'] = content_type
|
|
1018
|
-
end
|
|
1019
|
-
|
|
1020
|
-
# form parameters
|
|
1021
|
-
form_params = opts[:form_params] || {}
|
|
1022
|
-
|
|
1023
|
-
# http body (model)
|
|
1024
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(plan_change_request)
|
|
1025
|
-
|
|
1026
|
-
# return_type
|
|
1027
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
1028
|
-
|
|
1029
|
-
# auth_names
|
|
1030
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
1031
|
-
|
|
1032
|
-
new_options = opts.merge(
|
|
1033
|
-
:operation => :"BillingApi.upgrade_subscription",
|
|
1034
|
-
:header_params => header_params,
|
|
1035
|
-
:query_params => query_params,
|
|
1036
|
-
:form_params => form_params,
|
|
1037
|
-
:body => post_body,
|
|
1038
|
-
:auth_names => auth_names,
|
|
1039
|
-
:return_type => return_type
|
|
1040
|
-
)
|
|
1041
|
-
|
|
1042
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1043
|
-
if @api_client.config.debugging
|
|
1044
|
-
@api_client.config.logger.debug "API called: BillingApi#upgrade_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1045
|
-
end
|
|
1046
|
-
return data, status_code, headers
|
|
1047
|
-
end
|
|
1048
600
|
end
|
|
1049
601
|
end
|
|
@@ -216,6 +216,7 @@ module SmplkitGeneratedClient::App
|
|
|
216
216
|
# List Context Types
|
|
217
217
|
# List all context types for the authenticated account.
|
|
218
218
|
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `created_at`, `-created_at`, `key`, `-key`, `name`, `-name`, `updated_at`, `-updated_at`. (default to 'key')
|
|
219
220
|
# @return [ContextTypeListResponse]
|
|
220
221
|
def list_context_types(opts = {})
|
|
221
222
|
data, _status_code, _headers = list_context_types_with_http_info(opts)
|
|
@@ -225,16 +226,22 @@ module SmplkitGeneratedClient::App
|
|
|
225
226
|
# List Context Types
|
|
226
227
|
# List all context types for the authenticated account.
|
|
227
228
|
# @param [Hash] opts the optional parameters
|
|
229
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `created_at`, `-created_at`, `key`, `-key`, `name`, `-name`, `updated_at`, `-updated_at`. (default to 'key')
|
|
228
230
|
# @return [Array<(ContextTypeListResponse, Integer, Hash)>] ContextTypeListResponse data, response status code and response headers
|
|
229
231
|
def list_context_types_with_http_info(opts = {})
|
|
230
232
|
if @api_client.config.debugging
|
|
231
233
|
@api_client.config.logger.debug 'Calling API: ContextTypesApi.list_context_types ...'
|
|
232
234
|
end
|
|
235
|
+
allowable_values = ["created_at", "-created_at", "key", "-key", "name", "-name", "updated_at", "-updated_at"]
|
|
236
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
237
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
238
|
+
end
|
|
233
239
|
# resource path
|
|
234
240
|
local_var_path = '/api/v1/context_types'
|
|
235
241
|
|
|
236
242
|
# query parameters
|
|
237
243
|
query_params = opts[:query_params] || {}
|
|
244
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
238
245
|
|
|
239
246
|
# header parameters
|
|
240
247
|
header_params = opts[:header_params] || {}
|