Class: TreezorClient::MandateApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MandateApi



19
20
21
# File 'lib/treezor_client/api/mandate_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/mandate_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_mandate(id, origin, opts = {}) ⇒ InlineResponse20014

revoke a mandate Change mandate’s status to canceled.



28
29
30
31
# File 'lib/treezor_client/api/mandate_api.rb', line 28

def delete_mandate(id, origin, opts = {})
  data, _status_code, _headers = delete_mandate_with_http_info(id, origin, opts)
  data
end

#delete_mandate_with_http_info(id, origin, opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>

revoke a mandate Change mandate&#39;s status to canceled.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/treezor_client/api/mandate_api.rb', line 39

def delete_mandate_with_http_info(id, origin, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MandateApi.delete_mandate ...'
  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 MandateApi.delete_mandate"
  end
  # verify the required parameter 'origin' is set
  if @api_client.config.client_side_validation && origin.nil?
    fail ArgumentError, "Missing the required parameter 'origin' when calling MandateApi.delete_mandate"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['CREDITOR', 'DEBITOR'].include?(origin)
    fail ArgumentError, "invalid value for 'origin', must be one of CREDITOR, DEBITOR"
  end
  # resource path
  local_var_path = '/mandates/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'origin'] = origin

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

  # 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 => 'InlineResponse20014')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MandateApi#delete_mandate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_mandate(id, opts = {}) ⇒ InlineResponse20014

get mandate Get a mandate from the system.



92
93
94
95
# File 'lib/treezor_client/api/mandate_api.rb', line 92

def get_mandate(id, opts = {})
  data, _status_code, _headers = get_mandate_with_http_info(id, opts)
  data
end

#get_mandate_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>

get mandate Get a mandate from the system.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/treezor_client/api/mandate_api.rb', line 102

def get_mandate_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MandateApi.get_mandate ...'
  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 MandateApi.get_mandate"
  end
  # resource path
  local_var_path = '/mandates/{id}'.sub('{' + 'id' + '}', 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # 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 => 'InlineResponse20014')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MandateApi#get_mandate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_mandates(opts = {}) ⇒ InlineResponse20014

search mandates Get mandates that match search criteria.

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).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :mandate_id (Integer)

    Mandate&#39;s Id

  • :user_id (Integer)

    User&#39;s id who initiates the mandate request.

  • :unique_mandate_reference (String)

    Unique Mandate Reference (UMR) of the searched mandate. It is a sequence of characters that ensures the mandate traceability. UMR coupled with SCI allows to uniquely identify a creditor and a contract for any mandate. It is provided at the mandate creation.

  • :mandate_status (String)

    Mandate&#39;s status. Possible values: * CANCELED * PENDING * VALIDATED

  • :filter (String)

    You can filter the API response by using filter(s). Filters should be separated by a &quot;;&quot;. Example for 3 filters : FILTER1;FILTER2;FILTER3. A single filter has the following syntax : &quot;fieldName criterion expression&quot;. Where : - fieldName : the name of a filterable field of this object. - expression : the values to be included or excluded (see the table below for more information) - criterion : a filter criterion. Here are the possible values for criterion : | Criteria | Description | Type | Expression Example | |———-|————————|——————————————|——————–| | &gt; | greater than | alphanumeric string | 100 | | &gt;&#x3D; | greater or equal than | alphanumeric string | 100 | | &lt; | less than | alphanumeric string | 100 | | &lt;&#x3D; | less or equal than | alphanumeric string | 100 | | !&#x3D; | not equal to | alphanumeric string | 100 | | like | like | alphanumeric string | 100 | | in | in | alphanumeric strings separated by commas | 100,30,25 | | &#x3D;&#x3D; | equals | alphanumeric string | 100 |



154
155
156
157
# File 'lib/treezor_client/api/mandate_api.rb', line 154

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

#get_mandates_with_http_info(opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>

search mandates Get mandates that match search criteria.

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).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :mandate_id (Integer)

    Mandate&#39;s Id

  • :user_id (Integer)

    User&#39;s id who initiates the mandate request.

  • :unique_mandate_reference (String)

    Unique Mandate Reference (UMR) of the searched mandate. It is a sequence of characters that ensures the mandate traceability. UMR coupled with SCI allows to uniquely identify a creditor and a contract for any mandate. It is provided at the mandate creation.

  • :mandate_status (String)

    Mandate&#39;s status. Possible values: * CANCELED * PENDING * VALIDATED

  • :filter (String)

    You can filter the API response by using filter(s). Filters should be separated by a &quot;;&quot;. Example for 3 filters : FILTER1;FILTER2;FILTER3. A single filter has the following syntax : &quot;fieldName criterion expression&quot;. Where : - fieldName : the name of a filterable field of this object. - expression : the values to be included or excluded (see the table below for more information) - criterion : a filter criterion. Here are the possible values for criterion : | Criteria | Description | Type | Expression Example | |———-|————————|——————————————|——————–| | &gt; | greater than | alphanumeric string | 100 | | &gt;&#x3D; | greater or equal than | alphanumeric string | 100 | | &lt; | less than | alphanumeric string | 100 | | &lt;&#x3D; | less or equal than | alphanumeric string | 100 | | !&#x3D; | not equal to | alphanumeric string | 100 | | like | like | alphanumeric string | 100 | | in | in | alphanumeric strings separated by commas | 100,30,25 | | &#x3D;&#x3D; | equals | alphanumeric string | 100 |



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/treezor_client/api/mandate_api.rb', line 172

