=begin #Treezor #Treezor API. more info [here](https://www.treezor.com). OpenAPI spec version: 0.1.1 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.1 =end require 'uri' module TreezorClient class TaxResidenceApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # 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](https://agent.treezor.com/security-authentication). # @option opts [Integer] :id id of the residence # @option opts [Integer] :user_id User's id residence # @return [InlineResponse20028] def tax_residences_get(opts = {}) data, _status_code, _headers = tax_residences_get_with_http_info(opts) data end # 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](https://agent.treezor.com/security-authentication). # @option opts [Integer] :id id of the residence # @option opts [Integer] :user_id User's id residence # @return [Array<(InlineResponse20028, Fixnum, Hash)>] InlineResponse20028 data, response status code and response headers 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 => 'InlineResponse20028') 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 # 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](https://agent.treezor.com/security-authentication). # @return [InlineResponse20028] def tax_residences_id_delete(id, opts = {}) data, _status_code, _headers = tax_residences_id_delete_with_http_info(id, opts) data end # 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](https://agent.treezor.com/security-authentication). # @return [Array<(InlineResponse20028, Fixnum, Hash)>] InlineResponse20028 data, response status code and response headers 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 => 'InlineResponse20028') 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 # 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](https://agent.treezor.com/security-authentication). # @return [InlineResponse20028] def tax_residences_id_get(id, opts = {}) data, _status_code, _headers = tax_residences_id_get_with_http_info(id, opts) data end # 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](https://agent.treezor.com/security-authentication). # @return [Array<(InlineResponse20028, Fixnum, Hash)>] InlineResponse20028 data, response status code and response headers 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 => 'InlineResponse20028') 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 # 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](https://agent.treezor.com/security-authentication). # @option opts [Integer] :user_id User's id residence # @option opts [String] :country country of the resident # @option opts [String] :tax_payer_id Tax payer's id # @option opts [BOOLEAN] :liability_waiver Tax declaration # @return [InlineResponse20028] def tax_residences_id_put(id, opts = {}) data, _status_code, _headers = tax_residences_id_put_with_http_info(id, opts) data end # 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](https://agent.treezor.com/security-authentication). # @option opts [Integer] :user_id User's id residence # @option opts [String] :country country of the resident # @option opts [String] :tax_payer_id Tax payer's id # @option opts [BOOLEAN] :liability_waiver Tax declaration # @return [Array<(InlineResponse20028, Fixnum, Hash)>] InlineResponse20028 data, response status code and response headers 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 => 'InlineResponse20028') 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 # create a residence # Create a new tax residence. # @param user_id User'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](https://agent.treezor.com/security-authentication). # @option opts [String] :tax_payer_id Tax payer's id # @option opts [BOOLEAN] :liability_waiver When there is no taxPayerId for a residence, this field shall be set to true. # @return [InlineResponse20028] def tax_residences_post(user_id, country, opts = {}) data, _status_code, _headers = tax_residences_post_with_http_info(user_id, country, opts) data end # create a residence # Create a new tax residence. # @param user_id User'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](https://agent.treezor.com/security-authentication). # @option opts [String] :tax_payer_id Tax payer's id # @option opts [BOOLEAN] :liability_waiver When there is no taxPayerId for a residence, this field shall be set to true. # @return [Array<(InlineResponse20028, Fixnum, Hash)>] InlineResponse20028 data, response status code and response headers 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 => 'InlineResponse20028') 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 end end