Class: TogaiClient::AccountsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/togai_client/api/accounts_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountsApi

Returns a new instance of AccountsApi.



19
20
21
# File 'lib/togai_client/api/accounts_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/togai_client/api/accounts_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_aliases(customer_id, account_id, add_account_aliases_request, opts = {}) ⇒ Account

Add Aliases to account Add Aliases to an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • add_account_aliases_request (AddAccountAliasesRequest)

    Payload to add aliases to account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/togai_client/api/accounts_api.rb', line 29

def add_aliases(customer_id, , , opts = {})
  data, _status_code, _headers = add_aliases_with_http_info(customer_id, , , opts)
  data
end

#add_aliases_with_http_info(customer_id, account_id, add_account_aliases_request, opts = {}) ⇒ Array<(Account, Integer, Hash)>

Add Aliases to account Add Aliases to an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • add_account_aliases_request (AddAccountAliasesRequest)

    Payload to add aliases to account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Account, Integer, Hash)>)

    Account data, response status code and response headers



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
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
# File 'lib/togai_client/api/accounts_api.rb', line 41

def add_aliases_with_http_info(customer_id, , , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.add_aliases ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.add_aliases"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.add_aliases, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.add_aliases"
  end
  if @api_client.config.client_side_validation && .to_s.length > 50
    fail ArgumentError, 'invalid value for "account_id" when calling AccountsApi.add_aliases, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'add_account_aliases_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'add_account_aliases_request' when calling AccountsApi.add_aliases"
  end
  # resource path
  local_var_path = '/customers/{customer_id}/accounts/{account_id}/add_aliases'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(.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'])
  # 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] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'Account'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.add_aliases",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#add_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#associate_price_plan(customer_id, account_id, associate_price_plan_request, opts = {}) ⇒ AssociatePricePlanResponse

Associate a plan to an account Associate a plan to an account

Parameters:

  • customer_id (String)
  • account_id (String)
  • associate_price_plan_request (AssociatePricePlanRequest)

    Payload to associate a price plan to an account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



117
118
119
120
# File 'lib/togai_client/api/accounts_api.rb', line 117

def associate_price_plan(customer_id, , associate_price_plan_request, opts = {})
  data, _status_code, _headers = associate_price_plan_with_http_info(customer_id, , associate_price_plan_request, opts)
  data
end

#associate_price_plan_with_http_info(customer_id, account_id, associate_price_plan_request, opts = {}) ⇒ Array<(AssociatePricePlanResponse, Integer, Hash)>

Associate a plan to an account Associate a plan to an account

Parameters:

  • customer_id (String)
  • account_id (String)
  • associate_price_plan_request (AssociatePricePlanRequest)

    Payload to associate a price plan to an account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssociatePricePlanResponse, Integer, Hash)>)

    AssociatePricePlanResponse data, response status code and response headers



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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/togai_client/api/accounts_api.rb', line 129

def associate_price_plan_with_http_info(customer_id, , associate_price_plan_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.associate_price_plan ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.associate_price_plan"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.associate_price_plan, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.associate_price_plan"
  end
  if @api_client.config.client_side_validation && .to_s.length > 50
    fail ArgumentError, 'invalid value for "account_id" when calling AccountsApi.associate_price_plan, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'associate_price_plan_request' is set
  if @api_client.config.client_side_validation && associate_price_plan_request.nil?
    fail ArgumentError, "Missing the required parameter 'associate_price_plan_request' when calling AccountsApi.associate_price_plan"
  end
  # resource path
  local_var_path = '/customers/{customer_id}/accounts/{account_id}/price_plans'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(.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'])
  # 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] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(associate_price_plan_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AssociatePricePlanResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.associate_price_plan",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#associate_price_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_account(customer_id, create_account_request, opts = {}) ⇒ Account

Create an account Create an account

Parameters:

  • customer_id (String)
  • create_account_request (CreateAccountRequest)

    Payload to create account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



204
205
206
207
# File 'lib/togai_client/api/accounts_api.rb', line 204

def (customer_id, , opts = {})
  data, _status_code, _headers = (customer_id, , opts)
  data
end

#create_account_with_http_info(customer_id, create_account_request, opts = {}) ⇒ Array<(Account, Integer, Hash)>

Create an account Create an account

Parameters:

  • customer_id (String)
  • create_account_request (CreateAccountRequest)

    Payload to create account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Account, Integer, Hash)>)

    Account data, response status code and response headers



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
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
# File 'lib/togai_client/api/accounts_api.rb', line 215

