Class: SwaggerClient::AccountsApi
- Inherits:
-
Object
- Object
- SwaggerClient::AccountsApi
- Defined in:
- lib/swagger_client/api/accounts_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_account(opts = {}) ⇒ AccountJson
Add a new account Create an account with the specified parameters.
-
#add_account_contact(account_id, opts = {}) ⇒ AccountContactJson
Add a contact for an account Creates and adds a new contact for the specified account and returns the new contact ID.
-
#add_account_contact_with_http_info(account_id, opts = {}) ⇒ Array<(AccountContactJson, Fixnum, Hash)>
Add a contact for an account Creates and adds a new contact for the specified account and returns the new contact ID.
-
#add_account_payment_method(account_id, opts = {}) ⇒ AccountPaymentMethodJson
Add a payment method to an account Add a payment method to the specified account and return its ID.
-
#add_account_payment_method_with_http_info(account_id, opts = {}) ⇒ Array<(AccountPaymentMethodJson, Fixnum, Hash)>
Add a payment method to an account Add a payment method to the specified account and return its ID.
-
#add_account_with_http_info(opts = {}) ⇒ Array<(AccountJson, Fixnum, Hash)>
Add a new account Create an account with the specified parameters.
-
#delete_account(id, opts = {}) ⇒ nil
Delete an account Deletes the account associated with the passed ID.
-
#delete_account_contact(contact_id, account_id, opts = {}) ⇒ nil
Delete a contact Deletes the contact specified by the account id and contact id.
-
#delete_account_contact_with_http_info(contact_id, account_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a contact Deletes the contact specified by the account id and contact id.
-
#delete_account_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete an account Deletes the account associated with the passed ID.
-
#get_account(id, opts = {}) ⇒ AccountJson
Get an account by id Returns the details of the account specified by the passed id.
-
#get_account_contact(account_id, contact_id, opts = {}) ⇒ AccountContactJson
Gets contact details Returns the details of the specified contact.
-
#get_account_contact_with_http_info(account_id, contact_id, opts = {}) ⇒ Array<(AccountContactJson, Fixnum, Hash)>
Gets contact details Returns the details of the specified contact.
-
#get_account_contacts(account_id, opts = {}) ⇒ Array<AccountContactJson>
Get contacts for an account Returns a list of contacts associated with the specified account id.
-
#get_account_contacts_with_http_info(account_id, opts = {}) ⇒ Array<(Array<AccountContactJson>, Fixnum, Hash)>
Get contacts for an account Returns a list of contacts associated with the specified account id.
-
#get_account_metrics(id, opts = {}) ⇒ MetricsJson
Returns metrics for the specified account Fetches metrics such as ARR, TCV, etc for the specified account as of the specified target date.
-
#get_account_metrics_with_http_info(id, opts = {}) ⇒ Array<(MetricsJson, Fixnum, Hash)>
Returns metrics for the specified account Fetches metrics such as ARR, TCV, etc for the specified account as of the specified target date.
-
#get_account_payment_methods(account_id, opts = {}) ⇒ Array<AccountPaymentMethodJson>
Get the payment methods for an account Returns a list of payment methods for the specified account id.
-
#get_account_payment_methods_with_http_info(account_id, opts = {}) ⇒ Array<(Array<AccountPaymentMethodJson>, Fixnum, Hash)>
Get the payment methods for an account Returns a list of payment methods for the specified account id.
-
#get_account_with_http_info(id, opts = {}) ⇒ Array<(AccountJson, Fixnum, Hash)>
Get an account by id Returns the details of the account specified by the passed id.
-
#get_accounts(opts = {}) ⇒ PaginatedAccountsResponse
Get all accounts Returns a paginated list of accounts.
-
#get_accounts_with_http_info(opts = {}) ⇒ Array<(PaginatedAccountsResponse, Fixnum, Hash)>
Get all accounts Returns a paginated list of accounts.
-
#get_payment_method(account_id, id, opts = {}) ⇒ AccountPaymentMethodJson
Get the details of a payment method Returns the details of the payment method for the specified account id and payment method id.
-
#get_payment_method_with_http_info(account_id, id, opts = {}) ⇒ Array<(AccountPaymentMethodJson, Fixnum, Hash)>
Get the details of a payment method Returns the details of the payment method for the specified account id and payment method id.
-
#import_crm_account(opts = {}) ⇒ CrmAccountImportResponse
Import an account from a CRM Ensures an account exists which matches the passed details.If an account exists that has a matching CRM Id, it will be updated, if not, it will be created.
-
#import_crm_account_with_http_info(opts = {}) ⇒ Array<(CrmAccountImportResponse, Fixnum, Hash)>
Import an account from a CRM Ensures an account exists which matches the passed details.If an account exists that has a matching CRM Id, it will be updated, if not, it will be created.
-
#initialize(api_client = ApiClient.default) ⇒ AccountsApi
constructor
A new instance of AccountsApi.
-
#update_account(id, opts = {}) ⇒ nil
Update an account Updates an existing account with the specified parameters.
-
#update_account_contact(account_id, contact_id, opts = {}) ⇒ nil
Update a contact Updates the contact specified by the account id and contact id with the passed information.
-
#update_account_contact_with_http_info(account_id, contact_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update a contact Updates the contact specified by the account id and contact id with the passed information.
-
#update_account_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update an account Updates an existing account with the specified parameters.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AccountsApi
Returns a new instance of AccountsApi.
19 20 21 |
# File 'lib/swagger_client/api/accounts_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/swagger_client/api/accounts_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add_account(opts = {}) ⇒ AccountJson
Add a new account Create an account with the specified parameters. On success, the id of the newly created account is returned
27 28 29 30 |
# File 'lib/swagger_client/api/accounts_api.rb', line 27 def add_account(opts = {}) data, _status_code, _headers = add_account_with_http_info(opts) data end |
#add_account_contact(account_id, opts = {}) ⇒ AccountContactJson
Add a contact for an account Creates and adds a new contact for the specified account and returns the new contact ID
80 81 82 83 |
# File 'lib/swagger_client/api/accounts_api.rb', line 80 def add_account_contact(account_id, opts = {}) data, _status_code, _headers = add_account_contact_with_http_info(account_id, opts) data end |
#add_account_contact_with_http_info(account_id, opts = {}) ⇒ Array<(AccountContactJson, Fixnum, Hash)>
Add a contact for an account Creates and adds a new contact for the specified account and returns the new contact ID
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 125 126 127 128 129 130 131 |
# File 'lib/swagger_client/api/accounts_api.rb', line 93 def add_account_contact_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.add_account_contact ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.add_account_contact" end # resource path local_var_path = '/accounts/{accountId}/contacts'.sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'skipAddressValidation'] = opts[:'skip_address_validation'] if !opts[:'skip_address_validation'].nil? query_params[:'strictValidation'] = opts[:'strict_validation'] if !opts[:'strict_validation'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AccountContactJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#add_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#add_account_payment_method(account_id, opts = {}) ⇒ AccountPaymentMethodJson
Add a payment method to an account Add a payment method to the specified account and return its ID
138 139 140 141 |
# File 'lib/swagger_client/api/accounts_api.rb', line 138 def add_account_payment_method(account_id, opts = {}) data, _status_code, _headers = add_account_payment_method_with_http_info(account_id, opts) data end |
#add_account_payment_method_with_http_info(account_id, opts = {}) ⇒ Array<(AccountPaymentMethodJson, Fixnum, Hash)>
Add a payment method to an account Add a payment method to the specified account and return its ID
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 |
# File 'lib/swagger_client/api/accounts_api.rb', line 149 def add_account_payment_method_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.add_account_payment_method ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.add_account_payment_method" end # resource path local_var_path = '/accounts/{accountId}/paymentMethods'.sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AccountPaymentMethodJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#add_account_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#add_account_with_http_info(opts = {}) ⇒ Array<(AccountJson, Fixnum, Hash)>
Add a new account Create an account with the specified parameters. On success, the id of the newly created account is returned
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/swagger_client/api/accounts_api.rb', line 37 def add_account_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.add_account ...' end # resource path local_var_path = '/accounts' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AccountJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#add_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_account(id, opts = {}) ⇒ nil
Delete an account Deletes the account associated with the passed ID
193 194 195 196 |
# File 'lib/swagger_client/api/accounts_api.rb', line 193 def delete_account(id, opts = {}) delete_account_with_http_info(id, opts) nil end |
#delete_account_contact(contact_id, account_id, opts = {}) ⇒ nil
Delete a contact Deletes the contact specified by the account id and contact id
245 246 247 248 |
# File 'lib/swagger_client/api/accounts_api.rb', line 245 def delete_account_contact(contact_id, account_id, opts = {}) delete_account_contact_with_http_info(contact_id, account_id, opts) nil end |
#delete_account_contact_with_http_info(contact_id, account_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a contact Deletes the contact specified by the account id and contact id
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 293 294 295 |
# File 'lib/swagger_client/api/accounts_api.rb', line 256 def delete_account_contact_with_http_info(contact_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.delete_account_contact ...' end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountsApi.delete_account_contact" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.delete_account_contact" end # resource path local_var_path = '/accounts/{accountId}/contacts/{contactId}'.sub('{' + 'contactId' + '}', contact_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#delete_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_account_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete an account Deletes the account associated with the passed ID
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 |
# File 'lib/swagger_client/api/accounts_api.rb', line 203 def delete_account_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.delete_account ...' 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 AccountsApi.delete_account" end # resource path local_var_path = '/accounts/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#delete_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_account(id, opts = {}) ⇒ AccountJson
Get an account by id Returns the details of the account specified by the passed id
302 303 304 305 |
# File 'lib/swagger_client/api/accounts_api.rb', line 302 def get_account(id, opts = {}) data, _status_code, _headers = get_account_with_http_info(id, opts) data end |
#get_account_contact(account_id, contact_id, opts = {}) ⇒ AccountContactJson
Gets contact details Returns the details of the specified contact
360 361 362 363 |
# File 'lib/swagger_client/api/accounts_api.rb', line 360 def get_account_contact(account_id, contact_id, opts = {}) data, _status_code, _headers = get_account_contact_with_http_info(account_id, contact_id, opts) data end |
#get_account_contact_with_http_info(account_id, contact_id, opts = {}) ⇒ Array<(AccountContactJson, Fixnum, Hash)>
Gets contact details Returns the details of the specified contact
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 406 407 408 409 410 411 |
# File 'lib/swagger_client/api/accounts_api.rb', line 371 def get_account_contact_with_http_info(account_id, contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_contact ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account_contact" end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountsApi.get_account_contact" end # resource path local_var_path = '/accounts/{accountId}/contacts/{contactId}'.sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AccountContactJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#get_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_account_contacts(account_id, opts = {}) ⇒ Array<AccountContactJson>
Get contacts for an account Returns a list of contacts associated with the specified account id
418 419 420 421 |
# File 'lib/swagger_client/api/accounts_api.rb', line 418 def get_account_contacts(account_id, opts = {}) data, _status_code, _headers = get_account_contacts_with_http_info(account_id, opts) data end |
#get_account_contacts_with_http_info(account_id, opts = {}) ⇒ Array<(Array<AccountContactJson>, Fixnum, Hash)>
Get contacts for an account Returns a list of contacts associated with the specified account id
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 |
# File 'lib/swagger_client/api/accounts_api.rb', line 429 def get_account_contacts_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_contacts ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account_contacts" end # resource path local_var_path = '/accounts/{accountId}/contacts'.sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AccountContactJson>') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#get_account_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_account_metrics(id, opts = {}) ⇒ MetricsJson
Returns metrics for the specified account Fetches metrics such as ARR, TCV, etc for the specified account as of the specified target date
473 474 475 476 |
# File 'lib/swagger_client/api/accounts_api.rb', line 473 def get_account_metrics(id, opts = {}) data, _status_code, _headers = get_account_metrics_with_http_info(id, opts) data end |
#get_account_metrics_with_http_info(id, opts = {}) ⇒ Array<(MetricsJson, Fixnum, Hash)>
Returns metrics for the specified account Fetches metrics such as ARR, TCV, etc for the specified account as of the specified target date
484 485 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 |
# File 'lib/swagger_client/api/accounts_api.rb', line 484 def get_account_metrics_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_metrics ...' 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 AccountsApi.get_account_metrics" end # resource path local_var_path = '/accounts/{id}/metrics'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'targetDate'] = opts[:'target_date'] if !opts[:'target_date'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'MetricsJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#get_account_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_account_payment_methods(account_id, opts = {}) ⇒ Array<AccountPaymentMethodJson>
Get the payment methods for an account Returns a list of payment methods for the specified account id
527 528 529 530 |
# File 'lib/swagger_client/api/accounts_api.rb', line 527 def get_account_payment_methods(account_id, opts = {}) data, _status_code, _headers = get_account_payment_methods_with_http_info(account_id, opts) data end |
#get_account_payment_methods_with_http_info(account_id, opts = {}) ⇒ Array<(Array<AccountPaymentMethodJson>, Fixnum, Hash)>
Get the payment methods for an account Returns a list of payment methods for the specified account id
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/swagger_client/api/accounts_api.rb', line 537 def get_account_payment_methods_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_payment_methods ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account_payment_methods" end # resource path local_var_path = '/accounts/{accountId}/paymentMethods'.sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AccountPaymentMethodJson>') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#get_account_payment_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_account_with_http_info(id, opts = {}) ⇒ Array<(AccountJson, Fixnum, Hash)>
Get an account by id Returns the details of the account specified by the passed id
313 314 315 316 317 318 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 |
# File 'lib/swagger_client/api/accounts_api.rb', line 313 def get_account_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.get_account ...' 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 AccountsApi.get_account" end if @api_client.config.client_side_validation && opts[:'id_type'] && !['ACCOUNT_ID', 'CRM_ID', 'EXTERNAL_ID'].include?(opts[:'id_type']) fail ArgumentError, 'invalid value for "id_type", must be one of ACCOUNT_ID, CRM_ID, EXTERNAL_ID' end # resource path local_var_path = '/accounts/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'idType'] = opts[:'id_type'] if !opts[:'id_type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AccountJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_accounts(opts = {}) ⇒ PaginatedAccountsResponse
Get all accounts Returns a paginated list of accounts
581 582 583 584 |
# File 'lib/swagger_client/api/accounts_api.rb', line 581 def get_accounts(opts = {}) data, _status_code, _headers = get_accounts_with_http_info(opts) data end |
#get_accounts_with_http_info(opts = {}) ⇒ Array<(PaginatedAccountsResponse, Fixnum, Hash)>
Get all accounts Returns a paginated list of accounts
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 626 627 628 |
# File 'lib/swagger_client/api/accounts_api.rb', line 593 def get_accounts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...' end # resource path local_var_path = '/accounts' # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PaginatedAccountsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_payment_method(account_id, id, opts = {}) ⇒ AccountPaymentMethodJson
Get the details of a payment method Returns the details of the payment method for the specified account id and payment method id
635 636 637 638 |
# File 'lib/swagger_client/api/accounts_api.rb', line 635 def get_payment_method(account_id, id, opts = {}) data, _status_code, _headers = get_payment_method_with_http_info(account_id, id, opts) data end |
#get_payment_method_with_http_info(account_id, id, opts = {}) ⇒ Array<(AccountPaymentMethodJson, Fixnum, Hash)>
Get the details of a payment method Returns the details of the payment method for the specified account id and payment method id
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 |
# File 'lib/swagger_client/api/accounts_api.rb', line 646 def get_payment_method_with_http_info(account_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.get_payment_method ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_payment_method" 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 AccountsApi.get_payment_method" end # resource path local_var_path = '/accounts/{accountId}/paymentMethods/{id}'.sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AccountPaymentMethodJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#get_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#import_crm_account(opts = {}) ⇒ CrmAccountImportResponse
Import an account from a CRM Ensures an account exists which matches the passed details.If an account exists that has a matching CRM Id, it will be updated, if not, it will be created
692 693 694 695 |
# File 'lib/swagger_client/api/accounts_api.rb', line 692 def import_crm_account(opts = {}) data, _status_code, _headers = import_crm_account_with_http_info(opts) data end |
#import_crm_account_with_http_info(opts = {}) ⇒ Array<(CrmAccountImportResponse, Fixnum, Hash)>
Import an account from a CRM Ensures an account exists which matches the passed details.If an account exists that has a matching CRM Id, it will be updated, if not, it will be created
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 |
# File 'lib/swagger_client/api/accounts_api.rb', line 702 def import_crm_account_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.import_crm_account ...' end # resource path local_var_path = '/accounts/crm/import' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CrmAccountImportResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#import_crm_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_account(id, opts = {}) ⇒ nil
Update an account Updates an existing account with the specified parameters
743 744 745 746 |
# File 'lib/swagger_client/api/accounts_api.rb', line 743 def update_account(id, opts = {}) update_account_with_http_info(id, opts) nil end |
#update_account_contact(account_id, contact_id, opts = {}) ⇒ nil
Update a contact Updates the contact specified by the account id and contact id with the passed information
801 802 803 804 |
# File 'lib/swagger_client/api/accounts_api.rb', line 801 def update_account_contact(account_id, contact_id, opts = {}) update_account_contact_with_http_info(account_id, contact_id, opts) nil end |
#update_account_contact_with_http_info(account_id, contact_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update a contact Updates the contact specified by the account id and contact id with the passed information
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 850 851 852 853 854 855 856 |
# File 'lib/swagger_client/api/accounts_api.rb', line 815 def update_account_contact_with_http_info(account_id, contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.update_account_contact ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.update_account_contact" end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountsApi.update_account_contact" end # resource path local_var_path = '/accounts/{accountId}/contacts/{contactId}'.sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} query_params[:'skipAddressValidation'] = opts[:'skip_address_validation'] if !opts[:'skip_address_validation'].nil? query_params[:'strictValidation'] = opts[:'strict_validation'] if !opts[:'strict_validation'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#update_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_account_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update an account Updates an existing account with the specified parameters
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 781 782 783 784 785 786 787 788 789 790 791 |
# File 'lib/swagger_client/api/accounts_api.rb', line 754 def update_account_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountsApi.update_account ...' 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 AccountsApi.update_account" end # resource path local_var_path = '/accounts/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountsApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |