Class: PostfinancecheckoutRubySdk::SubscriptionsService
- Inherits:
-
Object
- Object
- PostfinancecheckoutRubySdk::SubscriptionsService
- Defined in:
- lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_subscriptions(space, opts = {}) ⇒ SubscriptionListResponse
List all subscriptions.
-
#get_subscriptions_id(id, space, opts = {}) ⇒ Subscription
Retrieve a subscription.
-
#get_subscriptions_id_invoices(id, space, opts = {}) ⇒ InvoiceSearchResponse
Search subscription invoices.
-
#get_subscriptions_id_invoices_with_http_info(id, space, opts = {}) ⇒ Array<(InvoiceSearchResponse, Integer, Hash)>
InvoiceSearchResponse data, response status code and response headers.
-
#get_subscriptions_id_with_http_info(id, space, opts = {}) ⇒ Array<(Subscription, Integer, Hash)>
Subscription data, response status code and response headers.
-
#get_subscriptions_search(space, opts = {}) ⇒ SubscriptionSearchResponse
Search subscriptions.
-
#get_subscriptions_search_with_http_info(space, opts = {}) ⇒ Array<(SubscriptionSearchResponse, Integer, Hash)>
SubscriptionSearchResponse data, response status code and response headers.
-
#get_subscriptions_with_http_info(space, opts = {}) ⇒ Array<(SubscriptionListResponse, Integer, Hash)>
SubscriptionListResponse data, response status code and response headers.
-
#initialize(api_client = ApiClient.default) ⇒ SubscriptionsService
constructor
A new instance of SubscriptionsService.
-
#patch_subscriptions_id(id, space, subscription_update_request, opts = {}) ⇒ Subscription
Update a subscription.
-
#patch_subscriptions_id_with_http_info(id, space, subscription_update_request, opts = {}) ⇒ Array<(Subscription, Integer, Hash)>
Subscription data, response status code and response headers.
-
#post_subscriptions(space, subscription_create_request, opts = {}) ⇒ SubscriptionVersion
Create a subscription.
-
#post_subscriptions_id_apply_changes(id, space, subscription_update_request, opts = {}) ⇒ SubscriptionVersion
Apply changes to a subscription.
-
#post_subscriptions_id_apply_changes_with_http_info(id, space, subscription_update_request, opts = {}) ⇒ Array<(SubscriptionVersion, Integer, Hash)>
SubscriptionVersion data, response status code and response headers.
-
#post_subscriptions_id_initialize(id, space, opts = {}) ⇒ SubscriptionCharge
Initialize a subscription.
-
#post_subscriptions_id_initialize_subscriber_present(id, space, subscription_initialize_subscriber_present_request, opts = {}) ⇒ SubscriptionCharge
Initialize a subscription with the subscriber present.
-
#post_subscriptions_id_initialize_subscriber_present_with_http_info(id, space, subscription_initialize_subscriber_present_request, opts = {}) ⇒ Array<(SubscriptionCharge, Integer, Hash)>
SubscriptionCharge data, response status code and response headers.
-
#post_subscriptions_id_initialize_with_http_info(id, space, opts = {}) ⇒ Array<(SubscriptionCharge, Integer, Hash)>
SubscriptionCharge data, response status code and response headers.
-
#post_subscriptions_id_reactivate(id, space, opts = {}) ⇒ nil
Reactivate a suspended subscription.
-
#post_subscriptions_id_reactivate_with_http_info(id, space, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Nil, response status code and response headers.
-
#post_subscriptions_id_suspend(id, space, suspension_creation_request, opts = {}) ⇒ SubscriptionSuspension
Suspend a subscription.
-
#post_subscriptions_id_suspend_with_http_info(id, space, suspension_creation_request, opts = {}) ⇒ Array<(SubscriptionSuspension, Integer, Hash)>
SubscriptionSuspension data, response status code and response headers.
-
#post_subscriptions_id_terminate(id, respect_termination_period, space, opts = {}) ⇒ nil
Terminate a subscription.
-
#post_subscriptions_id_terminate_with_http_info(id, respect_termination_period, space, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Nil, response status code and response headers.
-
#post_subscriptions_id_upgrade_product(id, respect_termination_period, space, opts = {}) ⇒ SubscriptionVersion
Upgrade a subscription’s product.
-
#post_subscriptions_id_upgrade_product_with_http_info(id, respect_termination_period, space, opts = {}) ⇒ Array<(SubscriptionVersion, Integer, Hash)>
SubscriptionVersion data, response status code and response headers.
-
#post_subscriptions_with_http_info(space, subscription_create_request, opts = {}) ⇒ Array<(SubscriptionVersion, Integer, Hash)>
SubscriptionVersion data, response status code and response headers.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ SubscriptionsService
Returns a new instance of SubscriptionsService.
30 31 32 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
27 28 29 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 27 def api_client @api_client end |
Instance Method Details
#get_subscriptions(space, opts = {}) ⇒ SubscriptionListResponse
List all subscriptions
42 43 44 45 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 42 def get_subscriptions(space, opts = {}) data, _status_code, _headers = get_subscriptions_with_http_info(space, opts) data end |
#get_subscriptions_id(id, space, opts = {}) ⇒ Subscription
Retrieve a subscription
133 134 135 136 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 133 def get_subscriptions_id(id, space, opts = {}) data, _status_code, _headers = get_subscriptions_id_with_http_info(id, space, opts) data end |
#get_subscriptions_id_invoices(id, space, opts = {}) ⇒ InvoiceSearchResponse
Search subscription invoices
209 210 211 212 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 209 def get_subscriptions_id_invoices(id, space, opts = {}) data, _status_code, _headers = get_subscriptions_id_invoices_with_http_info(id, space, opts) data end |
#get_subscriptions_id_invoices_with_http_info(id, space, opts = {}) ⇒ Array<(InvoiceSearchResponse, Integer, Hash)>
Returns InvoiceSearchResponse data, response status code and response headers.
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 225 def get_subscriptions_id_invoices_with_http_info(id, space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.get_subscriptions_id_invoices ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.get_subscriptions_id_invoices" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.get_subscriptions_id_invoices" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsService.get_subscriptions_id_invoices, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsService.get_subscriptions_id_invoices, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 10000 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling SubscriptionsService.get_subscriptions_id_invoices, must be smaller than or equal to 10000.' end # resource path local_var_path = '/subscriptions/{id}/invoices'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InvoiceSearchResponse' = opts.merge( :operation => :"SubscriptionsService.get_subscriptions_id_invoices", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#get_subscriptions_id_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#get_subscriptions_id_with_http_info(id, space, opts = {}) ⇒ Array<(Subscription, Integer, Hash)>
Returns Subscription data, response status code and response headers.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 145 def get_subscriptions_id_with_http_info(id, space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.get_subscriptions_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.get_subscriptions_id" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.get_subscriptions_id" end # resource path local_var_path = '/subscriptions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Subscription' = opts.merge( :operation => :"SubscriptionsService.get_subscriptions_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#get_subscriptions_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#get_subscriptions_search(space, opts = {}) ⇒ SubscriptionSearchResponse
Search subscriptions
304 305 306 307 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 304 def get_subscriptions_search(space, opts = {}) data, _status_code, _headers = get_subscriptions_search_with_http_info(space, opts) data end |
#get_subscriptions_search_with_http_info(space, opts = {}) ⇒ Array<(SubscriptionSearchResponse, Integer, Hash)>
Returns SubscriptionSearchResponse data, response status code and response headers.
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 319 def get_subscriptions_search_with_http_info(space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.get_subscriptions_search ...' end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.get_subscriptions_search" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsService.get_subscriptions_search, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsService.get_subscriptions_search, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 10000 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling SubscriptionsService.get_subscriptions_search, must be smaller than or equal to 10000.' end # resource path local_var_path = '/subscriptions/search' # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionSearchResponse' = opts.merge( :operation => :"SubscriptionsService.get_subscriptions_search", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#get_subscriptions_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#get_subscriptions_with_http_info(space, opts = {}) ⇒ Array<(SubscriptionListResponse, Integer, Hash)>
Returns SubscriptionListResponse data, response status code and response headers.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 57 def get_subscriptions_with_http_info(space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.get_subscriptions ...' end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.get_subscriptions" end if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 1 fail ArgumentError, 'invalid value for "opts[:"after"]" when calling SubscriptionsService.get_subscriptions, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'before'].nil? && opts[:'before'] < 1 fail ArgumentError, 'invalid value for "opts[:"before"]" when calling SubscriptionsService.get_subscriptions, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsService.get_subscriptions, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsService.get_subscriptions, must be greater than or equal to 1.' end # resource path local_var_path = '/subscriptions' # query parameters query_params = opts[:query_params] || {} query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionListResponse' = opts.merge( :operation => :"SubscriptionsService.get_subscriptions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#get_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#patch_subscriptions_id(id, space, subscription_update_request, opts = {}) ⇒ Subscription
Update a subscription
392 393 394 395 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 392 def patch_subscriptions_id(id, space, subscription_update_request, opts = {}) data, _status_code, _headers = patch_subscriptions_id_with_http_info(id, space, subscription_update_request, opts) data end |
#patch_subscriptions_id_with_http_info(id, space, subscription_update_request, opts = {}) ⇒ Array<(Subscription, Integer, Hash)>
Returns Subscription data, response status code and response headers.
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 405 def patch_subscriptions_id_with_http_info(id, space, subscription_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.patch_subscriptions_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.patch_subscriptions_id" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.patch_subscriptions_id" end # verify the required parameter 'subscription_update_request' is set if @api_client.config.client_side_validation && subscription_update_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_update_request' when calling SubscriptionsService.patch_subscriptions_id" end # resource path local_var_path = '/subscriptions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_update_request) # return_type return_type = opts[:debug_return_type] || 'Subscription' = opts.merge( :operation => :"SubscriptionsService.patch_subscriptions_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#patch_subscriptions_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions(space, subscription_create_request, opts = {}) ⇒ SubscriptionVersion
Create a subscription
474 475 476 477 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 474 def post_subscriptions(space, subscription_create_request, opts = {}) data, _status_code, _headers = post_subscriptions_with_http_info(space, subscription_create_request, opts) data end |
#post_subscriptions_id_apply_changes(id, space, subscription_update_request, opts = {}) ⇒ SubscriptionVersion
Apply changes to a subscription
552 553 554 555 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 552 def post_subscriptions_id_apply_changes(id, space, subscription_update_request, opts = {}) data, _status_code, _headers = post_subscriptions_id_apply_changes_with_http_info(id, space, subscription_update_request, opts) data end |
#post_subscriptions_id_apply_changes_with_http_info(id, space, subscription_update_request, opts = {}) ⇒ Array<(SubscriptionVersion, Integer, Hash)>
Returns SubscriptionVersion data, response status code and response headers.
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 565 def post_subscriptions_id_apply_changes_with_http_info(id, space, subscription_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions_id_apply_changes ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.post_subscriptions_id_apply_changes" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions_id_apply_changes" end # verify the required parameter 'subscription_update_request' is set if @api_client.config.client_side_validation && subscription_update_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_update_request' when calling SubscriptionsService.post_subscriptions_id_apply_changes" end # resource path local_var_path = '/subscriptions/{id}/apply-changes'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_update_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionVersion' = opts.merge( :operation => :"SubscriptionsService.post_subscriptions_id_apply_changes", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions_id_apply_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions_id_initialize(id, space, opts = {}) ⇒ SubscriptionCharge
Initialize a subscription
634 635 636 637 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 634 def post_subscriptions_id_initialize(id, space, opts = {}) data, _status_code, _headers = post_subscriptions_id_initialize_with_http_info(id, space, opts) data end |
#post_subscriptions_id_initialize_subscriber_present(id, space, subscription_initialize_subscriber_present_request, opts = {}) ⇒ SubscriptionCharge
Initialize a subscription with the subscriber present
707 708 709 710 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 707 def post_subscriptions_id_initialize_subscriber_present(id, space, subscription_initialize_subscriber_present_request, opts = {}) data, _status_code, _headers = post_subscriptions_id_initialize_subscriber_present_with_http_info(id, space, subscription_initialize_subscriber_present_request, opts) data end |
#post_subscriptions_id_initialize_subscriber_present_with_http_info(id, space, subscription_initialize_subscriber_present_request, opts = {}) ⇒ Array<(SubscriptionCharge, Integer, Hash)>
Returns SubscriptionCharge data, response status code and response headers.
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 720 def post_subscriptions_id_initialize_subscriber_present_with_http_info(id, space, subscription_initialize_subscriber_present_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions_id_initialize_subscriber_present ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.post_subscriptions_id_initialize_subscriber_present" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions_id_initialize_subscriber_present" end # verify the required parameter 'subscription_initialize_subscriber_present_request' is set if @api_client.config.client_side_validation && subscription_initialize_subscriber_present_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_initialize_subscriber_present_request' when calling SubscriptionsService.post_subscriptions_id_initialize_subscriber_present" end # resource path local_var_path = '/subscriptions/{id}/initialize-subscriber-present'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_initialize_subscriber_present_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionCharge' = opts.merge( :operation => :"SubscriptionsService.post_subscriptions_id_initialize_subscriber_present", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions_id_initialize_subscriber_present\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions_id_initialize_with_http_info(id, space, opts = {}) ⇒ Array<(SubscriptionCharge, Integer, Hash)>
Returns SubscriptionCharge data, response status code and response headers.
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 646 def post_subscriptions_id_initialize_with_http_info(id, space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions_id_initialize ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.post_subscriptions_id_initialize" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions_id_initialize" end # resource path local_var_path = '/subscriptions/{id}/initialize'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionCharge' = opts.merge( :operation => :"SubscriptionsService.post_subscriptions_id_initialize", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions_id_initialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions_id_reactivate(id, space, opts = {}) ⇒ nil
Reactivate a suspended subscription
788 789 790 791 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 788 def post_subscriptions_id_reactivate(id, space, opts = {}) post_subscriptions_id_reactivate_with_http_info(id, space, opts) nil end |
#post_subscriptions_id_reactivate_with_http_info(id, space, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Returns nil, response status code and response headers.
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 799 def post_subscriptions_id_reactivate_with_http_info(id, space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions_id_reactivate ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.post_subscriptions_id_reactivate" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions_id_reactivate" end # resource path local_var_path = '/subscriptions/{id}/reactivate'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] = opts.merge( :operation => :"SubscriptionsService.post_subscriptions_id_reactivate", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions_id_reactivate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions_id_suspend(id, space, suspension_creation_request, opts = {}) ⇒ SubscriptionSuspension
Suspend a subscription
859 860 861 862 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 859 def post_subscriptions_id_suspend(id, space, suspension_creation_request, opts = {}) data, _status_code, _headers = post_subscriptions_id_suspend_with_http_info(id, space, suspension_creation_request, opts) data end |
#post_subscriptions_id_suspend_with_http_info(id, space, suspension_creation_request, opts = {}) ⇒ Array<(SubscriptionSuspension, Integer, Hash)>
Returns SubscriptionSuspension data, response status code and response headers.
872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 872 def post_subscriptions_id_suspend_with_http_info(id, space, suspension_creation_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions_id_suspend ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.post_subscriptions_id_suspend" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions_id_suspend" end # verify the required parameter 'suspension_creation_request' is set if @api_client.config.client_side_validation && suspension_creation_request.nil? fail ArgumentError, "Missing the required parameter 'suspension_creation_request' when calling SubscriptionsService.post_subscriptions_id_suspend" end # resource path local_var_path = '/subscriptions/{id}/suspend'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(suspension_creation_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionSuspension' = opts.merge( :operation => :"SubscriptionsService.post_subscriptions_id_suspend", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions_id_suspend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions_id_terminate(id, respect_termination_period, space, opts = {}) ⇒ nil
Terminate a subscription
941 942 943 944 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 941 def post_subscriptions_id_terminate(id, respect_termination_period, space, opts = {}) post_subscriptions_id_terminate_with_http_info(id, respect_termination_period, space, opts) nil end |
#post_subscriptions_id_terminate_with_http_info(id, respect_termination_period, space, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Returns nil, response status code and response headers.
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 953 def post_subscriptions_id_terminate_with_http_info(id, respect_termination_period, space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions_id_terminate ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.post_subscriptions_id_terminate" end # verify the required parameter 'respect_termination_period' is set if @api_client.config.client_side_validation && respect_termination_period.nil? fail ArgumentError, "Missing the required parameter 'respect_termination_period' when calling SubscriptionsService.post_subscriptions_id_terminate" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions_id_terminate" end # resource path local_var_path = '/subscriptions/{id}/terminate'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'respectTerminationPeriod'] = respect_termination_period # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] = opts.merge( :operation => :"SubscriptionsService.post_subscriptions_id_terminate", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions_id_terminate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions_id_upgrade_product(id, respect_termination_period, space, opts = {}) ⇒ SubscriptionVersion
Upgrade a subscription’s product
1018 1019 1020 1021 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 1018 def post_subscriptions_id_upgrade_product(id, respect_termination_period, space, opts = {}) data, _status_code, _headers = post_subscriptions_id_upgrade_product_with_http_info(id, respect_termination_period, space, opts) data end |
#post_subscriptions_id_upgrade_product_with_http_info(id, respect_termination_period, space, opts = {}) ⇒ Array<(SubscriptionVersion, Integer, Hash)>
Returns SubscriptionVersion data, response status code and response headers.
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 1031 def post_subscriptions_id_upgrade_product_with_http_info(id, respect_termination_period, space, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions_id_upgrade_product ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsService.post_subscriptions_id_upgrade_product" end # verify the required parameter 'respect_termination_period' is set if @api_client.config.client_side_validation && respect_termination_period.nil? fail ArgumentError, "Missing the required parameter 'respect_termination_period' when calling SubscriptionsService.post_subscriptions_id_upgrade_product" end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions_id_upgrade_product" end # resource path local_var_path = '/subscriptions/{id}/upgrade-product'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'respectTerminationPeriod'] = respect_termination_period query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionVersion' = opts.merge( :operation => :"SubscriptionsService.post_subscriptions_id_upgrade_product", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions_id_upgrade_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_subscriptions_with_http_info(space, subscription_create_request, opts = {}) ⇒ Array<(SubscriptionVersion, Integer, Hash)>
Returns SubscriptionVersion data, response status code and response headers.
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 |
# File 'lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb', line 486 def post_subscriptions_with_http_info(space, subscription_create_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsService.post_subscriptions ...' end # verify the required parameter 'space' is set if @api_client.config.client_side_validation && space.nil? fail ArgumentError, "Missing the required parameter 'space' when calling SubscriptionsService.post_subscriptions" end # verify the required parameter 'subscription_create_request' is set if @api_client.config.client_side_validation && subscription_create_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_create_request' when calling SubscriptionsService.post_subscriptions" end # resource path local_var_path = '/subscriptions' # query parameters query_params = opts[:query_params] || {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Space'] = space # form parameters form_params = opts[:form_params] || {} # connection timeout connection_timeout = @api_client.config.timeout # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_create_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionVersion' = opts.merge( :operation => :"SubscriptionsService.post_subscriptions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsService#post_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |