smplkit 3.0.8 → 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/billing_api.rb +0 -469
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/subscription_api.rb +289 -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/billing_api_spec.rb +0 -86
- data/lib/smplkit/_generated/app/spec/api/subscription_api_spec.rb +83 -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
|
|
@@ -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
|
|
@@ -666,70 +461,6 @@ module SmplkitGeneratedClient::App
|
|
|
666
461
|
return data, status_code, headers
|
|
667
462
|
end
|
|
668
463
|
|
|
669
|
-
# List Subscriptions
|
|
670
|
-
# Return subscription rows for the authenticated account. Default sort is `product` ascending.
|
|
671
|
-
# @param [Hash] opts the optional parameters
|
|
672
|
-
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `product`. Allowed values: `created_at`, `-created_at`, `plan`, `-plan`, `product`, `-product`, `status`, `-status`. (default to 'product')
|
|
673
|
-
# @return [SubscriptionListResponse]
|
|
674
|
-
def list_subscriptions(opts = {})
|
|
675
|
-
data, _status_code, _headers = list_subscriptions_with_http_info(opts)
|
|
676
|
-
data
|
|
677
|
-
end
|
|
678
|
-
|
|
679
|
-
# List Subscriptions
|
|
680
|
-
# Return subscription rows for the authenticated account. Default sort is `product` ascending.
|
|
681
|
-
# @param [Hash] opts the optional parameters
|
|
682
|
-
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `product`. Allowed values: `created_at`, `-created_at`, `plan`, `-plan`, `product`, `-product`, `status`, `-status`. (default to 'product')
|
|
683
|
-
# @return [Array<(SubscriptionListResponse, Integer, Hash)>] SubscriptionListResponse data, response status code and response headers
|
|
684
|
-
def list_subscriptions_with_http_info(opts = {})
|
|
685
|
-
if @api_client.config.debugging
|
|
686
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.list_subscriptions ...'
|
|
687
|
-
end
|
|
688
|
-
allowable_values = ["created_at", "-created_at", "plan", "-plan", "product", "-product", "status", "-status"]
|
|
689
|
-
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
690
|
-
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
691
|
-
end
|
|
692
|
-
# resource path
|
|
693
|
-
local_var_path = '/api/v1/subscriptions'
|
|
694
|
-
|
|
695
|
-
# query parameters
|
|
696
|
-
query_params = opts[:query_params] || {}
|
|
697
|
-
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
698
|
-
|
|
699
|
-
# header parameters
|
|
700
|
-
header_params = opts[:header_params] || {}
|
|
701
|
-
# HTTP header 'Accept' (if needed)
|
|
702
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
703
|
-
|
|
704
|
-
# form parameters
|
|
705
|
-
form_params = opts[:form_params] || {}
|
|
706
|
-
|
|
707
|
-
# http body (model)
|
|
708
|
-
post_body = opts[:debug_body]
|
|
709
|
-
|
|
710
|
-
# return_type
|
|
711
|
-
return_type = opts[:debug_return_type] || 'SubscriptionListResponse'
|
|
712
|
-
|
|
713
|
-
# auth_names
|
|
714
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
715
|
-
|
|
716
|
-
new_options = opts.merge(
|
|
717
|
-
:operation => :"BillingApi.list_subscriptions",
|
|
718
|
-
:header_params => header_params,
|
|
719
|
-
:query_params => query_params,
|
|
720
|
-
:form_params => form_params,
|
|
721
|
-
:body => post_body,
|
|
722
|
-
:auth_names => auth_names,
|
|
723
|
-
:return_type => return_type
|
|
724
|
-
)
|
|
725
|
-
|
|
726
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
727
|
-
if @api_client.config.debugging
|
|
728
|
-
@api_client.config.logger.debug "API called: BillingApi#list_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
729
|
-
end
|
|
730
|
-
return data, status_code, headers
|
|
731
|
-
end
|
|
732
|
-
|
|
733
464
|
# Set Default Payment Method
|
|
734
465
|
# Mark this payment method as the account's default. Idempotent: returns 200 with no changes when the payment method is already the default.
|
|
735
466
|
# @param id [String]
|
|
@@ -793,132 +524,6 @@ module SmplkitGeneratedClient::App
|
|
|
793
524
|
return data, status_code, headers
|
|
794
525
|
end
|
|
795
526
|
|
|
796
|
-
# Undo Cancellation
|
|
797
|
-
# Reverse a pending cancellation; subscription will renew as normal.
|
|
798
|
-
# @param id [String]
|
|
799
|
-
# @param [Hash] opts the optional parameters
|
|
800
|
-
# @return [SubscriptionResponse]
|
|
801
|
-
def uncancel_subscription(id, opts = {})
|
|
802
|
-
data, _status_code, _headers = uncancel_subscription_with_http_info(id, opts)
|
|
803
|
-
data
|
|
804
|
-
end
|
|
805
|
-
|
|
806
|
-
# Undo Cancellation
|
|
807
|
-
# Reverse a pending cancellation; subscription will renew as normal.
|
|
808
|
-
# @param id [String]
|
|
809
|
-
# @param [Hash] opts the optional parameters
|
|
810
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
811
|
-
def uncancel_subscription_with_http_info(id, opts = {})
|
|
812
|
-
if @api_client.config.debugging
|
|
813
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.uncancel_subscription ...'
|
|
814
|
-
end
|
|
815
|
-
# verify the required parameter 'id' is set
|
|
816
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
817
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.uncancel_subscription"
|
|
818
|
-
end
|
|
819
|
-
# resource path
|
|
820
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/uncancel'.sub('{id}', CGI.escape(id.to_s))
|
|
821
|
-
|
|
822
|
-
# query parameters
|
|
823
|
-
query_params = opts[:query_params] || {}
|
|
824
|
-
|
|
825
|
-
# header parameters
|
|
826
|
-
header_params = opts[:header_params] || {}
|
|
827
|
-
# HTTP header 'Accept' (if needed)
|
|
828
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
829
|
-
|
|
830
|
-
# form parameters
|
|
831
|
-
form_params = opts[:form_params] || {}
|
|
832
|
-
|
|
833
|
-
# http body (model)
|
|
834
|
-
post_body = opts[:debug_body]
|
|
835
|
-
|
|
836
|
-
# return_type
|
|
837
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
838
|
-
|
|
839
|
-
# auth_names
|
|
840
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
841
|
-
|
|
842
|
-
new_options = opts.merge(
|
|
843
|
-
:operation => :"BillingApi.uncancel_subscription",
|
|
844
|
-
:header_params => header_params,
|
|
845
|
-
:query_params => query_params,
|
|
846
|
-
:form_params => form_params,
|
|
847
|
-
:body => post_body,
|
|
848
|
-
:auth_names => auth_names,
|
|
849
|
-
:return_type => return_type
|
|
850
|
-
)
|
|
851
|
-
|
|
852
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
853
|
-
if @api_client.config.debugging
|
|
854
|
-
@api_client.config.logger.debug "API called: BillingApi#uncancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
855
|
-
end
|
|
856
|
-
return data, status_code, headers
|
|
857
|
-
end
|
|
858
|
-
|
|
859
|
-
# Undo Pending Downgrade
|
|
860
|
-
# Reverse a pending downgrade scheduled for end of the current billing period.
|
|
861
|
-
# @param id [String]
|
|
862
|
-
# @param [Hash] opts the optional parameters
|
|
863
|
-
# @return [SubscriptionResponse]
|
|
864
|
-
def undowngrade_subscription(id, opts = {})
|
|
865
|
-
data, _status_code, _headers = undowngrade_subscription_with_http_info(id, opts)
|
|
866
|
-
data
|
|
867
|
-
end
|
|
868
|
-
|
|
869
|
-
# Undo Pending Downgrade
|
|
870
|
-
# Reverse a pending downgrade scheduled for end of the current billing period.
|
|
871
|
-
# @param id [String]
|
|
872
|
-
# @param [Hash] opts the optional parameters
|
|
873
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
874
|
-
def undowngrade_subscription_with_http_info(id, opts = {})
|
|
875
|
-
if @api_client.config.debugging
|
|
876
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.undowngrade_subscription ...'
|
|
877
|
-
end
|
|
878
|
-
# verify the required parameter 'id' is set
|
|
879
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
880
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.undowngrade_subscription"
|
|
881
|
-
end
|
|
882
|
-
# resource path
|
|
883
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/undowngrade'.sub('{id}', CGI.escape(id.to_s))
|
|
884
|
-
|
|
885
|
-
# query parameters
|
|
886
|
-
query_params = opts[:query_params] || {}
|
|
887
|
-
|
|
888
|
-
# header parameters
|
|
889
|
-
header_params = opts[:header_params] || {}
|
|
890
|
-
# HTTP header 'Accept' (if needed)
|
|
891
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
892
|
-
|
|
893
|
-
# form parameters
|
|
894
|
-
form_params = opts[:form_params] || {}
|
|
895
|
-
|
|
896
|
-
# http body (model)
|
|
897
|
-
post_body = opts[:debug_body]
|
|
898
|
-
|
|
899
|
-
# return_type
|
|
900
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
901
|
-
|
|
902
|
-
# auth_names
|
|
903
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
904
|
-
|
|
905
|
-
new_options = opts.merge(
|
|
906
|
-
:operation => :"BillingApi.undowngrade_subscription",
|
|
907
|
-
:header_params => header_params,
|
|
908
|
-
:query_params => query_params,
|
|
909
|
-
:form_params => form_params,
|
|
910
|
-
:body => post_body,
|
|
911
|
-
:auth_names => auth_names,
|
|
912
|
-
:return_type => return_type
|
|
913
|
-
)
|
|
914
|
-
|
|
915
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
916
|
-
if @api_client.config.debugging
|
|
917
|
-
@api_client.config.logger.debug "API called: BillingApi#undowngrade_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
918
|
-
end
|
|
919
|
-
return data, status_code, headers
|
|
920
|
-
end
|
|
921
|
-
|
|
922
527
|
# Update Payment Method
|
|
923
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.
|
|
924
529
|
# @param id [String]
|
|
@@ -992,79 +597,5 @@ module SmplkitGeneratedClient::App
|
|
|
992
597
|
end
|
|
993
598
|
return data, status_code, headers
|
|
994
599
|
end
|
|
995
|
-
|
|
996
|
-
# Upgrade Subscription
|
|
997
|
-
# Upgrade an existing paid subscription to a higher plan.
|
|
998
|
-
# @param id [String]
|
|
999
|
-
# @param plan_change_request [PlanChangeRequest]
|
|
1000
|
-
# @param [Hash] opts the optional parameters
|
|
1001
|
-
# @return [SubscriptionResponse]
|
|
1002
|
-
def upgrade_subscription(id, plan_change_request, opts = {})
|
|
1003
|
-
data, _status_code, _headers = upgrade_subscription_with_http_info(id, plan_change_request, opts)
|
|
1004
|
-
data
|
|
1005
|
-
end
|
|
1006
|
-
|
|
1007
|
-
# Upgrade Subscription
|
|
1008
|
-
# Upgrade an existing paid subscription to a higher plan.
|
|
1009
|
-
# @param id [String]
|
|
1010
|
-
# @param plan_change_request [PlanChangeRequest]
|
|
1011
|
-
# @param [Hash] opts the optional parameters
|
|
1012
|
-
# @return [Array<(SubscriptionResponse, Integer, Hash)>] SubscriptionResponse data, response status code and response headers
|
|
1013
|
-
def upgrade_subscription_with_http_info(id, plan_change_request, opts = {})
|
|
1014
|
-
if @api_client.config.debugging
|
|
1015
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.upgrade_subscription ...'
|
|
1016
|
-
end
|
|
1017
|
-
# verify the required parameter 'id' is set
|
|
1018
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
1019
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.upgrade_subscription"
|
|
1020
|
-
end
|
|
1021
|
-
# verify the required parameter 'plan_change_request' is set
|
|
1022
|
-
if @api_client.config.client_side_validation && plan_change_request.nil?
|
|
1023
|
-
fail ArgumentError, "Missing the required parameter 'plan_change_request' when calling BillingApi.upgrade_subscription"
|
|
1024
|
-
end
|
|
1025
|
-
# resource path
|
|
1026
|
-
local_var_path = '/api/v1/subscriptions/{id}/actions/upgrade'.sub('{id}', CGI.escape(id.to_s))
|
|
1027
|
-
|
|
1028
|
-
# query parameters
|
|
1029
|
-
query_params = opts[:query_params] || {}
|
|
1030
|
-
|
|
1031
|
-
# header parameters
|
|
1032
|
-
header_params = opts[:header_params] || {}
|
|
1033
|
-
# HTTP header 'Accept' (if needed)
|
|
1034
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
1035
|
-
# HTTP header 'Content-Type'
|
|
1036
|
-
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
1037
|
-
if !content_type.nil?
|
|
1038
|
-
header_params['Content-Type'] = content_type
|
|
1039
|
-
end
|
|
1040
|
-
|
|
1041
|
-
# form parameters
|
|
1042
|
-
form_params = opts[:form_params] || {}
|
|
1043
|
-
|
|
1044
|
-
# http body (model)
|
|
1045
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(plan_change_request)
|
|
1046
|
-
|
|
1047
|
-
# return_type
|
|
1048
|
-
return_type = opts[:debug_return_type] || 'SubscriptionResponse'
|
|
1049
|
-
|
|
1050
|
-
# auth_names
|
|
1051
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
1052
|
-
|
|
1053
|
-
new_options = opts.merge(
|
|
1054
|
-
:operation => :"BillingApi.upgrade_subscription",
|
|
1055
|
-
:header_params => header_params,
|
|
1056
|
-
:query_params => query_params,
|
|
1057
|
-
:form_params => form_params,
|
|
1058
|
-
:body => post_body,
|
|
1059
|
-
:auth_names => auth_names,
|
|
1060
|
-
:return_type => return_type
|
|
1061
|
-
)
|
|
1062
|
-
|
|
1063
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1064
|
-
if @api_client.config.debugging
|
|
1065
|
-
@api_client.config.logger.debug "API called: BillingApi#upgrade_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1066
|
-
end
|
|
1067
|
-
return data, status_code, headers
|
|
1068
|
-
end
|
|
1069
600
|
end
|
|
1070
601
|
end
|