def get_mandates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MandateApi.get_mandates ...'
  end
  # resource path
  local_var_path = '/mandates'

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'mandateId'] = opts[:'mandate_id'] if !opts[:'mandate_id'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'uniqueMandateReference'] = opts[:'unique_mandate_reference'] if !opts[:'unique_mandate_reference'].nil?
  query_params[:'mandateStatus'] = opts[:'mandate_status'] if !opts[:'mandate_status'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

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

  # 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 => 'InlineResponse20014')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MandateApi#get_mandates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mandates_id_resend_otp_put(id, access_token, access_signature, user_id, opts = {}) ⇒ InlineResponse20014

send an OTP Send an OTP to sign a specific mandate. The OTP will be sent to the user’s mobile phone OR to a specific mobile phone number in the request.

Options Hash (opts):

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :debtor_mobile (String)

    Debtor&#39;s mobile phone number. Used to send the OTP for signature



228
229
230
231
# File 'lib/treezor_client/api/mandate_api.rb', line 228

def mandates_id_resend_otp_put(id, access_token, access_signature, user_id, opts = {})
  data, _status_code, _headers = mandates_id_resend_otp_put_with_http_info(id, access_token, access_signature, user_id, opts)
  data
end

#mandates_id_resend_otp_put_with_http_info(id, access_token, access_signature, user_id, opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>

send an OTP Send an OTP to sign a specific mandate. The OTP will be sent to the user&#39;s mobile phone OR to a specific mobile phone number in the request.

Options Hash (opts):

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :debtor_mobile (String)

    Debtor&#39;s mobile phone number. Used to send the OTP for signature



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
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
# File 'lib/treezor_client/api/mandate_api.rb', line 245

def mandates_id_resend_otp_put_with_http_info(id, access_token, access_signature, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MandateApi.mandates_id_resend_otp_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 MandateApi.mandates_id_resend_otp_put"
  end
  # verify the required parameter 'access_token' is set
  if @api_client.config.client_side_validation && access_token.nil?
    fail ArgumentError, "Missing the required parameter 'access_token' when calling MandateApi.mandates_id_resend_otp_put"
  end
  # verify the required parameter 'access_signature' is set
  if @api_client.config.client_side_validation && access_signature.nil?
    fail ArgumentError, "Missing the required parameter 'access_signature' when calling MandateApi.mandates_id_resend_otp_put"
  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 MandateApi.mandates_id_resend_otp_put"
  end
  # resource path
  local_var_path = '/mandates/{id}/ResendOtp/'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'accessToken'] = access_token
  query_params[:'accessSignature'] = access_signature
  query_params[:'userId'] = user_id
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'debtorMobile'] = opts[:'debtor_mobile'] if !opts[:'debtor_mobile'].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 => 'InlineResponse20014')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MandateApi#mandates_id_resend_otp_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mandates_id_sign_put(id, access_token, access_signature, user_id, otp, opts = {}) ⇒ InlineResponse20014

