class TreezorClient::TaxResidenceApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

tax_residences_get(opts = {}) click to toggle source

search a residence Search a residence that match search criteria @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [Integer] :id id of the residence @option opts [Integer] :user_id User's id residence @return [InlineResponse20021]

# File lib/treezor_client/api/tax_residence_api.rb, line 29
def tax_residences_get(opts = {})
  data, _status_code, _headers = tax_residences_get_with_http_info(opts)
  data
end
tax_residences_get_with_http_info(opts = {}) click to toggle source

search a residence Search a residence that match search criteria @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [Integer] :id id of the residence @option opts [Integer] :user_id User&#39;s id residence @return [Array<(InlineResponse20021, Fixnum, Hash)>] InlineResponse20021 data, response status code and response headers

# File lib/treezor_client/api/tax_residence_api.rb, line 41
def tax_residences_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaxResidenceApi.tax_residences_get ...'
  end
  # resource path
  local_var_path = '/taxResidences'

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20021')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TaxResidenceApi#tax_residences_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
tax_residences_id_delete(id, opts = {}) click to toggle source

delete a residence Delete a residence that match id @param id id of the residence @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @return [InlineResponse20021]

# File lib/treezor_client/api/tax_residence_api.rb, line 81
def tax_residences_id_delete(id, opts = {})
  data, _status_code, _headers = tax_residences_id_delete_with_http_info(id, opts)
  data
end
tax_residences_id_delete_with_http_info(id, opts = {}) click to toggle source

delete a residence Delete a residence that match id @param id id of the residence @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @return [Array<(InlineResponse20021, Fixnum, Hash)>] InlineResponse20021 data, response status code and response headers

# File lib/treezor_client/api/tax_residence_api.rb, line 92
def tax_residences_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaxResidenceApi.tax_residences_id_delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TaxResidenceApi.tax_residences_id_delete"
  end
  # resource path
  local_var_path = '/taxResidences/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20021')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TaxResidenceApi#tax_residences_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
tax_residences_id_get(id, opts = {}) click to toggle source

read the informations of a residence Read the informations of a residence that match with id @param id id of the residence @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @return [InlineResponse20021]

# File lib/treezor_client/api/tax_residence_api.rb, line 134
def tax_residences_id_get(id, opts = {})
  data, _status_code, _headers = tax_residences_id_get_with_http_info(id, opts)
  data
end
tax_residences_id_get_with_http_info(id, opts = {}) click to toggle source

read the informations of a residence Read the informations of a residence that match with id @param id id of the residence @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @return [Array<(InlineResponse20021, Fixnum, Hash)>] InlineResponse20021 data, response status code and response headers

# File lib/treezor_client/api/tax_residence_api.rb, line 145
def tax_residences_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaxResidenceApi.tax_residences_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TaxResidenceApi.tax_residences_id_get"
  end
  # resource path
  local_var_path = '/taxResidences/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20021')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TaxResidenceApi#tax_residences_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
tax_residences_id_put(id, opts = {}) click to toggle source

update the residence Update a residence already created. @param id residence id @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [Integer] :user_id User&#39;s id residence @option opts [String] :country country of the resident @option opts [String] :tax_payer_id Tax payer&#39;s id @option opts [BOOLEAN] :liability_waiver Tax declaration @return [InlineResponse20021]

# File lib/treezor_client/api/tax_residence_api.rb, line 191
def tax_residences_id_put(id, opts = {})
  data, _status_code, _headers = tax_residences_id_put_with_http_info(id, opts)
  data
end
tax_residences_id_put_with_http_info(id, opts = {}) click to toggle source

update the residence Update a residence already created. @param id residence id @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [Integer] :user_id User&#39;s id residence @option opts [String] :country country of the resident @option opts [String] :tax_payer_id Tax payer&#39;s id @option opts [BOOLEAN] :liability_waiver Tax declaration @return [Array<(InlineResponse20021, Fixnum, Hash)>] InlineResponse20021 data, response status code and response headers

# File lib/treezor_client/api/tax_residence_api.rb, line 206
def tax_residences_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaxResidenceApi.tax_residences_id_put ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TaxResidenceApi.tax_residences_id_put"
  end
  # resource path
  local_var_path = '/taxResidences/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'taxPayerId'] = opts[:'tax_payer_id'] if !opts[:'tax_payer_id'].nil?
  query_params[:'liabilityWaiver'] = opts[:'liability_waiver'] if !opts[:'liability_waiver'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20021')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TaxResidenceApi#tax_residences_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
tax_residences_post(user_id, country, opts = {}) click to toggle source

create a residence Create a new tax residence. @param user_id User&#39;s id residence @param country country of the resident @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [String] :tax_payer_id Tax payer&#39;s id @option opts [BOOLEAN] :liability_waiver When there is no taxPayerId for a residence, this field shall be set to true. @return [InlineResponse20021]

# File lib/treezor_client/api/tax_residence_api.rb, line 255
def tax_residences_post(user_id, country, opts = {})
  data, _status_code, _headers = tax_residences_post_with_http_info(user_id, country, opts)
  data
end
tax_residences_post_with_http_info(user_id, country, opts = {}) click to toggle source

create a residence Create a new tax residence. @param user_id User&#39;s id residence @param country country of the resident @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [String] :tax_payer_id Tax payer&#39;s id @option opts [BOOLEAN] :liability_waiver When there is no taxPayerId for a residence, this field shall be set to true. @return [Array<(InlineResponse20021, Fixnum, Hash)>] InlineResponse20021 data, response status code and response headers

# File lib/treezor_client/api/tax_residence_api.rb, line 269
def tax_residences_post_with_http_info(user_id, country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaxResidenceApi.tax_residences_post ...'
  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 TaxResidenceApi.tax_residences_post"
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling TaxResidenceApi.tax_residences_post"
  end
  # resource path
  local_var_path = '/taxResidences'

  # query parameters
  query_params = {}
  query_params[:'userId'] = user_id
  query_params[:'country'] = country
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'taxPayerId'] = opts[:'tax_payer_id'] if !opts[:'tax_payer_id'].nil?
  query_params[:'liabilityWaiver'] = opts[:'liability_waiver'] if !opts[:'liability_waiver'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

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