Class: PostfinancecheckoutRubySdk::AccountsService
- Inherits:
-
Object
- Object
- PostfinancecheckoutRubySdk::AccountsService
- Defined in:
- lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_accounts_id(id, opts = {}) ⇒ nil
Delete an account Permanently deletes an account.
-
#delete_accounts_id_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Nil, response status code and response headers.
-
#get_accounts(opts = {}) ⇒ AccountListResponse
List all accounts.
-
#get_accounts_id(id, opts = {}) ⇒ Account
Retrieve an account.
-
#get_accounts_id_with_http_info(id, opts = {}) ⇒ Array<(Account, Integer, Hash)>
Account data, response status code and response headers.
-
#get_accounts_search(opts = {}) ⇒ AccountSearchResponse
Search accounts.
-
#get_accounts_search_with_http_info(opts = {}) ⇒ Array<(AccountSearchResponse, Integer, Hash)>
AccountSearchResponse data, response status code and response headers.
-
#get_accounts_with_http_info(opts = {}) ⇒ Array<(AccountListResponse, Integer, Hash)>
AccountListResponse data, response status code and response headers.
-
#initialize(api_client = ApiClient.default) ⇒ AccountsService
constructor
A new instance of AccountsService.
-
#patch_accounts_id(id, account_update, opts = {}) ⇒ Account
Update an account.
-
#patch_accounts_id_with_http_info(id, account_update, opts = {}) ⇒ Array<(Account, Integer, Hash)>
Account data, response status code and response headers.
-
#post_accounts(account_create, opts = {}) ⇒ Account
Create an account.
-
#post_accounts_id_activate(id, opts = {}) ⇒ nil
Activate an account.
-
#post_accounts_id_activate_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Nil, response status code and response headers.
-
#post_accounts_id_deactivate(id, opts = {}) ⇒ nil
Deactivate an account.
-
#post_accounts_id_deactivate_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Nil, response status code and response headers.
-
#post_accounts_with_http_info(account_create, opts = {}) ⇒ Array<(Account, Integer, Hash)>
Account data, response status code and response headers.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AccountsService
Returns a new instance of AccountsService.
30 31 32 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_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/accounts_service.rb', line 27 def api_client @api_client end |
Instance Method Details
#delete_accounts_id(id, opts = {}) ⇒ nil
Delete an account Permanently deletes an account. It cannot be undone.
38 39 40 41 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 38 def delete_accounts_id(id, opts = {}) delete_accounts_id_with_http_info(id, opts) nil end |
#delete_accounts_id_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Returns nil, response status code and response headers.
49 50 51 52 53 54 55 56 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 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 49 def delete_accounts_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.delete_accounts_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 AccountsService.delete_accounts_id" end # resource path local_var_path = '/accounts/{id}'.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'] # 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 => :"AccountsService.delete_accounts_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(:DELETE.to_sym.downcase, local_var_path, , connection_timeout) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsService#delete_accounts_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#get_accounts(opts = {}) ⇒ AccountListResponse
List all accounts
105 106 107 108 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 105 def get_accounts(opts = {}) data, _status_code, _headers = get_accounts_with_http_info(opts) data end |
#get_accounts_id(id, opts = {}) ⇒ Account
Retrieve an account
189 190 191 192 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 189 def get_accounts_id(id, opts = {}) data, _status_code, _headers = get_accounts_id_with_http_info(id, opts) data end |
#get_accounts_id_with_http_info(id, opts = {}) ⇒ Array<(Account, Integer, Hash)>
Returns Account data, response status code and response headers.
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 200 def get_accounts_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.get_accounts_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 AccountsService.get_accounts_id" end # resource path local_var_path = '/accounts/{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'] # 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] || 'Account' = opts.merge( :operation => :"AccountsService.get_accounts_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: AccountsService#get_accounts_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#get_accounts_search(opts = {}) ⇒ AccountSearchResponse
Search accounts
257 258 259 260 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 257 def get_accounts_search(opts = {}) data, _status_code, _headers = get_accounts_search_with_http_info(opts) data end |
#get_accounts_search_with_http_info(opts = {}) ⇒ Array<(AccountSearchResponse, Integer, Hash)>
Returns AccountSearchResponse data, response status code and response headers.
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 271 def get_accounts_search_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.get_accounts_search ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AccountsService.get_accounts_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 AccountsService.get_accounts_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 AccountsService.get_accounts_search, must be smaller than or equal to 10000.' end # resource path local_var_path = '/accounts/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'] # 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] || 'AccountSearchResponse' = opts.merge( :operation => :"AccountsService.get_accounts_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: AccountsService#get_accounts_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#get_accounts_with_http_info(opts = {}) ⇒ Array<(AccountListResponse, Integer, Hash)>
Returns AccountListResponse data, response status code and response headers.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 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 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 119 def get_accounts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.get_accounts ...' end if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 1 fail ArgumentError, 'invalid value for "opts[:"after"]" when calling AccountsService.get_accounts, 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 AccountsService.get_accounts, 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 AccountsService.get_accounts, 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 AccountsService.get_accounts, must be greater than or equal to 1.' end # resource path local_var_path = '/accounts' # 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'] # 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] || 'AccountListResponse' = opts.merge( :operation => :"AccountsService.get_accounts", :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: AccountsService#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#patch_accounts_id(id, account_update, opts = {}) ⇒ Account
Update an account
338 339 340 341 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 338 def patch_accounts_id(id, account_update, opts = {}) data, _status_code, _headers = patch_accounts_id_with_http_info(id, account_update, opts) data end |
#patch_accounts_id_with_http_info(id, account_update, opts = {}) ⇒ Array<(Account, Integer, Hash)>
Returns Account data, response status code and response headers.
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 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 350 def patch_accounts_id_with_http_info(id, account_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.patch_accounts_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 AccountsService.patch_accounts_id" end # verify the required parameter 'account_update' is set if @api_client.config.client_side_validation && account_update.nil? fail ArgumentError, "Missing the required parameter 'account_update' when calling AccountsService.patch_accounts_id" end # resource path local_var_path = '/accounts/{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 # 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(account_update) # return_type return_type = opts[:debug_return_type] || 'Account' = opts.merge( :operation => :"AccountsService.patch_accounts_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: AccountsService#patch_accounts_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_accounts(account_create, opts = {}) ⇒ Account
Create an account
413 414 415 416 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 413 def post_accounts(account_create, opts = {}) data, _status_code, _headers = post_accounts_with_http_info(account_create, opts) data end |
#post_accounts_id_activate(id, opts = {}) ⇒ nil
Activate an account
482 483 484 485 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 482 def post_accounts_id_activate(id, opts = {}) post_accounts_id_activate_with_http_info(id, opts) nil end |
#post_accounts_id_activate_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Returns nil, response status code and response headers.
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 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 492 def post_accounts_id_activate_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.post_accounts_id_activate ...' 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 AccountsService.post_accounts_id_activate" end # resource path local_var_path = '/accounts/{id}/activate'.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'] # 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 => :"AccountsService.post_accounts_id_activate", :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: AccountsService#post_accounts_id_activate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_accounts_id_deactivate(id, opts = {}) ⇒ nil
Deactivate an account
544 545 546 547 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 544 def post_accounts_id_deactivate(id, opts = {}) post_accounts_id_deactivate_with_http_info(id, opts) nil end |
#post_accounts_id_deactivate_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Returns nil, response status code and response headers.
554 555 556 557 558 559 560 561 562 563 564 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 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 554 def post_accounts_id_deactivate_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.post_accounts_id_deactivate ...' 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 AccountsService.post_accounts_id_deactivate" end # resource path local_var_path = '/accounts/{id}/deactivate'.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'] # 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 => :"AccountsService.post_accounts_id_deactivate", :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: AccountsService#post_accounts_id_deactivate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |
#post_accounts_with_http_info(account_create, opts = {}) ⇒ Array<(Account, Integer, Hash)>
Returns Account data, response status code and response headers.
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 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/postfinancecheckout-ruby-sdk/service/accounts_service.rb', line 424 def post_accounts_with_http_info(account_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsService.post_accounts ...' end # verify the required parameter 'account_create' is set if @api_client.config.client_side_validation && account_create.nil? fail ArgumentError, "Missing the required parameter 'account_create' when calling AccountsService.post_accounts" end # resource path local_var_path = '/accounts' # 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 # 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(account_create) # return_type return_type = opts[:debug_return_type] || 'Account' = opts.merge( :operation => :"AccountsService.post_accounts", :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: AccountsService#post_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}" end return data, status_code, headers end |