sign a mandate Sign a mandate with the received OTP.

Options Hash (opts):

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :debtor_signature_ip (String)

    IP address from which the mandate will be signed.



312
313
314
315
# File 'lib/treezor_client/api/mandate_api.rb', line 312

def mandates_id_sign_put(id, access_token, access_signature, user_id, otp, opts = {})
  data, _status_code, _headers = mandates_id_sign_put_with_http_info(id, access_token, access_signature, user_id, otp, opts)
  data
end

#mandates_id_sign_put_with_http_info(id, access_token, access_signature, user_id, otp, opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>

sign a mandate Sign a mandate with the received OTP.

Options Hash (opts):

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :debtor_signature_ip (String)

    IP address from which the mandate will be signed.



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/treezor_client/api/mandate_api.rb', line 330

def mandates_id_sign_put_with_http_info(id, access_token, access_signature, user_id, otp, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MandateApi.mandates_id_sign_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 MandateApi.mandates_id_sign_put"
  end
  # verify the required parameter 'access_token' is set
  if @api_client.config.client_side_validation && access_token.nil?
    fail ArgumentError, "Missing the required parameter 'access_token' when calling MandateApi.mandates_id_sign_put"
  end
  # verify the required parameter 'access_signature' is set
  if @api_client.config.client_side_validation && access_signature.nil?
    fail ArgumentError, "Missing the required parameter 'access_signature' when calling MandateApi.mandates_id_sign_put"
  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 MandateApi.mandates_id_sign_put"
  end
  # verify the required parameter 'otp' is set
  if @api_client.config.client_side_validation && otp.nil?
    fail ArgumentError, "Missing the required parameter 'otp' when calling MandateApi.mandates_id_sign_put"
  end
  # resource path
  local_var_path = '/mandates/{id}/Sign/'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'accessToken'] = access_token
  query_params[:'accessSignature'] = access_signature
  query_params[:'userId'] = user_id
  query_params[:'otp'] = otp
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'debtorSignatureIp'] = opts[:'debtor_signature_ip'] if !opts[:'debtor_signature_ip'].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 => 'InlineResponse20014')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MandateApi#mandates_id_sign_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_mandates(sdd_type, is_paper, user_id, debtor_name, debtor_address, debtor_city, debtor_zip_code, debtor_country, debtor_iban, sequence_type, created_ip, opts = {}) ⇒ InlineResponse20014

create a mandate Create a new mandate in the system.

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).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :debtor_bic (String)

    Debtor&#39;s BIC (or SWIFT)

  • :signature_date (String)

    Signature date of the mandate. Required if is paper.

  • :user_id_ultimate_creditor (String)

    For SDDE Core third party credior mode



411
412
413
414
# File 'lib/treezor_client/api/mandate_api.rb', line 411

def post_mandates(sdd_type, is_paper, user_id, debtor_name, debtor_address, debtor_city, debtor_zip_code, debtor_country, debtor_iban, sequence_type, created_ip, opts = {})
  data, _status_code, _headers = post_mandates_with_http_info(sdd_type, is_paper, user_id, debtor_name, debtor_address, debtor_city, debtor_zip_code, debtor_country, debtor_iban, sequence_type, created_ip, opts)
  data
end

#post_mandates_with_http_info(sdd_type, is_paper, user_id, debtor_name, debtor_address, debtor_city, debtor_zip_code, debtor_country, debtor_iban, sequence_type, created_ip, opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>

