Class: TreezorClient::TaxResidenceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/treezor_client/api/tax_residence_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TaxResidenceApi

Returns a new instance of TaxResidenceApi.


19
20
21
# File 'lib/treezor_client/api/tax_residence_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.


17
18
19
# File 'lib/treezor_client/api/tax_residence_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#tax_residences_get(opts = {}) ⇒ InlineResponse20021

search a residence Search a residence that match search criteria

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :id (Integer)

    id of the residence

  • :user_id (Integer)

    User's id residence

Returns:


29
30
31
32
# 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 = {}) ⇒ Array<(InlineResponse20021, Fixnum, Hash)>

search a residence Search a residence that match search criteria

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :id (Integer)

    id of the residence

  • :user_id (Integer)

    User&#39;s id residence

Returns:

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

    InlineResponse20021 data, response status code and response headers


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# 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 = {}) ⇒ InlineResponse20021

delete a residence Delete a residence that match id

Parameters:

  • id

    id of the residence

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

    the optional parameters

Options Hash (opts):

Returns:


81
82
83
84
# 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 = {}) ⇒ Array<(InlineResponse20021, Fixnum, Hash)>

delete a residence Delete a residence that match id

Parameters:

  • id

    id of the residence

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

    the optional parameters

Options Hash (opts):

Returns:

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

    InlineResponse20021 data, response status code and response headers


92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# 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 = {}) ⇒ InlineResponse20021

read the informations of a residence Read the informations of a residence that match with id

Parameters:

  • id

    id of the residence

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

    the optional parameters

Options Hash (opts):

Returns:


134
135
136
137
# 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 = {}) ⇒ Array<(InlineResponse20021, Fixnum, Hash)>

read the informations of a residence Read the informations of a residence that match with id

Parameters:

  • id

    id of the residence

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

    the optional parameters

Options Hash (opts):

Returns:

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

    InlineResponse20021 data, response status code and response headers


145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# 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 = {}) ⇒ InlineResponse20021

update the residence Update a residence already created.

Parameters:

  • id

    residence id

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :user_id (Integer)

    User&#39;s id residence

  • :country (String)

    country of the resident

  • :tax_payer_id (String)

    Tax payer&#39;s id

  • :liability_waiver (BOOLEAN)

    Tax declaration

Returns:


191
192
193
194
# 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 = {}) ⇒ Array<(InlineResponse20021, Fixnum, Hash)>

update the residence Update a residence already created.

Parameters:

  • id

    residence id

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :user_id (Integer)

    User&#39;s id residence

  • :country (String)

    country of the resident

  • :tax_payer_id (String)

    Tax payer&#39;s id

  • :liability_waiver (BOOLEAN)

    Tax declaration

Returns:

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

    InlineResponse20021 data, response status code and response headers


206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# 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 = {}) ⇒ InlineResponse20021

create a residence Create a new tax residence.

Parameters:

  • user_id

    User&#39;s id residence

  • country

    country of the resident

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :tax_payer_id (String)

    Tax payer&#39;s id

  • :liability_waiver (BOOLEAN)

    When there is no taxPayerId for a residence, this field shall be set to true.

Returns:


255
256
257
258
# 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 = {}) ⇒ Array<(InlineResponse20021, Fixnum, Hash)>

create a residence Create a new tax residence.

Parameters:

  • user_id

    User&#39;s id residence

  • country

    country of the resident

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

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :tax_payer_id (String)

    Tax payer&#39;s id

  • :liability_waiver (BOOLEAN)

    When there is no taxPayerId for a residence, this field shall be set to true.

Returns:

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

    InlineResponse20021 data, response status code and response headers


269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# 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