Class: Bfwd::AccountsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bf_ruby2/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/bf_ruby2/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/bf_ruby2/api/accounts_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_charge_to_account(account_id, request, opts = {}) ⇒ AddChargeToAccountResponsePagedMetadata

Create a manual invoice. a manual invoice","request":"addChargeToAccountRequest.html","response":"addChargeToAccountResponse.html"

Parameters:

  • account_id

    ID of the account.

  • request

    The charge request

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

    the optional parameters

Returns:



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

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

#add_charge_to_account_with_http_info(account_id, request, opts = {}) ⇒ Array<(AddChargeToAccountResponsePagedMetadata, Fixnum, Hash)>

Create a manual invoice. a manual invoice&quot;,&quot;request&quot;:&quot;addChargeToAccountRequest.html&quot;,&quot;response&quot;:&quot;addChargeToAccountResponse.html&quot;

Parameters:

  • account_id

    ID of the account.

  • request

    The charge request

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

    the optional parameters

Returns:



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
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/bf_ruby2/api/accounts_api.rb', line 40

def (, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.add_charge_to_account ..."
  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_charge_to_account"
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling AccountsApi.add_charge_to_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/invoice".sub('{' + '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; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  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 => 'AddChargeToAccountResponsePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#add_charge_to_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_credit_note_to_account(account_id, credit_note, opts = {}) ⇒ CreditNotePagedMetadata

Creates a credit-note which may be used by any subscription of this account. Credit","request":"addCreditNoteToAccountRequest.html", "response":"addCreditNoteToAccount.html"

Parameters:

  • account_id

    ID of the account.

  • credit_note

    The credit-note request

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

    the optional parameters

Returns:



90
91
92
93
# File 'lib/bf_ruby2/api/accounts_api.rb', line 90

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

#add_credit_note_to_account_with_http_info(account_id, credit_note, opts = {}) ⇒ Array<(CreditNotePagedMetadata, Fixnum, Hash)>

Creates a credit-note which may be used by any subscription of this account. Credit&quot;,&quot;request&quot;:&quot;addCreditNoteToAccountRequest.html&quot;, &quot;response&quot;:&quot;addCreditNoteToAccount.html&quot;

Parameters:

  • account_id

    ID of the account.

  • credit_note

    The credit-note request

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

    the optional parameters

Returns:

  • (Array<(CreditNotePagedMetadata, Fixnum, Hash)>)

    CreditNotePagedMetadata data, response status code and response headers



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
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/bf_ruby2/api/accounts_api.rb', line 101

def (, credit_note, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.add_credit_note_to_account ..."
  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_credit_note_to_account"
  end
  # verify the required parameter 'credit_note' is set
  if @api_client.config.client_side_validation && credit_note.nil?
    fail ArgumentError, "Missing the required parameter 'credit_note' when calling AccountsApi.add_credit_note_to_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/credit".sub('{' + '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; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(credit_note)
  auth_names = []
  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 => 'CreditNotePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#add_credit_note_to_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_permission_to_account(account_id, role, opts = {}) ⇒ RolePagedMetadata

Add a role to the account Role","response":"addRoleToAccountResponse.html","request":"addRoleToAccountRequest.html"

Parameters:

  • account_id

    ID of the account.

  • role

    ID or name of the role.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



152
153
154
155
# File 'lib/bf_ruby2/api/accounts_api.rb', line 152

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

#add_permission_to_account_with_http_info(account_id, role, opts = {}) ⇒ Array<(RolePagedMetadata, Fixnum, Hash)>

Add a role to the account Role&quot;,&quot;response&quot;:&quot;addRoleToAccountResponse.html&quot;,&quot;request&quot;:&quot;addRoleToAccountRequest.html&quot;

Parameters:

  • account_id

    ID of the account.

  • role

    ID or name of the role.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(RolePagedMetadata, Fixnum, Hash)>)

    RolePagedMetadata data, response status code and response headers



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
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/bf_ruby2/api/accounts_api.rb', line 164

def (, role, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.add_permission_to_account ..."
  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_permission_to_account"
  end
  # verify the required parameter 'role' is set
  if @api_client.config.client_side_validation && role.nil?
    fail ArgumentError, "Missing the required parameter 'role' when calling AccountsApi.add_permission_to_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/roles/{role}".sub('{' + 'account-ID' + '}', .to_s).sub('{' + 'role' + '}', role.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'RolePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#add_permission_to_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_account(request, opts = {}) ⇒ AccountPagedMetadata

Create an Account. a new account","response":"createAccountResponse.html","request":"createAccountRequest.html"

Parameters:

  • request

    The account object to be created.

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

    the optional parameters

Returns:



214
215
216
217
# File 'lib/bf_ruby2/api/accounts_api.rb', line 214

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

#create_account_with_http_info(request, opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Create an Account. a new account&quot;,&quot;response&quot;:&quot;createAccountResponse.html&quot;,&quot;request&quot;:&quot;createAccountRequest.html&quot;

Parameters:

  • request

    The account object to be created.

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

    the optional parameters

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



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

def (request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.create_account ..."
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling AccountsApi.create_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(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  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 => 'AccountPagedMetadata')
  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(account_id, delete_gateway_data, organizations, opts = {}) ⇒ AccountPagedMetadata

Delete the account specified by the account-ID parameter. Bfwd::AccountsApi."nickname":"Retire","response":"deleteAccount"nickname":"Retire","response":"deleteAccount.html"

Parameters:

  • account_id
  • delete_gateway_data
  • organizations

    A list of organization-IDs used to restrict the scope of API calls.

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

    the optional parameters

Returns:



271
272
273
274
# File 'lib/bf_ruby2/api/accounts_api.rb', line 271

def (, delete_gateway_data, organizations, opts = {})
  data, _status_code, _headers = (, delete_gateway_data, organizations, opts)
  return data
end

#delete_account_with_http_info(account_id, delete_gateway_data, organizations, opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Delete the account specified by the account-ID parameter. Bfwd::AccountsApi.&quot;nickname&quot;:&quot;Retire&quot;,&quot;response&quot;:&quot;deleteAccount&quot;nickname&quot;:&quot;Retire&quot;,&quot;response&quot;:&quot;deleteAccount.html&quot;

Parameters:

  • account_id
  • delete_gateway_data
  • organizations

    A list of organization-IDs used to restrict the scope of API calls.

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

    the optional parameters

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



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
330
331
# File 'lib/bf_ruby2/api/accounts_api.rb', line 283

def (, delete_gateway_data, organizations, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.delete_account ..."
  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
  # verify the required parameter 'delete_gateway_data' is set
  if @api_client.config.client_side_validation && delete_gateway_data.nil?
    fail ArgumentError, "Missing the required parameter 'delete_gateway_data' when calling AccountsApi.delete_account"
  end
  # verify the required parameter 'organizations' is set
  if @api_client.config.client_side_validation && organizations.nil?
    fail ArgumentError, "Missing the required parameter 'organizations' when calling AccountsApi.delete_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'delete_gateway_data'] = delete_gateway_data
  query_params[:'organizations'] = @api_client.build_collection_param(organizations, :multi)

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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,
    :return_type => 'AccountPagedMetadata')
  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

#delete_metadata_for_account(account_id, opts = {}) ⇒ DynamicMetadata

Remove any associated metadata. metadata from account","request" :"deleteAccountMetadataRequest.html","response":"deleteAccountMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



339
340
341
342
# File 'lib/bf_ruby2/api/accounts_api.rb', line 339

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

#delete_metadata_for_account_with_http_info(account_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Remove any associated metadata. metadata from account&quot;,&quot;request&quot; :&quot;deleteAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;deleteAccountMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata 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
# File 'lib/bf_ruby2/api/accounts_api.rb', line 350

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.delete_metadata_for_account ..."
  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_metadata_for_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/metadata".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#delete_metadata_for_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_by_id(account_id, opts = {}) ⇒ AccountPagedMetadata

Returns a single account, specified by the account-ID parameter. an existing account","response":"getAccountByID.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

Returns:



397
398
399
400
# File 'lib/bf_ruby2/api/accounts_api.rb', line 397

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

#get_account_by_id_with_http_info(account_id, opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Returns a single account, specified by the account-ID parameter. an existing account&quot;,&quot;response&quot;:&quot;getAccountByID.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# File 'lib/bf_ruby2/api/accounts_api.rb', line 408

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_account_by_id ..."
  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_by_id"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'AccountPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_account_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_by_created(lower_threshold, upper_threshold, opts = {}) ⇒ AccountPagedMetadata

Returns a collection of account objects with created times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by creation","response":"getAccountByCreated.html"

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to true)

Returns:



461
462
463
464
# File 'lib/bf_ruby2/api/accounts_api.rb', line 461

def get_accounts_by_created(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_accounts_by_created_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_accounts_by_created_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Returns a collection of account objects with created times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by creation&quot;,&quot;response&quot;:&quot;getAccountByCreated.html&quot;

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



478
479
480
481
482
483
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
522
523
524
525
526
527
# File 'lib/bf_ruby2/api/accounts_api.rb', line 478

def get_accounts_by_created_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_accounts_by_created ..."
  end
  # verify the required parameter 'lower_threshold' is set
  if @api_client.config.client_side_validation && lower_threshold.nil?
    fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling AccountsApi.get_accounts_by_created"
  end
  # verify the required parameter 'upper_threshold' is set
  if @api_client.config.client_side_validation && upper_threshold.nil?
    fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling AccountsApi.get_accounts_by_created"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/accounts/created/{lower-threshold}/{upper-threshold}".sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'AccountPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_accounts_by_created\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_by_updated(lower_threshold, upper_threshold, opts = {}) ⇒ AccountPagedMetadata

Returns a collection of account objects with updated times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by updated","response":"getAccountByUpdated.html"

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to true)

Returns:



541
542
543
544
# File 'lib/bf_ruby2/api/accounts_api.rb', line 541

def get_accounts_by_updated(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_accounts_by_updated_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_accounts_by_updated_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Returns a collection of account objects with updated times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by updated&quot;,&quot;response&quot;:&quot;getAccountByUpdated.html&quot;

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



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
600
601
602
603
604
605
606
607
# File 'lib/bf_ruby2/api/accounts_api.rb', line 558

def get_accounts_by_updated_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_accounts_by_updated ..."
  end
  # verify the required parameter 'lower_threshold' is set
  if @api_client.config.client_side_validation && lower_threshold.nil?
    fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling AccountsApi.get_accounts_by_updated"
  end
  # verify the required parameter 'upper_threshold' is set
  if @api_client.config.client_side_validation && upper_threshold.nil?
    fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling AccountsApi.get_accounts_by_updated"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/accounts/updated/{lower-threshold}/{upper-threshold}".sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'AccountPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_accounts_by_updated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_by_user_id(user_id, opts = {}) ⇒ AccountPagedMetadata

Returns a collection of accounts, specified by the user-ID parameter. By default 10 values are returned. Records are returned in natural order. by user","response":"getAccountByUserID.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first account to return. (default to 0)

  • :records (Integer)

    The maximum number of accounts to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to true)

Returns:



620
621
622
623
# File 'lib/bf_ruby2/api/accounts_api.rb', line 620

def get_accounts_by_user_id(user_id, opts = {})
  data, _status_code, _headers = get_accounts_by_user_id_with_http_info(user_id, opts)
  return data
end

#get_accounts_by_user_id_with_http_info(user_id, opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Returns a collection of accounts, specified by the user-ID parameter. By default 10 values are returned. Records are returned in natural order. by user&quot;,&quot;response&quot;:&quot;getAccountByUserID.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first account to return.

  • :records (Integer)

    The maximum number of accounts to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



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
678
679
680
681
682
683
# File 'lib/bf_ruby2/api/accounts_api.rb', line 636

def get_accounts_by_user_id_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_accounts_by_user_id ..."
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountsApi.get_accounts_by_user_id"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/accounts/user/{user-ID}".sub('{' + 'user-ID' + '}', user_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'AccountPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_accounts_by_user_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_accounts(opts = {}) ⇒ AccountPagedMetadata

Returns a collection of all account objects. By default 10 values are returned. Records are returned in natural order. all accounts","response":"getAccountAll.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    A list of account IDs used to filter the output.

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to true)

  • :users_only (BOOLEAN)

    Whether only accounts have a user should be returned. (default to false)

  • :metadata (String)

Returns:



698
699
700
701
# File 'lib/bf_ruby2/api/accounts_api.rb', line 698

def get_all_accounts(opts = {})
  data, _status_code, _headers = get_all_accounts_with_http_info(opts)
  return data
end

#get_all_accounts_with_http_info(opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Returns a collection of all account objects. By default 10 values are returned. Records are returned in natural order. all accounts&quot;,&quot;response&quot;:&quot;getAccountAll.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    A list of account IDs used to filter the output.

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :users_only (BOOLEAN)

    Whether only accounts have a user should be returned.

  • :metadata (String)

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/bf_ruby2/api/accounts_api.rb', line 716

def get_all_accounts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_all_accounts ..."
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/accounts"

  # query parameters
  query_params = {}
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].nil?
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'users_only'] = opts[:'users_only'] if !opts[:'users_only'].nil?
  query_params[:'metadata'] = opts[:'metadata'] if !opts[:'metadata'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'AccountPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_all_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_available_credit_on_account(account_id, opts = {}) ⇒ CreditNotePagedMetadata

Returns all available credit-notes for the specified account. By default 10 values are returned. Records are returned in natural order. available credit","response":"getAvailableCreditAccount.html"

Parameters:

  • account_id

    The ID of the account

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return. (default to 0)

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to id)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



773
774
775
776
# File 'lib/bf_ruby2/api/accounts_api.rb', line 773

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

#get_available_credit_on_account_with_http_info(account_id, opts = {}) ⇒ Array<(CreditNotePagedMetadata, Fixnum, Hash)>

Returns all available credit-notes for the specified account. By default 10 values are returned. Records are returned in natural order. available credit&quot;,&quot;response&quot;:&quot;getAvailableCreditAccount.html&quot;

Parameters:

  • account_id

    The ID of the account

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:

  • (Array<(CreditNotePagedMetadata, Fixnum, Hash)>)

    CreditNotePagedMetadata data, response status code and response headers



789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
# File 'lib/bf_ruby2/api/accounts_api.rb', line 789

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_available_credit_on_account ..."
  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_available_credit_on_account"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/credit".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'CreditNotePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_available_credit_on_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_metadata_for_account(account_id, opts = {}) ⇒ DynamicMetadata

Retrieve any associated metadata. metadata on account","request":"getAccountMetadataRequest.html","response":"getAccountMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



844
845
846
847
# File 'lib/bf_ruby2/api/accounts_api.rb', line 844

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

#get_metadata_for_account_with_http_info(account_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Retrieve any associated metadata. metadata on account&quot;,&quot;request&quot;:&quot;getAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;getAccountMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata data, response status code and response headers



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
# File 'lib/bf_ruby2/api/accounts_api.rb', line 855

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_metadata_for_account ..."
  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_metadata_for_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/metadata".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_metadata_for_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_permissions_on_account(account_id, opts = {}) ⇒ RolePagedMetadata

Retrieves a collection of roles, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. roles on account","response":"getRoleByAccount.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return. (default to 0)

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to id)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



907
908
909
910
# File 'lib/bf_ruby2/api/accounts_api.rb', line 907

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

#get_permissions_on_account_with_http_info(account_id, opts = {}) ⇒ Array<(RolePagedMetadata, Fixnum, Hash)>

Retrieves a collection of roles, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. roles on account&quot;,&quot;response&quot;:&quot;getRoleByAccount.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:

  • (Array<(RolePagedMetadata, Fixnum, Hash)>)

    RolePagedMetadata data, response status code and response headers



923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
# File 'lib/bf_ruby2/api/accounts_api.rb', line 923

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.get_permissions_on_account ..."
  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_permissions_on_account"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/roles".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'RolePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_permissions_on_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_credit_from_account(account_id, value, opts = {}) ⇒ CreditNotePagedMetadata

Decrease the amount of credit by the value specified or entirely if no value provided. Credit","response":"removeCreditForAccount.html"

Parameters:

  • account_id
  • value

    &lt;p&gt;Either a credit note ID or a currency value.&lt;/p&gt;&lt;p&gt;If a credit note ID is provided any remaining credit will be removed from this credit note.&lt;/p&gt;&lt;p&gt;If a currency value is provided the format should be in the form of valueCurrency, where value is the value to remove. The currency should be an ISO 4217 Currency Code. For example setting the value as 10USD will reduce the credit on this account by $10 or 9.86USD would reduce the credit by $9.86. Note: the value will be reduced from any credit notes with available balance.&lt;/p&gt;

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



979
980
981
982
# File 'lib/bf_ruby2/api/accounts_api.rb', line 979

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

#remove_credit_from_account_with_http_info(account_id, value, opts = {}) ⇒ Array<(CreditNotePagedMetadata, Fixnum, Hash)>

Decrease the amount of credit by the value specified or entirely if no value provided. Credit&quot;,&quot;response&quot;:&quot;removeCreditForAccount.html&quot;

Parameters:

  • account_id
  • value

    &lt;p&gt;Either a credit note ID or a currency value.&lt;/p&gt;&lt;p&gt;If a credit note ID is provided any remaining credit will be removed from this credit note.&lt;/p&gt;&lt;p&gt;If a currency value is provided the format should be in the form of valueCurrency, where value is the value to remove. The currency should be an ISO 4217 Currency Code. For example setting the value as 10USD will reduce the credit on this account by $10 or 9.86USD would reduce the credit by $9.86. Note: the value will be reduced from any credit notes with available balance.&lt;/p&gt;

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(CreditNotePagedMetadata, Fixnum, Hash)>)

    CreditNotePagedMetadata data, response status code and response headers