def (customer_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.create_account ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.create_account"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.create_account, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'create_account_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'create_account_request' when calling AccountsApi.create_account"
  end
  # resource path
  local_var_path = '/customers/{customer_id}/accounts'.sub('{' + 'customer_id' + '}', CGI.escape(customer_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'])
  # 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] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'Account'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.create_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#create_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_account(customer_id, account_id, opts = {}) ⇒ BaseSuccessResponse

Delete an account Delete an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



282
283
284
285
# File 'lib/togai_client/api/accounts_api.rb', line 282

def (customer_id, , opts = {})
  data, _status_code, _headers = (customer_id, , opts)
  data
end

#delete_account_with_http_info(customer_id, account_id, opts = {}) ⇒ Array<(BaseSuccessResponse, Integer, Hash)>

Delete an account Delete an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BaseSuccessResponse, Integer, Hash)>)

    BaseSuccessResponse data, response status code and response headers



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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/togai_client/api/accounts_api.rb', line 293

def (customer_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.delete_account ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.delete_account"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.delete_account, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.delete_account"
  end
  if @api_client.config.client_side_validation && .to_s.length > 50
    fail ArgumentError, 'invalid value for "account_id" when calling AccountsApi.delete_account, the character length must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/customers/{customer_id}/accounts/{account_id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(.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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BaseSuccessResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.delete_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  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(customer_id, account_id, opts = {}) ⇒ Account

Get an account Get an account

Parameters:

  • customer_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



359
360
361
362
# File 'lib/togai_client/api/accounts_api.rb', line 359

def (customer_id, , opts = {})
  data, _status_code, _headers = (customer_id, , opts)
  data
end

#get_account_with_http_info(customer_id, account_id, opts = {}) ⇒ Array<(Account, Integer, Hash)>

Get an account Get an account

Parameters:

  • customer_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Account, Integer, Hash)>)

    Account data, response status code and response headers



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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/togai_client/api/accounts_api.rb', line 370

def (customer_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.get_account"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.get_account, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account"
  end
  if @api_client.config.client_side_validation && .to_s.length > 50
    fail ArgumentError, 'invalid value for "account_id" when calling AccountsApi.get_account, the character length must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/customers/{customer_id}/accounts/{account_id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(.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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Account'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.get_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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(customer_id, opts = {}) ⇒ AccountPaginatedResponse

List accounts of customer List accounts with pagination and sort

Parameters:

  • customer_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_token (String)
  • :page_size (String)

Returns:



437
438
439
440
# File 'lib/togai_client/api/accounts_api.rb', line 437

def get_accounts(customer_id, opts = {})
  data, _status_code, _headers = get_accounts_with_http_info(customer_id, opts)
  data
end

#get_accounts_with_http_info(customer_id, opts = {}) ⇒ Array<(AccountPaginatedResponse, Integer, Hash)>

List accounts of customer List accounts with pagination and sort

Parameters:

  • customer_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_token (String)
  • :page_size (String)

Returns:

  • (Array<(AccountPaginatedResponse, Integer, Hash)>)

    AccountPaginatedResponse data, response status code and response headers



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
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/togai_client/api/accounts_api.rb', line 449

def get_accounts_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.get_accounts"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.get_accounts, the character length must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/customers/{customer_id}/accounts'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AccountPaginatedResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.get_accounts",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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

#remove_aliases(customer_id, account_id, remove_account_aliases_request, opts = {}) ⇒ Account

Remove Aliases to account Remove Aliases to an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • remove_account_aliases_request (RemoveAccountAliasesRequest)

    Payload to remove aliases from account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



510
511
512
513
# File 'lib/togai_client/api/accounts_api.rb', line 510

def remove_aliases(customer_id, , , opts = {})
  data, _status_code, _headers = remove_aliases_with_http_info(customer_id, , , opts)
  data
end

#remove_aliases_with_http_info(customer_id, account_id, remove_account_aliases_request, opts = {}) ⇒ Array<(Account, Integer, Hash)>

Remove Aliases to account Remove Aliases to an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • remove_account_aliases_request (RemoveAccountAliasesRequest)

    Payload to remove aliases from account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Account, Integer, Hash)>)

    Account data, response status code and response headers



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
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
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/togai_client/api/accounts_api.rb', line 522

def remove_aliases_with_http_info(customer_id, , , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.remove_aliases ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.remove_aliases"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.remove_aliases, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.remove_aliases"
  end
  if @api_client.config.client_side_validation && .to_s.length > 50
    fail ArgumentError, 'invalid value for "account_id" when calling AccountsApi.remove_aliases, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'remove_account_aliases_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'remove_account_aliases_request' when calling AccountsApi.remove_aliases"
  end
  # resource path
  local_var_path = '/customers/{customer_id}/accounts/{account_id}/remove_aliases'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(.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'])
  # 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] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'Account'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.remove_aliases",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#remove_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_account(customer_id, account_id, update_account_request, opts = {}) ⇒ Account

Update an account Update an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • update_account_request (UpdateAccountRequest)

    Payload to update account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



598
599
600
601
# File 'lib/togai_client/api/accounts_api.rb', line 598

def (customer_id, , , opts = {})
  data, _status_code, _headers = (customer_id, , , opts)
  data
end

#update_account_with_http_info(customer_id, account_id, update_account_request, opts = {}) ⇒ Array<(Account, Integer, Hash)>

Update an account Update an account by id

Parameters:

  • customer_id (String)
  • account_id (String)
  • update_account_request (UpdateAccountRequest)

    Payload to update account

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Account, Integer, Hash)>)

    Account data, response status code and response headers



610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
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
# File 'lib/togai_client/api/accounts_api.rb', line 610

def (customer_id, , , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.update_account ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling AccountsApi.update_account"
  end
  if @api_client.config.client_side_validation && customer_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "customer_id" when calling AccountsApi.update_account, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.update_account"
  end
  if @api_client.config.client_side_validation && .to_s.length > 50
    fail ArgumentError, 'invalid value for "account_id" when calling AccountsApi.update_account, the character length must be smaller than or equal to 50.'
  end

  # verify the required parameter 'update_account_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'update_account_request' when calling AccountsApi.update_account"
  end
  # resource path
  local_var_path = '/customers/{customer_id}/accounts/{account_id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(.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'])
  # 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] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'Account'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AccountsApi.update_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  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