class Bfwd::AccountsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/bf_ruby2/api/accounts_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

add_charge_to_account(account_id, request, opts = {}) click to toggle source

Create a manual invoice. {"nickname":"Create a manual invoice","request":"addChargeToAccountRequest.html","response":"addChargeToAccountResponse.html"} @param account_id ID of the account. @param request The charge request @param [Hash] opts the optional parameters @return [AddChargeToAccountResponsePagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 29
def add_charge_to_account(account_id, request, opts = {})
  data, _status_code, _headers = add_charge_to_account_with_http_info(account_id, request, opts)
  return data
end
add_charge_to_account_with_http_info(account_id, request, opts = {}) click to toggle source

Create a manual invoice. {&quot;nickname&quot;:&quot;Create a manual invoice&quot;,&quot;request&quot;:&quot;addChargeToAccountRequest.html&quot;,&quot;response&quot;:&quot;addChargeToAccountResponse.html&quot;} @param account_id ID of the account. @param request The charge request @param [Hash] opts the optional parameters @return [Array<(AddChargeToAccountResponsePagedMetadata, Fixnum, Hash)>] AddChargeToAccountResponsePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 40
def add_charge_to_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Creates a credit-note which may be used by any subscription of this account. {"nickname":"Add Credit","request":"addCreditNoteToAccountRequest.html", "response":"addCreditNoteToAccount.html"} @param account_id ID of the account. @param credit_note The credit-note request @param [Hash] opts the optional parameters @return [CreditNotePagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 90
def add_credit_note_to_account(account_id, credit_note, opts = {})
  data, _status_code, _headers = add_credit_note_to_account_with_http_info(account_id, credit_note, opts)
  return data
end
add_credit_note_to_account_with_http_info(account_id, credit_note, opts = {}) click to toggle source

Creates a credit-note which may be used by any subscription of this account. {&quot;nickname&quot;:&quot;Add Credit&quot;,&quot;request&quot;:&quot;addCreditNoteToAccountRequest.html&quot;, "response&quot;:&quot;addCreditNoteToAccount.html&quot;} @param account_id ID of the account. @param credit_note The credit-note request @param [Hash] opts the optional parameters @return [Array<(CreditNotePagedMetadata, Fixnum, Hash)>] CreditNotePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 101
def add_credit_note_to_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Add a role to the account {"nickname":"Add Role","response":"addRoleToAccountResponse.html","request":"addRoleToAccountRequest.html"} @param account_id ID of the account. @param role ID or name of the role. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [RolePagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 152
def add_permission_to_account(account_id, role, opts = {})
  data, _status_code, _headers = add_permission_to_account_with_http_info(account_id, role, opts)
  return data
end
add_permission_to_account_with_http_info(account_id, role, opts = {}) click to toggle source

Add a role to the account {&quot;nickname&quot;:&quot;Add Role&quot;,&quot;response&quot;:&quot;addRoleToAccountResponse.html&quot;,&quot;request&quot;:&quot;addRoleToAccountRequest.html&quot;} @param account_id ID of the account. @param role ID or name of the role. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(RolePagedMetadata, Fixnum, Hash)>] RolePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 164
def add_permission_to_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Create an Account. {"nickname":"Create a new account","response":"createAccountResponse.html","request":"createAccountRequest.html"} @param request The account object to be created. @param [Hash] opts the optional parameters @return [AccountPagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 214
def create_account(request, opts = {})
  data, _status_code, _headers = create_account_with_http_info(request, opts)
  return data
end
create_account_with_http_info(request, opts = {}) click to toggle source

Create an Account. {&quot;nickname&quot;:&quot;Create a new account&quot;,&quot;response&quot;:&quot;createAccountResponse.html&quot;,&quot;request&quot;:&quot;createAccountRequest.html&quot;} @param request The account object to be created. @param [Hash] opts the optional parameters @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 224
def create_account_with_http_info(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 = {}) click to toggle source

Delete the account specified by the account-ID parameter. {"nickname":"Retire","response":"deleteAccount.html"} @param account_id @param delete_gateway_data @param organizations A list of organization-IDs used to restrict the scope of API calls. @param [Hash] opts the optional parameters @return [AccountPagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 271
def delete_account(account_id, delete_gateway_data, organizations, opts = {})
  data, _status_code, _headers = delete_account_with_http_info(account_id, delete_gateway_data, organizations, opts)
  return data
end
delete_account_with_http_info(account_id, delete_gateway_data, organizations, opts = {}) click to toggle source

Delete the account specified by the account-ID parameter. {&quot;nickname&quot;:&quot;Retire&quot;,&quot;response&quot;:&quot;deleteAccount.html&quot;} @param account_id @param delete_gateway_data @param organizations A list of organization-IDs used to restrict the scope of API calls. @param [Hash] opts the optional parameters @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 283
def delete_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Remove any associated metadata. {"nickname":"Clear metadata from account","request" :"deleteAccountMetadataRequest.html","response":"deleteAccountMetadataResponse.html"} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [DynamicMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 339
def delete_metadata_for_account(account_id, opts = {})
  data, _status_code, _headers = delete_metadata_for_account_with_http_info(account_id, opts)
  return data
end
delete_metadata_for_account_with_http_info(account_id, opts = {}) click to toggle source

Remove any associated metadata. {&quot;nickname&quot;:&quot;Clear metadata from account&quot;,&quot;request&quot; :&quot;deleteAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;deleteAccountMetadataResponse.html&quot;} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 350
def delete_metadata_for_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Returns a single account, specified by the account-ID parameter. {"nickname":"Retrieve an existing account","response":"getAccountByID.html"} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations @return [AccountPagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 397
def get_account_by_id(account_id, opts = {})
  data, _status_code, _headers = get_account_by_id_with_http_info(account_id, opts)
  return data
end
get_account_by_id_with_http_info(account_id, opts = {}) click to toggle source

Returns a single account, specified by the account-ID parameter. {&quot;nickname&quot;:&quot;Retrieve an existing account&quot;,&quot;response&quot;:&quot;getAccountByID.html&quot;} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 408
def get_account_by_id_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

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. {"nickname":"Retrieve by creation","response":"getAccountByCreated.html"} @param lower_threshold The UTC DateTime specifying the start of the result period. @param upper_threshold The UTC DateTime specifying the end of the result period. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0) @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired products should be returned. (default to true) @return [AccountPagedMetadata]

# 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 = {}) click to toggle source

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. {&quot;nickname&quot;:&quot;Retrieve by creation&quot;,&quot;response&quot;:&quot;getAccountByCreated.html&quot;} @param lower_threshold The UTC DateTime specifying the start of the result period. @param upper_threshold The UTC DateTime specifying the end of the result period. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. @option opts [Integer] :records The maximum number of taxation-links to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired products should be returned. @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# 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 = {}) click to toggle source

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. {"nickname":"Retrieve by updated","response":"getAccountByUpdated.html"} @param lower_threshold The UTC DateTime specifying the start of the result period. @param upper_threshold The UTC DateTime specifying the end of the result period. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0) @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired products should be returned. (default to true) @return [AccountPagedMetadata]

# 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 = {}) click to toggle source

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. {&quot;nickname&quot;:&quot;Retrieve by updated&quot;,&quot;response&quot;:&quot;getAccountByUpdated.html&quot;} @param lower_threshold The UTC DateTime specifying the start of the result period. @param upper_threshold The UTC DateTime specifying the end of the result period. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. @option opts [Integer] :records The maximum number of taxation-links to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired products should be returned. @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# 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 = {}) click to toggle source

Returns a collection of accounts, specified by the user-ID parameter. By default 10 values are returned. Records are returned in natural order. {"nickname":"Retrieve by user","response":"getAccountByUserID.html"} @param user_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first account to return. (default to 0) @option opts [Integer] :records The maximum number of accounts to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired products should be returned. (default to true) @return [AccountPagedMetadata]

# 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 = {}) click to toggle source

Returns a collection of accounts, specified by the user-ID parameter. By default 10 values are returned. Records are returned in natural order. {&quot;nickname&quot;:&quot;Retrieve by user&quot;,&quot;response&quot;:&quot;getAccountByUserID.html&quot;} @param user_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first account to return. @option opts [Integer] :records The maximum number of accounts to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired products should be returned. @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# 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 = {}) click to toggle source

Returns a collection of all account objects. By default 10 values are returned. Records are returned in natural order. {"nickname":"Get all accounts","response":"getAccountAll.html"} @param [Hash] opts the optional parameters @option opts [Array<String>] :id A list of account IDs used to filter the output. @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0) @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired products should be returned. (default to true) @option opts [BOOLEAN] :users_only Whether only accounts have a user should be returned. (default to false) @option opts [String] :metadata @return [AccountPagedMetadata]

# 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 = {}) click to toggle source

Returns a collection of all account objects. By default 10 values are returned. Records are returned in natural order. {&quot;nickname&quot;:&quot;Get all accounts&quot;,&quot;response&quot;:&quot;getAccountAll.html&quot;} @param [Hash] opts the optional parameters @option opts [Array<String>] :id A list of account IDs used to filter the output. @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. @option opts [Integer] :records The maximum number of taxation-links to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired products should be returned. @option opts [BOOLEAN] :users_only Whether only accounts have a user should be returned. @option opts [String] :metadata @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# 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 = {}) click to toggle source

Returns all available credit-notes for the specified account. By default 10 values are returned. Records are returned in natural order. {"nickname":"Get available credit","response":"getAvailableCreditAccount.html"} @param account_id The ID of the account @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. (default to 0) @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to id) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false) @return [CreditNotePagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 773
def get_available_credit_on_account(account_id, opts = {})
  data, _status_code, _headers = get_available_credit_on_account_with_http_info(account_id, opts)
  return data
end
get_available_credit_on_account_with_http_info(account_id, opts = {}) click to toggle source

Returns all available credit-notes for the specified account. By default 10 values are returned. Records are returned in natural order. {&quot;nickname&quot;:&quot;Get available credit&quot;,&quot;response&quot;:&quot;getAvailableCreditAccount.html&quot;} @param account_id The ID of the account @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. @option opts [Integer] :records The maximum number of subscriptions to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. @return [Array<(CreditNotePagedMetadata, Fixnum, Hash)>] CreditNotePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 789
def get_available_credit_on_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Retrieve any associated metadata. {"nickname":"Retrieve metadata on account","request":"getAccountMetadataRequest.html","response":"getAccountMetadataResponse.html"} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [DynamicMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 844
def get_metadata_for_account(account_id, opts = {})
  data, _status_code, _headers = get_metadata_for_account_with_http_info(account_id, opts)
  return data
end
get_metadata_for_account_with_http_info(account_id, opts = {}) click to toggle source

Retrieve any associated metadata. {&quot;nickname&quot;:&quot;Retrieve metadata on account&quot;,&quot;request&quot;:&quot;getAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;getAccountMetadataResponse.html&quot;} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 855
def get_metadata_for_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Retrieves a collection of roles, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. {"nickname":"List roles on account","response":"getRoleByAccount.html"} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. (default to 0) @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to id) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false) @return [RolePagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 907
def get_permissions_on_account(account_id, opts = {})
  data, _status_code, _headers = get_permissions_on_account_with_http_info(account_id, opts)
  return data
end
get_permissions_on_account_with_http_info(account_id, opts = {}) click to toggle source

Retrieves a collection of roles, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. {&quot;nickname&quot;:&quot;List roles on account&quot;,&quot;response&quot;:&quot;getRoleByAccount.html&quot;} @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first subscription to return. @option opts [Integer] :records The maximum number of subscriptions to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. @return [Array<(RolePagedMetadata, Fixnum, Hash)>] RolePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 923
def get_permissions_on_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Decrease the amount of credit by the value specified or entirely if no value provided. {"nickname":"Remove Credit","response":"removeCreditForAccount.html"} @param account_id @param 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; @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [CreditNotePagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 979
def remove_credit_from_account(account_id, value, opts = {})
  data, _status_code, _headers = remove_credit_from_account_with_http_info(account_id, value, opts)
  return data
end
remove_credit_from_account_with_http_info(account_id, value, opts = {}) click to toggle source

Decrease the amount of credit by the value specified or entirely if no value provided. {&quot;nickname&quot;:&quot;Remove Credit&quot;,&quot;response&quot;:&quot;removeCreditForAccount.html&quot;} @param account_id @param 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; @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(CreditNotePagedMetadata, Fixnum, Hash)>] CreditNotePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 991
def remove_credit_from_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Revoke the specified role. {"nickname":"Remove Role","response":"removeRoleFromAccount.html"} @param account_id @param role ID or name of the role. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [RolePagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 1043
def remove_permission_from_account(account_id, role, opts = {})
  data, _status_code, _headers = remove_permission_from_account_with_http_info(account_id, role, opts)
  return data
end
remove_permission_from_account_with_http_info(account_id, role, opts = {}) click to toggle source

Revoke the specified role. {&quot;nickname&quot;:&quot;Remove Role&quot;,&quot;response&quot;:&quot;removeRoleFromAccount.html&quot;} @param account_id @param role ID or name of the role. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(RolePagedMetadata, Fixnum, Hash)>] RolePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 1055
def remove_permission_from_account_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

Remove any existing metadata keys and create the provided data. {"nickname":"Set metadata on account","request":"setAccountMetadataRequest.html","response":"setAccountMetadataResponse.html"} @param metadata @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [DynamicMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 1107
def set_metadata_for_account(metadata, account_id, opts = {})
  data, _status_code, _headers = set_metadata_for_account_with_http_info(metadata, account_id, opts)
  return data
end
set_metadata_for_account_with_http_info(metadata, account_id, opts = {}) click to toggle source

Remove any existing metadata keys and create the provided data. {&quot;nickname&quot;:&quot;Set metadata on account&quot;,&quot;request&quot;:&quot;setAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;setAccountMetadataResponse.html&quot;} @param metadata @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 1119
def set_metadata_for_account_with_http_info(metadata, account_id, 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 && metadata.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 && account_id.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' + '}', 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(metadata)
  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 = {}) click to toggle source

Update an Account. {"nickname":"Update an account","response":"updateAccountResponse.html","request":"updateAccountRequest.html"} @param account The account object to be created. @param [Hash] opts the optional parameters @return [AccountPagedMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 1169
def update_account(account, opts = {})
  data, _status_code, _headers = update_account_with_http_info(account, opts)
  return data
end
update_account_with_http_info(account, opts = {}) click to toggle source

Update an Account. {&quot;nickname&quot;:&quot;Update an account&quot;,&quot;response&quot;:&quot;updateAccountResponse.html&quot;,&quot;request&quot;:&quot;updateAccountRequest.html&quot;} @param account The account object to be created. @param [Hash] opts the optional parameters @return [Array<(AccountPagedMetadata, Fixnum, Hash)>] AccountPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 1179
def update_account_with_http_info(account, 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 && account.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(account)
  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 = {}) click to toggle source

Update any existing metadata key-values and insert any new key-values, no keys will be removed. {"nickname":"Upsert metadata on account","request":"upsertAccountMetadataRequest.html","response":"upsertAccountMetadataResponse.html"} @param metadata @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [DynamicMetadata]

# File lib/bf_ruby2/api/accounts_api.rb, line 1226
def upsert_metadata_for_account(metadata, account_id, opts = {})
  data, _status_code, _headers = upsert_metadata_for_account_with_http_info(metadata, account_id, opts)
  return data
end
upsert_metadata_for_account_with_http_info(metadata, account_id, opts = {}) click to toggle source

Update any existing metadata key-values and insert any new key-values, no keys will be removed. {&quot;nickname&quot;:&quot;Upsert metadata on account&quot;,&quot;request&quot;:&quot;upsertAccountMetadataRequest.html&quot;,&quot;response&quot;:&quot;upsertAccountMetadataResponse.html&quot;} @param metadata @param account_id @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers

# File lib/bf_ruby2/api/accounts_api.rb, line 1238
def upsert_metadata_for_account_with_http_info(metadata, account_id, 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 && metadata.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 && account_id.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' + '}', 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(metadata)
  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