991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
# File 'lib/bf_ruby2/api/accounts_api.rb', line 991

def (, value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.remove_credit_from_account ..."
  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_credit_from_account"
  end
  # verify the required parameter 'value' is set
  if @api_client.config.client_side_validation && value.nil?
    fail ArgumentError, "Missing the required parameter 'value' when calling AccountsApi.remove_credit_from_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/credit/{value}".sub('{' + 'account-ID' + '}', .to_s).sub('{' + 'value' + '}', value.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain', 'application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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,
    :return_type => 'CreditNotePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#remove_credit_from_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_permission_from_account(account_id, role, opts = {}) ⇒ RolePagedMetadata

Revoke the specified role. Role","response":"removeRoleFromAccount.html"

Parameters:

  • account_id
  • role

    ID or name of the role.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



1043
1044
1045
1046
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1043

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

#remove_permission_from_account_with_http_info(account_id, role, opts = {}) ⇒ Array<(RolePagedMetadata, Fixnum, Hash)>

Revoke the specified role. Role&quot;,&quot;response&quot;:&quot;removeRoleFromAccount.html&quot;

Parameters:

  • account_id
  • role

    ID or name of the role.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(RolePagedMetadata, Fixnum, Hash)>)

    RolePagedMetadata data, response status code and response headers



1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1055

def (, role, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.remove_permission_from_account ..."
  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_permission_from_account"
  end
  # verify the required parameter 'role' is set
  if @api_client.config.client_side_validation && role.nil?
    fail ArgumentError, "Missing the required parameter 'role' when calling AccountsApi.remove_permission_from_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/roles/{role}".sub('{' + 'account-ID' + '}', .to_s).sub('{' + 'role' + '}', role.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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,
    :return_type => 'RolePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#remove_permission_from_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_metadata_for_account(metadata, account_id, opts = {}) ⇒ DynamicMetadata

Remove any existing metadata keys and create the provided data. metadata on account","request":"setAccountMetadataRequest.html","response":"setAccountMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



1107
1108
1109
1110
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1107

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

#set_metadata_for_account_with_http_info(metadata, account_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Remove any existing metadata keys and create the provided data. metadata on account&quot;,&quot;request&quot;:&quot;setAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;setAccountMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata data, response status code and response headers



1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1119

def (, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.set_metadata_for_account ..."
  end
  # verify the required parameter 'metadata' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'metadata' when calling AccountsApi.set_metadata_for_account"
  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.set_metadata_for_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/metadata".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body()
  auth_names = []
  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 => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#set_metadata_for_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_account(account, opts = {}) ⇒ AccountPagedMetadata

Update an Account. an account","response":"updateAccountResponse.html","request":"updateAccountRequest.html"

Parameters:

  • account

    The account object to be created.

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

    the optional parameters

Returns:



1169
1170
1171
1172
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1169

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

#update_account_with_http_info(account, opts = {}) ⇒ Array<(AccountPagedMetadata, Fixnum, Hash)>

Update an Account. an account&quot;,&quot;response&quot;:&quot;updateAccountResponse.html&quot;,&quot;request&quot;:&quot;updateAccountRequest.html&quot;

Parameters:

  • account

    The account object to be created.

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

    the optional parameters

Returns:

  • (Array<(AccountPagedMetadata, Fixnum, Hash)>)

    AccountPagedMetadata data, response status code and response headers



1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1179

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.update_account ..."
  end
  # verify the required parameter 'account' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account' when calling AccountsApi.update_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(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body()
  auth_names = []
  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,
    :return_type => 'AccountPagedMetadata')
  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

#upsert_metadata_for_account(metadata, account_id, opts = {}) ⇒ DynamicMetadata

Update any existing metadata key-values and insert any new key-values, no keys will be removed. metadata on account","request":"upsertAccountMetadataRequest.html","response":"upsertAccountMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



1226
1227
1228
1229
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1226

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

#upsert_metadata_for_account_with_http_info(metadata, account_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Update any existing metadata key-values and insert any new key-values, no keys will be removed. metadata on account&quot;,&quot;request&quot;:&quot;upsertAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;upsertAccountMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata data, response status code and response headers



1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# File 'lib/bf_ruby2/api/accounts_api.rb', line 1238

def (, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AccountsApi.upsert_metadata_for_account ..."
  end
  # verify the required parameter 'metadata' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'metadata' when calling AccountsApi.upsert_metadata_for_account"
  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.upsert_metadata_for_account"
  end
  # resource path
  local_var_path = "/accounts/{account-ID}/metadata".sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body()
  auth_names = []
  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,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#upsert_metadata_for_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end