create a mandate Create a new mandate in the system.

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).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :debtor_bic (String)

    Debtor&#39;s BIC (or SWIFT)

  • :signature_date (String)

    Signature date of the mandate. Required if is paper.

  • :user_id_ultimate_creditor (String)

    For SDDE Core third party credior mode



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/treezor_client/api/mandate_api.rb', line 438

def post_mandates_with_http_info(sdd_type, is_paper, user_id, debtor_name, debtor_address, debtor_city, debtor_zip_code, debtor_country, debtor_iban, sequence_type, created_ip, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MandateApi.post_mandates ...'
  end
  # verify the required parameter 'sdd_type' is set
  if @api_client.config.client_side_validation && sdd_type.nil?
    fail ArgumentError, "Missing the required parameter 'sdd_type' when calling MandateApi.post_mandates"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['core', 'b2b'].include?(sdd_type)
    fail ArgumentError, "invalid value for 'sdd_type', must be one of core, b2b"
  end
  # verify the required parameter 'is_paper' is set
  if @api_client.config.client_side_validation && is_paper.nil?
    fail ArgumentError, "Missing the required parameter 'is_paper' when calling MandateApi.post_mandates"
  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 MandateApi.post_mandates"
  end
  # verify the required parameter 'debtor_name' is set
  if @api_client.config.client_side_validation && debtor_name.nil?
    fail ArgumentError, "Missing the required parameter 'debtor_name' when calling MandateApi.post_mandates"
  end
  # verify the required parameter 'debtor_address' is set
  if @api_client.config.client_side_validation && debtor_address.nil?
    fail ArgumentError, "Missing the required parameter 'debtor_address' when calling MandateApi.post_mandates"
  end
  # verify the required parameter 'debtor_city' is set
  if @api_client.config.client_side_validation && debtor_city.nil?
    fail ArgumentError, "Missing the required parameter 'debtor_city' when calling MandateApi.post_mandates"
  end
  # verify the required parameter 'debtor_zip_code' is set
  if @api_client.config.client_side_validation && debtor_zip_code.nil?
    fail ArgumentError, "Missing the required parameter 'debtor_zip_code' when calling MandateApi.post_mandates"
  end
  # verify the required parameter 'debtor_country' is set
  if @api_client.config.client_side_validation && debtor_country.nil?
    fail ArgumentError, "Missing the required parameter 'debtor_country' when calling MandateApi.post_mandates"
  end
  # verify the required parameter 'debtor_iban' is set
  if @api_client.config.client_side_validation && debtor_iban.nil?
    fail ArgumentError, "Missing the required parameter 'debtor_iban' when calling MandateApi.post_mandates"
  end
  # verify the required parameter 'sequence_type' is set
  if @api_client.config.client_side_validation && sequence_type.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_type' when calling MandateApi.post_mandates"
  end
  # verify the required parameter 'created_ip' is set
  if @api_client.config.client_side_validation && created_ip.nil?
    fail ArgumentError, "Missing the required parameter 'created_ip' when calling MandateApi.post_mandates"
  end
  # resource path
  local_var_path = '/mandates'

  # query parameters
  query_params = {}
  query_params[:'sddType'] = sdd_type
  query_params[:'isPaper'] = is_paper
  query_params[:'userId'] = user_id
  query_params[:'debtorName'] = debtor_name
  query_params[:'debtorAddress'] = debtor_address
  query_params[:'debtorCity'] = debtor_city
  query_params[:'debtorZipCode'] = debtor_zip_code
  query_params[:'debtorCountry'] = debtor_country
  query_params[:'debtorIban'] = debtor_iban
  query_params[:'sequenceType'] = sequence_type
  query_params[:'createdIp'] = created_ip
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'debtorBic'] = opts[:'debtor_bic'] if !opts[:'debtor_bic'].nil?
  query_params[:'signatureDate'] = opts[:'signature_date'] if !opts[:'signature_date'].nil?
  query_params[:'userIdUltimateCreditor'] = opts[:'user_id_ultimate_creditor'] if !opts[:'user_id_ultimate_creditor'].nil?

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

  # 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 => 'InlineResponse20014')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MandateApi#post_mandates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end