conekta 7.0.1 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +19 -8
- data/VERSION +1 -1
- data/config-ruby.json +1 -1
- data/docs/ChargeOrderResponsePaymentMethod.md +5 -2
- data/docs/ChargeRequestPaymentMethod.md +3 -1
- data/docs/ChargeResponsePaymentMethod.md +5 -2
- data/docs/ChargesApi.md +2 -2
- data/docs/CheckoutRequest.md +1 -1
- data/docs/CompaniesApi.md +296 -0
- data/docs/CompanyDocumentRequest.md +26 -0
- data/docs/CompanyDocumentResponse.md +22 -0
- data/docs/CompanyResponse.md +18 -16
- data/docs/CompanyResponseDocumentsInner.md +22 -0
- data/docs/CreateCompanyRequest.md +26 -0
- data/docs/CreateCompanyRequestBankAccountInfo.md +18 -0
- data/docs/CreateCompanyRequestComercialInfo.md +24 -0
- data/docs/CreateCompanyRequestFiscalInfo.md +20 -0
- data/docs/CreateCustomerPaymentMethodsResponse.md +3 -2
- data/docs/CustomerPaymentMethodRequest.md +1 -1
- data/docs/CustomerPaymentMethodsData.md +3 -2
- data/docs/EventsResendResponse.md +1 -1
- data/docs/GetCustomerPaymentMethodDataResponse.md +3 -2
- data/docs/OrderResponseCheckout.md +1 -1
- data/docs/PaymentMethodBnplRequest.md +1 -1
- data/docs/PaymentMethodCardRequest.md +1 -1
- data/docs/PaymentMethodCashRecurrentResponse.md +38 -0
- data/docs/PaymentMethodCashRequest.md +1 -1
- data/docs/PaymentMethodPbbPayment.md +30 -0
- data/docs/PaymentMethodPbbRequest.md +22 -0
- data/docs/PaymentMethodSpeiRecurrent.md +2 -0
- data/docs/PaymentMethodSpeiRequest.md +1 -1
- data/docs/PaymentMethodTokenRequest.md +1 -1
- data/docs/PaymentMethodsApi.md +1 -1
- data/docs/UpdateCustomerPaymentMethodsResponse.md +3 -2
- data/docs/UpdatePaymentMethods.md +4 -2
- data/docs/WebhookLog.md +1 -1
- data/docs/WebhookResponse.md +1 -1
- data/examples/README.md +15 -0
- data/examples/one_time_charge_bnpl.rb +49 -0
- data/examples/one_time_charge_pbb.rb +47 -0
- data/lib/conekta/api/companies_api.rb +300 -0
- data/lib/conekta/models/charge_order_response_payment_method.rb +4 -2
- data/lib/conekta/models/charge_request_payment_method.rb +2 -1
- data/lib/conekta/models/charge_response_payment_method.rb +4 -2
- data/lib/conekta/models/company_document_request.rb +318 -0
- data/lib/conekta/models/company_document_response.rb +291 -0
- data/lib/conekta/models/company_response.rb +110 -74
- data/lib/conekta/models/company_response_documents_inner.rb +270 -0
- data/lib/conekta/models/create_company_request.rb +252 -0
- data/lib/conekta/models/create_company_request_bank_account_info.rb +216 -0
- data/lib/conekta/models/create_company_request_comercial_info.rb +246 -0
- data/lib/conekta/models/create_company_request_fiscal_info.rb +226 -0
- data/lib/conekta/models/create_customer_payment_methods_response.rb +2 -2
- data/lib/conekta/models/customer_payment_methods_data.rb +2 -2
- data/lib/conekta/models/get_customer_payment_method_data_response.rb +2 -2
- data/lib/conekta/models/payment_method_bnpl_request.rb +2 -2
- data/lib/conekta/models/payment_method_cash_recurrent_response.rb +343 -0
- data/lib/conekta/models/payment_method_pbb_payment.rb +341 -0
- data/lib/conekta/models/payment_method_pbb_request.rb +309 -0
- data/lib/conekta/models/payment_method_spei_recurrent.rb +11 -1
- data/lib/conekta/models/update_customer_payment_methods_response.rb +2 -2
- data/lib/conekta/models/update_payment_methods.rb +34 -4
- data/lib/conekta/version.rb +1 -1
- data/lib/conekta.rb +10 -3
- data/spec/api/companies_api_spec.rb +53 -0
- metadata +42 -22
- data/docs/CompanyFiscalInfoAddressResponse.md +0 -34
- data/docs/CompanyFiscalInfoResponse.md +0 -30
- data/docs/CompanyPayoutDestinationResponse.md +0 -28
@@ -19,6 +19,74 @@ module Conekta
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Create Company
|
23
|
+
# Create a new company.
|
24
|
+
# @param create_company_request [CreateCompanyRequest] Company data
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [CompanyResponse]
|
27
|
+
def create_company(create_company_request, opts = {})
|
28
|
+
data, _status_code, _headers = create_company_with_http_info(create_company_request, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create Company
|
33
|
+
# Create a new company.
|
34
|
+
# @param create_company_request [CreateCompanyRequest] Company data
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(CompanyResponse, Integer, Hash)>] CompanyResponse data, response status code and response headers
|
37
|
+
def create_company_with_http_info(create_company_request, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: CompaniesApi.create_company ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'create_company_request' is set
|
42
|
+
if @api_client.config.client_side_validation && create_company_request.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_company_request' when calling CompaniesApi.create_company"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/companies'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
+
if !content_type.nil?
|
58
|
+
header_params['Content-Type'] = content_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_company_request)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'CompanyResponse'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"CompaniesApi.create_company",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: CompaniesApi#create_company\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
22
90
|
# Get List of Companies
|
23
91
|
# Consume the list of child companies. This is used for holding companies with several child entities.
|
24
92
|
# @param [Hash] opts the optional parameters
|
@@ -170,5 +238,237 @@ module Conekta
|
|
170
238
|
end
|
171
239
|
return data, status_code, headers
|
172
240
|
end
|
241
|
+
|
242
|
+
# Get Company Documents
|
243
|
+
# Retrieve a list of documents associated with a specific company.
|
244
|
+
# @param company_id [String] The unique identifier of the company.
|
245
|
+
# @param [Hash] opts the optional parameters
|
246
|
+
# @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
|
247
|
+
# @return [Array<CompanyDocumentResponse>]
|
248
|
+
def get_company_documents(company_id, opts = {})
|
249
|
+
data, _status_code, _headers = get_company_documents_with_http_info(company_id, opts)
|
250
|
+
data
|
251
|
+
end
|
252
|
+
|
253
|
+
# Get Company Documents
|
254
|
+
# Retrieve a list of documents associated with a specific company.
|
255
|
+
# @param company_id [String] The unique identifier of the company.
|
256
|
+
# @param [Hash] opts the optional parameters
|
257
|
+
# @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
|
258
|
+
# @return [Array<(Array<CompanyDocumentResponse>, Integer, Hash)>] Array<CompanyDocumentResponse> data, response status code and response headers
|
259
|
+
def get_company_documents_with_http_info(company_id, opts = {})
|
260
|
+
if @api_client.config.debugging
|
261
|
+
@api_client.config.logger.debug 'Calling API: CompaniesApi.get_company_documents ...'
|
262
|
+
end
|
263
|
+
# verify the required parameter 'company_id' is set
|
264
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
265
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling CompaniesApi.get_company_documents"
|
266
|
+
end
|
267
|
+
allowable_values = ["es", "en"]
|
268
|
+
if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
|
269
|
+
fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
|
270
|
+
end
|
271
|
+
# resource path
|
272
|
+
local_var_path = '/companies/{company_id}/documents'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s))
|
273
|
+
|
274
|
+
# query parameters
|
275
|
+
query_params = opts[:query_params] || {}
|
276
|
+
|
277
|
+
# header parameters
|
278
|
+
header_params = opts[:header_params] || {}
|
279
|
+
# HTTP header 'Accept' (if needed)
|
280
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
|
281
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
282
|
+
|
283
|
+
# form parameters
|
284
|
+
form_params = opts[:form_params] || {}
|
285
|
+
|
286
|
+
# http body (model)
|
287
|
+
post_body = opts[:debug_body]
|
288
|
+
|
289
|
+
# return_type
|
290
|
+
return_type = opts[:debug_return_type] || 'Array<CompanyDocumentResponse>'
|
291
|
+
|
292
|
+
# auth_names
|
293
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
294
|
+
|
295
|
+
new_options = opts.merge(
|
296
|
+
:operation => :"CompaniesApi.get_company_documents",
|
297
|
+
:header_params => header_params,
|
298
|
+
:query_params => query_params,
|
299
|
+
:form_params => form_params,
|
300
|
+
:body => post_body,
|
301
|
+
:auth_names => auth_names,
|
302
|
+
:return_type => return_type
|
303
|
+
)
|
304
|
+
|
305
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
306
|
+
if @api_client.config.debugging
|
307
|
+
@api_client.config.logger.debug "API called: CompaniesApi#get_company_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
308
|
+
end
|
309
|
+
return data, status_code, headers
|
310
|
+
end
|
311
|
+
|
312
|
+
# Update Company Document
|
313
|
+
# Updates an existing document associated with a specific company.
|
314
|
+
# @param company_id [String] The unique identifier of the company.
|
315
|
+
# @param company_document_request [CompanyDocumentRequest] Document information to update.
|
316
|
+
# @param [Hash] opts the optional parameters
|
317
|
+
# @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
|
318
|
+
# @return [CompanyDocumentResponse]
|
319
|
+
def update_company_document(company_id, company_document_request, opts = {})
|
320
|
+
data, _status_code, _headers = update_company_document_with_http_info(company_id, company_document_request, opts)
|
321
|
+
data
|
322
|
+
end
|
323
|
+
|
324
|
+
# Update Company Document
|
325
|
+
# Updates an existing document associated with a specific company.
|
326
|
+
# @param company_id [String] The unique identifier of the company.
|
327
|
+
# @param company_document_request [CompanyDocumentRequest] Document information to update.
|
328
|
+
# @param [Hash] opts the optional parameters
|
329
|
+
# @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
|
330
|
+
# @return [Array<(CompanyDocumentResponse, Integer, Hash)>] CompanyDocumentResponse data, response status code and response headers
|
331
|
+
def update_company_document_with_http_info(company_id, company_document_request, opts = {})
|
332
|
+
if @api_client.config.debugging
|
333
|
+
@api_client.config.logger.debug 'Calling API: CompaniesApi.update_company_document ...'
|
334
|
+
end
|
335
|
+
# verify the required parameter 'company_id' is set
|
336
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
337
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling CompaniesApi.update_company_document"
|
338
|
+
end
|
339
|
+
# verify the required parameter 'company_document_request' is set
|
340
|
+
if @api_client.config.client_side_validation && company_document_request.nil?
|
341
|
+
fail ArgumentError, "Missing the required parameter 'company_document_request' when calling CompaniesApi.update_company_document"
|
342
|
+
end
|
343
|
+
allowable_values = ["es", "en"]
|
344
|
+
if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
|
345
|
+
fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
|
346
|
+
end
|
347
|
+
# resource path
|
348
|
+
local_var_path = '/companies/{company_id}/document'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s))
|
349
|
+
|
350
|
+
# query parameters
|
351
|
+
query_params = opts[:query_params] || {}
|
352
|
+
|
353
|
+
# header parameters
|
354
|
+
header_params = opts[:header_params] || {}
|
355
|
+
# HTTP header 'Accept' (if needed)
|
356
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
|
357
|
+
# HTTP header 'Content-Type'
|
358
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
359
|
+
if !content_type.nil?
|
360
|
+
header_params['Content-Type'] = content_type
|
361
|
+
end
|
362
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
363
|
+
|
364
|
+
# form parameters
|
365
|
+
form_params = opts[:form_params] || {}
|
366
|
+
|
367
|
+
# http body (model)
|
368
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(company_document_request)
|
369
|
+
|
370
|
+
# return_type
|
371
|
+
return_type = opts[:debug_return_type] || 'CompanyDocumentResponse'
|
372
|
+
|
373
|
+
# auth_names
|
374
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
375
|
+
|
376
|
+
new_options = opts.merge(
|
377
|
+
:operation => :"CompaniesApi.update_company_document",
|
378
|
+
:header_params => header_params,
|
379
|
+
:query_params => query_params,
|
380
|
+
:form_params => form_params,
|
381
|
+
:body => post_body,
|
382
|
+
:auth_names => auth_names,
|
383
|
+
:return_type => return_type
|
384
|
+
)
|
385
|
+
|
386
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
387
|
+
if @api_client.config.debugging
|
388
|
+
@api_client.config.logger.debug "API called: CompaniesApi#update_company_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
389
|
+
end
|
390
|
+
return data, status_code, headers
|
391
|
+
end
|
392
|
+
|
393
|
+
# Upload Company Document
|
394
|
+
# Uploads a document associated with a specific company.
|
395
|
+
# @param company_id [String] The unique identifier of the company.
|
396
|
+
# @param company_document_request [CompanyDocumentRequest] Document information to upload.
|
397
|
+
# @param [Hash] opts the optional parameters
|
398
|
+
# @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
|
399
|
+
# @return [CompanyDocumentResponse]
|
400
|
+
def upload_company_document(company_id, company_document_request, opts = {})
|
401
|
+
data, _status_code, _headers = upload_company_document_with_http_info(company_id, company_document_request, opts)
|
402
|
+
data
|
403
|
+
end
|
404
|
+
|
405
|
+
# Upload Company Document
|
406
|
+
# Uploads a document associated with a specific company.
|
407
|
+
# @param company_id [String] The unique identifier of the company.
|
408
|
+
# @param company_document_request [CompanyDocumentRequest] Document information to upload.
|
409
|
+
# @param [Hash] opts the optional parameters
|
410
|
+
# @option opts [String] :accept_language Use for knowing which language to use (default to 'es')
|
411
|
+
# @return [Array<(CompanyDocumentResponse, Integer, Hash)>] CompanyDocumentResponse data, response status code and response headers
|
412
|
+
def upload_company_document_with_http_info(company_id, company_document_request, opts = {})
|
413
|
+
if @api_client.config.debugging
|
414
|
+
@api_client.config.logger.debug 'Calling API: CompaniesApi.upload_company_document ...'
|
415
|
+
end
|
416
|
+
# verify the required parameter 'company_id' is set
|
417
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
418
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling CompaniesApi.upload_company_document"
|
419
|
+
end
|
420
|
+
# verify the required parameter 'company_document_request' is set
|
421
|
+
if @api_client.config.client_side_validation && company_document_request.nil?
|
422
|
+
fail ArgumentError, "Missing the required parameter 'company_document_request' when calling CompaniesApi.upload_company_document"
|
423
|
+
end
|
424
|
+
allowable_values = ["es", "en"]
|
425
|
+
if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
|
426
|
+
fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
|
427
|
+
end
|
428
|
+
# resource path
|
429
|
+
local_var_path = '/companies/{company_id}/document'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s))
|
430
|
+
|
431
|
+
# query parameters
|
432
|
+
query_params = opts[:query_params] || {}
|
433
|
+
|
434
|
+
# header parameters
|
435
|
+
header_params = opts[:header_params] || {}
|
436
|
+
# HTTP header 'Accept' (if needed)
|
437
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json'])
|
438
|
+
# HTTP header 'Content-Type'
|
439
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
440
|
+
if !content_type.nil?
|
441
|
+
header_params['Content-Type'] = content_type
|
442
|
+
end
|
443
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
444
|
+
|
445
|
+
# form parameters
|
446
|
+
form_params = opts[:form_params] || {}
|
447
|
+
|
448
|
+
# http body (model)
|
449
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(company_document_request)
|
450
|
+
|
451
|
+
# return_type
|
452
|
+
return_type = opts[:debug_return_type] || 'CompanyDocumentResponse'
|
453
|
+
|
454
|
+
# auth_names
|
455
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
456
|
+
|
457
|
+
new_options = opts.merge(
|
458
|
+
:operation => :"CompaniesApi.upload_company_document",
|
459
|
+
:header_params => header_params,
|
460
|
+
:query_params => query_params,
|
461
|
+
:form_params => form_params,
|
462
|
+
:body => post_body,
|
463
|
+
:auth_names => auth_names,
|
464
|
+
:return_type => return_type
|
465
|
+
)
|
466
|
+
|
467
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
468
|
+
if @api_client.config.debugging
|
469
|
+
@api_client.config.logger.debug "API called: CompaniesApi#upload_company_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
470
|
+
end
|
471
|
+
return data, status_code, headers
|
472
|
+
end
|
173
473
|
end
|
174
474
|
end
|
@@ -22,7 +22,8 @@ module Conekta
|
|
22
22
|
:'PaymentMethodBankTransfer',
|
23
23
|
:'PaymentMethodBnplPayment',
|
24
24
|
:'PaymentMethodCard',
|
25
|
-
:'PaymentMethodCash'
|
25
|
+
:'PaymentMethodCash',
|
26
|
+
:'PaymentMethodPbbPayment'
|
26
27
|
]
|
27
28
|
end
|
28
29
|
|
@@ -37,7 +38,8 @@ module Conekta
|
|
37
38
|
:'bank_transfer_payment' => :'PaymentMethodBankTransfer',
|
38
39
|
:'bnpl_payment' => :'PaymentMethodBnplPayment',
|
39
40
|
:'card_payment' => :'PaymentMethodCard',
|
40
|
-
:'cash_payment' => :'PaymentMethodCash'
|
41
|
+
:'cash_payment' => :'PaymentMethodCash',
|
42
|
+
:'pbb_payment' => :'PaymentMethodPbbPayment'
|
41
43
|
}
|
42
44
|
end
|
43
45
|
|
@@ -22,7 +22,8 @@ module Conekta
|
|
22
22
|
:'PaymentMethodBankTransfer',
|
23
23
|
:'PaymentMethodBnplPayment',
|
24
24
|
:'PaymentMethodCard',
|
25
|
-
:'PaymentMethodCash'
|
25
|
+
:'PaymentMethodCash',
|
26
|
+
:'PaymentMethodPbbPayment'
|
26
27
|
]
|
27
28
|
end
|
28
29
|
|
@@ -37,7 +38,8 @@ module Conekta
|
|
37
38
|
:'bank_transfer_payment' => :'PaymentMethodBankTransfer',
|
38
39
|
:'bnpl_payment' => :'PaymentMethodBnplPayment',
|
39
40
|
:'card_payment' => :'PaymentMethodCard',
|
40
|
-
:'cash_payment' => :'PaymentMethodCash'
|
41
|
+
:'cash_payment' => :'PaymentMethodCash',
|
42
|
+
:'pay_by_bank_payment' => :'PaymentMethodPbbPayment'
|
41
43
|
}
|
42
44
|
end
|
43
45
|
|
@@ -0,0 +1,318 @@
|
|
1
|
+
=begin
|
2
|
+
#Conekta API
|
3
|
+
|
4
|
+
#Conekta sdk
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.2.0
|
7
|
+
Contact: engineering@conekta.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.5.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Conekta
|
17
|
+
# Request body for uploading a company document.
|
18
|
+
class CompanyDocumentRequest
|
19
|
+
# Classification of the document. | Tipo de archivo | Descripción | | :--------------------------- | :-------------------------------------------------------- | | `id_legal_representative` | identificación oficial frente | | `id_legal_representative_back` | identificación oficial atrás | | `cfdi` | Prueba de situación fiscal | | `constitutive_act_basic` | Acta constitutiva | | `proof_of_address` | Comprobante de domicilio del negocio | | `power_of_attonery` | Poderes de representación | | `deposit_account_cover` | Carátula de la cuenta de depósito | | `permit_casino` | Permiso ante SEGOB | | `license_sanitation` | Licencia sanitaria de COFEPRIS | | `registration_tourism` | Inscripción ante el Registro Nacional de Turismo (SECTUR) |
|
20
|
+
attr_accessor :file_classification
|
21
|
+
|
22
|
+
# MIME type of the file. Allowed values depend on the `file_classification`. - `image/jpeg` - `image/png` - `application/pdf`
|
23
|
+
attr_accessor :content_type
|
24
|
+
|
25
|
+
# Indicates if the document is international. Defaults to false.
|
26
|
+
attr_accessor :international
|
27
|
+
|
28
|
+
# Name of the file being uploaded.
|
29
|
+
attr_accessor :file_name
|
30
|
+
|
31
|
+
# Base64 encoded content of the file.
|
32
|
+
attr_accessor :file_data
|
33
|
+
|
34
|
+
class EnumAttributeValidator
|
35
|
+
attr_reader :datatype
|
36
|
+
attr_reader :allowable_values
|
37
|
+
|
38
|
+
def initialize(datatype, allowable_values)
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
40
|
+
case datatype.to_s
|
41
|
+
when /Integer/i
|
42
|
+
value.to_i
|
43
|
+
when /Float/i
|
44
|
+
value.to_f
|
45
|
+
else
|
46
|
+
value
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def valid?(value)
|
52
|
+
!value || allowable_values.include?(value)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
+
def self.attribute_map
|
58
|
+
{
|
59
|
+
:'file_classification' => :'file_classification',
|
60
|
+
:'content_type' => :'content_type',
|
61
|
+
:'international' => :'international',
|
62
|
+
:'file_name' => :'file_name',
|
63
|
+
:'file_data' => :'file_data'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Returns all the JSON keys this model knows about
|
68
|
+
def self.acceptable_attributes
|
69
|
+
attribute_map.values
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.openapi_types
|
74
|
+
{
|
75
|
+
:'file_classification' => :'String',
|
76
|
+
:'content_type' => :'String',
|
77
|
+
:'international' => :'Boolean',
|
78
|
+
:'file_name' => :'String',
|
79
|
+
:'file_data' => :'String'
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
# List of attributes with nullable: true
|
84
|
+
def self.openapi_nullable
|
85
|
+
Set.new([
|
86
|
+
])
|
87
|
+
end
|
88
|
+
|
89
|
+
# Initializes the object
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
+
def initialize(attributes = {})
|
92
|
+
if (!attributes.is_a?(Hash))
|
93
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::CompanyDocumentRequest` initialize method"
|
94
|
+
end
|
95
|
+
|
96
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
98
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
99
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Conekta::CompanyDocumentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
100
|
+
end
|
101
|
+
h[k.to_sym] = v
|
102
|
+
}
|
103
|
+
|
104
|
+
if attributes.key?(:'file_classification')
|
105
|
+
self.file_classification = attributes[:'file_classification']
|
106
|
+
else
|
107
|
+
self.file_classification = nil
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'content_type')
|
111
|
+
self.content_type = attributes[:'content_type']
|
112
|
+
else
|
113
|
+
self.content_type = nil
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'international')
|
117
|
+
self.international = attributes[:'international']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'file_name')
|
121
|
+
self.file_name = attributes[:'file_name']
|
122
|
+
else
|
123
|
+
self.file_name = nil
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'file_data')
|
127
|
+
self.file_data = attributes[:'file_data']
|
128
|
+
else
|
129
|
+
self.file_data = nil
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
134
|
+
# @return Array for valid properties with the reasons
|
135
|
+
def list_invalid_properties
|
136
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
137
|
+
invalid_properties = Array.new
|
138
|
+
if @file_classification.nil?
|
139
|
+
invalid_properties.push('invalid value for "file_classification", file_classification cannot be nil.')
|
140
|
+
end
|
141
|
+
|
142
|
+
if @content_type.nil?
|
143
|
+
invalid_properties.push('invalid value for "content_type", content_type cannot be nil.')
|
144
|
+
end
|
145
|
+
|
146
|
+
if @file_name.nil?
|
147
|
+
invalid_properties.push('invalid value for "file_name", file_name cannot be nil.')
|
148
|
+
end
|
149
|
+
|
150
|
+
if @file_data.nil?
|
151
|
+
invalid_properties.push('invalid value for "file_data", file_data cannot be nil.')
|
152
|
+
end
|
153
|
+
|
154
|
+
invalid_properties
|
155
|
+
end
|
156
|
+
|
157
|
+
# Check to see if the all the properties in the model are valid
|
158
|
+
# @return true if the model is valid
|
159
|
+
def valid?
|
160
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
161
|
+
return false if @file_classification.nil?
|
162
|
+
file_classification_validator = EnumAttributeValidator.new('String', ["id_legal_representative", "id_legal_representative_back", "cfdi", "constitutive_act_basic", "proof_of_address", "power_of_attonery", "deposit_account_cover", "permit_casino", "license_sanitation", "registration_tourism"])
|
163
|
+
return false unless file_classification_validator.valid?(@file_classification)
|
164
|
+
return false if @content_type.nil?
|
165
|
+
return false if @file_name.nil?
|
166
|
+
return false if @file_data.nil?
|
167
|
+
true
|
168
|
+
end
|
169
|
+
|
170
|
+
# Custom attribute writer method checking allowed values (enum).
|
171
|
+
# @param [Object] file_classification Object to be assigned
|
172
|
+
def file_classification=(file_classification)
|
173
|
+
validator = EnumAttributeValidator.new('String', ["id_legal_representative", "id_legal_representative_back", "cfdi", "constitutive_act_basic", "proof_of_address", "power_of_attonery", "deposit_account_cover", "permit_casino", "license_sanitation", "registration_tourism"])
|
174
|
+
unless validator.valid?(file_classification)
|
175
|
+
fail ArgumentError, "invalid value for \"file_classification\", must be one of #{validator.allowable_values}."
|
176
|
+
end
|
177
|
+
@file_classification = file_classification
|
178
|
+
end
|
179
|
+
|
180
|
+
# Checks equality by comparing each attribute.
|
181
|
+
# @param [Object] Object to be compared
|
182
|
+
def ==(o)
|
183
|
+
return true if self.equal?(o)
|
184
|
+
self.class == o.class &&
|
185
|
+
file_classification == o.file_classification &&
|
186
|
+
content_type == o.content_type &&
|
187
|
+
international == o.international &&
|
188
|
+
file_name == o.file_name &&
|
189
|
+
file_data == o.file_data
|
190
|
+
end
|
191
|
+
|
192
|
+
# @see the `==` method
|
193
|
+
# @param [Object] Object to be compared
|
194
|
+
def eql?(o)
|
195
|
+
self == o
|
196
|
+
end
|
197
|
+
|
198
|
+
# Calculates hash code according to all attributes.
|
199
|
+
# @return [Integer] Hash code
|
200
|
+
def hash
|
201
|
+
[file_classification, content_type, international, file_name, file_data].hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Builds the object from hash
|
205
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
206
|
+
# @return [Object] Returns the model itself
|
207
|
+
def self.build_from_hash(attributes)
|
208
|
+
return nil unless attributes.is_a?(Hash)
|
209
|
+
attributes = attributes.transform_keys(&:to_sym)
|
210
|
+
transformed_hash = {}
|
211
|
+
openapi_types.each_pair do |key, type|
|
212
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
213
|
+
transformed_hash["#{key}"] = nil
|
214
|
+
elsif type =~ /\AArray<(.*)>/i
|
215
|
+
# check to ensure the input is an array given that the attribute
|
216
|
+
# is documented as an array but the input is not
|
217
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
218
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
219
|
+
end
|
220
|
+
elsif !attributes[attribute_map[key]].nil?
|
221
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
222
|
+
end
|
223
|
+
end
|
224
|
+
new(transformed_hash)
|
225
|
+
end
|
226
|
+
|
227
|
+
# Deserializes the data based on type
|
228
|
+
# @param string type Data type
|
229
|
+
# @param string value Value to be deserialized
|
230
|
+
# @return [Object] Deserialized data
|
231
|
+
def self._deserialize(type, value)
|
232
|
+
case type.to_sym
|
233
|
+
when :Time
|
234
|
+
Time.parse(value)
|
235
|
+
when :Date
|
236
|
+
Date.parse(value)
|
237
|
+
when :String
|
238
|
+
value.to_s
|
239
|
+
when :Integer
|
240
|
+
value.to_i
|
241
|
+
when :Float
|
242
|
+
value.to_f
|
243
|
+
when :Boolean
|
244
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
245
|
+
true
|
246
|
+
else
|
247
|
+
false
|
248
|
+
end
|
249
|
+
when :Object
|
250
|
+
# generic object (usually a Hash), return directly
|
251
|
+
value
|
252
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
253
|
+
inner_type = Regexp.last_match[:inner_type]
|
254
|
+
value.map { |v| _deserialize(inner_type, v) }
|
255
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
256
|
+
k_type = Regexp.last_match[:k_type]
|
257
|
+
v_type = Regexp.last_match[:v_type]
|
258
|
+
{}.tap do |hash|
|
259
|
+
value.each do |k, v|
|
260
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
261
|
+
end
|
262
|
+
end
|
263
|
+
else # model
|
264
|
+
# models (e.g. Pet) or oneOf
|
265
|
+
klass = Conekta.const_get(type)
|
266
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
# Returns the string representation of the object
|
271
|
+
# @return [String] String presentation of the object
|
272
|
+
def to_s
|
273
|
+
to_hash.to_s
|
274
|
+
end
|
275
|
+
|
276
|
+
# to_body is an alias to to_hash (backward compatibility)
|
277
|
+
# @return [Hash] Returns the object in the form of hash
|
278
|
+
def to_body
|
279
|
+
to_hash
|
280
|
+
end
|
281
|
+
|
282
|
+
# Returns the object in the form of hash
|
283
|
+
# @return [Hash] Returns the object in the form of hash
|
284
|
+
def to_hash
|
285
|
+
hash = {}
|
286
|
+
self.class.attribute_map.each_pair do |attr, param|
|
287
|
+
value = self.send(attr)
|
288
|
+
if value.nil?
|
289
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
290
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
291
|
+
end
|
292
|
+
|
293
|
+
hash[param] = _to_hash(value)
|
294
|
+
end
|
295
|
+
hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Outputs non-array value in the form of hash
|
299
|
+
# For object, use to_hash. Otherwise, just return the value
|
300
|
+
# @param [Object] value Any valid value
|
301
|
+
# @return [Hash] Returns the value in the form of hash
|
302
|
+
def _to_hash(value)
|
303
|
+
if value.is_a?(Array)
|
304
|
+
value.compact.map { |v| _to_hash(v) }
|
305
|
+
elsif value.is_a?(Hash)
|
306
|
+
{}.tap do |hash|
|
307
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
308
|
+
end
|
309
|
+
elsif value.respond_to? :to_hash
|
310
|
+
value.to_hash
|
311
|
+
else
|
312
|
+
value
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
end
|
317
|
+
|
318
|
+
end
|