wire4_client 0.0.1.pre.SNAPSHOT → 0.0.9.pre.TEST
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 +84 -44
- data/docs/Account.md +3 -3
- data/docs/AccountDetail.md +13 -0
- data/docs/AccountReassigned.md +22 -0
- data/docs/AccountResponse.md +6 -3
- data/docs/AccountSpid.md +2 -2
- data/docs/AddressCompany.md +17 -0
- data/docs/AmountRequest.md +2 -0
- data/docs/AuthorizationTransactionGroup.md +9 -0
- data/docs/AuthorizedBeneficiariesResponse.md +10 -0
- data/docs/AuthorizedUsers.md +13 -0
- data/docs/AutorizacinDeDepsitosApi.md +113 -0
- data/docs/BeneficiariesQueryRegisterStatus.md +13 -0
- data/docs/BillingTransaction.md +1 -1
- data/docs/CertificateRequest.md +11 -0
- data/docs/CodiCodeQrResponseDTO.md +17 -0
- data/docs/CodiCodeRequestDTO.md +14 -0
- data/docs/CodiOperationResponseDTO.md +14 -0
- data/docs/CodiOperationsFiltersRequestDTO.md +15 -0
- data/docs/CompanyRegistered.md +13 -0
- data/docs/CompanyRequested.md +11 -0
- data/docs/Compay.md +11 -0
- data/docs/ComprobanteElectrnicoDePagoCEPApi.md +6 -8
- data/docs/ConfigurationsLimits.md +9 -0
- data/docs/ContactoApi.md +6 -8
- data/docs/ContractDetailRequest.md +11 -0
- data/docs/ContractDetailResponse.md +9 -0
- data/docs/ContractsDetailsApi.md +222 -0
- data/docs/CuentasDeBeneficiariosSPEIApi.md +163 -54
- data/docs/CuentasDeBeneficiariosSPIDApi.md +73 -8
- data/docs/Deposit.md +1 -0
- data/docs/DepositAuthorizationRequest.md +10 -0
- data/docs/DepositantesApi.md +12 -16
- data/docs/DepositsAuthorizationResponse.md +10 -0
- data/docs/DetailedErrorResponse.md +10 -0
- data/docs/EmpresasCoDiApi.md +107 -0
- data/docs/FacturasApi.md +12 -16
- data/docs/InstitucionesApi.md +10 -9
- data/docs/Item.md +10 -0
- data/docs/LmitesDeMontosApi.md +112 -0
- data/docs/MessageAccountBeneficiary.md +2 -2
- data/docs/MessageCEP.md +9 -9
- data/docs/MessageCodiAction.md +19 -0
- data/docs/MessageConfigurationsLimits.md +8 -0
- data/docs/MessageDepositAuthorizationRequest.md +27 -0
- data/docs/MessageDepositReceived.md +1 -0
- data/docs/MessagePayment.md +3 -1
- data/docs/MessagePaymentStatePending.md +23 -0
- data/docs/MessageRequestChanged.md +9 -0
- data/docs/MessageSalesPoint.md +10 -0
- data/docs/MessageSubscription.md +6 -5
- data/docs/MessageUserAuthorized.md +14 -0
- data/docs/MessageWebHook.md +2 -2
- data/docs/OperacionesCoDiApi.md +68 -0
- data/docs/Operations.md +17 -0
- data/docs/PagerResponseDto.md +13 -0
- data/docs/Payment.md +4 -2
- data/docs/PaymentCODI.md +13 -0
- data/docs/PaymentRequestCodiResponseDTO.md +18 -0
- data/docs/PaymentsRequestId.md +13 -0
- data/docs/PeticionesDePagoPorCoDiApi.md +116 -0
- data/docs/PreMonexAuthorization.md +11 -0
- data/docs/PuntosDeVentaCoDiApi.md +113 -0
- data/docs/SaldoApi.md +6 -8
- data/docs/SalesPoint.md +10 -0
- data/docs/SalesPointFound.md +14 -0
- data/docs/SalesPointRequest.md +11 -0
- data/docs/SalesPointRespose.md +11 -0
- data/docs/SpidBeneficiariesResponse.md +8 -0
- data/docs/SpidBeneficiaryResponse.md +20 -0
- data/docs/SuscripcionesApi.md +32 -38
- data/docs/TransactionErrorCode.md +10 -0
- data/docs/TransactionOutgoing.md +2 -1
- data/docs/TransferenciasSPEIApi.md +136 -32
- data/docs/TransferenciasSPIDApi.md +12 -16
- data/docs/UpdateConfigurationsRequestDTO.md +8 -0
- data/docs/UrlsRedirect.md +9 -0
- data/docs/UserCompany.md +16 -0
- data/docs/WebHookDepositAuthorizationRequest.md +9 -0
- data/docs/WebHookDepositAuthorizationResponse.md +13 -0
- data/docs/Webhook.md +13 -0
- data/docs/WebhooksApi.md +22 -25
- data/lib/wire4_client.rb +56 -2
- data/lib/wire4_client/api/autorizacin_de_depsitos_api.rb +173 -0
- data/lib/wire4_client/api/comprobante_electrnico_de_pago_cep_api.rb +12 -5
- data/lib/wire4_client/api/contacto_api.rb +12 -5
- data/lib/wire4_client/api/contracts_details_api.rb +301 -0
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spei_api.rb +262 -33
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spid_api.rb +104 -5
- data/lib/wire4_client/api/depositantes_api.rb +23 -9
- data/lib/wire4_client/api/empresas_co_di_api.rb +137 -0
- data/lib/wire4_client/api/facturas_api.rb +23 -9
- data/lib/wire4_client/api/instituciones_api.rb +12 -5
- data/lib/wire4_client/api/lmites_de_montos_api.rb +160 -0
- data/lib/wire4_client/api/operaciones_co_di_api.rb +92 -0
- data/lib/wire4_client/api/peticiones_de_pago_por_co_di_api.rb +178 -0
- data/lib/wire4_client/api/puntos_de_venta_co_di_api.rb +151 -0
- data/lib/wire4_client/api/saldo_api.rb +12 -5
- data/lib/wire4_client/api/suscripciones_api.rb +48 -27
- data/lib/wire4_client/api/transferencias_spei_api.rb +204 -17
- data/lib/wire4_client/api/transferencias_spid_api.rb +23 -9
- data/lib/wire4_client/api/webhooks_api.rb +34 -13
- data/lib/wire4_client/api_client.rb +1 -2
- data/lib/wire4_client/api_error.rb +1 -1
- data/lib/wire4_client/configuration.rb +1 -22
- data/lib/wire4_client/models/account.rb +4 -4
- data/lib/wire4_client/models/account_detail.rb +239 -0
- data/lib/wire4_client/models/account_reassigned.rb +385 -0
- data/lib/wire4_client/models/account_request.rb +1 -1
- data/lib/wire4_client/models/account_response.rb +38 -8
- data/lib/wire4_client/models/account_spid.rb +3 -3
- data/lib/wire4_client/models/address_company.rb +275 -0
- data/lib/wire4_client/models/amount_request.rb +91 -5
- data/lib/wire4_client/models/authorization_transaction_group.rb +207 -0
- data/lib/wire4_client/models/authorized_beneficiaries_response.rb +206 -0
- data/lib/wire4_client/models/authorized_users.rb +235 -0
- data/lib/wire4_client/models/balance.rb +1 -1
- data/lib/wire4_client/models/balance_list_response.rb +1 -1
- data/lib/wire4_client/models/beneficiaries_query_register_status.rb +270 -0
- data/lib/wire4_client/models/beneficiaries_response.rb +1 -1
- data/lib/wire4_client/models/beneficiary_institution.rb +1 -1
- data/lib/wire4_client/models/billing.rb +1 -1
- data/lib/wire4_client/models/billing_transaction.rb +2 -2
- data/lib/wire4_client/models/cep_response.rb +1 -1
- data/lib/wire4_client/models/cep_search_banxico.rb +1 -1
- data/lib/wire4_client/models/certificate_request.rb +248 -0
- data/lib/wire4_client/models/codi_code_qr_response_dto.rb +320 -0
- data/lib/wire4_client/models/codi_code_request_dto.rb +402 -0
- data/lib/wire4_client/models/{timestamp.rb → codi_operation_response_dto.rb} +53 -72
- data/lib/wire4_client/models/codi_operations_filters_request_dto.rb +336 -0
- data/lib/wire4_client/models/company_registered.rb +235 -0
- data/lib/wire4_client/models/company_requested.rb +215 -0
- data/lib/wire4_client/models/compay.rb +215 -0
- data/lib/wire4_client/models/configurations_limits.rb +197 -0
- data/lib/wire4_client/models/contact_request.rb +1 -1
- data/lib/wire4_client/models/contract_detail_request.rb +247 -0
- data/lib/wire4_client/models/contract_detail_response.rb +194 -0
- data/lib/wire4_client/models/deposit.rb +12 -2
- data/lib/wire4_client/models/deposit_authorization_request.rb +205 -0
- data/lib/wire4_client/models/depositant.rb +1 -1
- data/lib/wire4_client/models/depositants_register.rb +1 -1
- data/lib/wire4_client/models/depositants_response.rb +1 -1
- data/lib/wire4_client/models/deposits_authorization_response.rb +205 -0
- data/lib/wire4_client/models/detailed_error_response.rb +203 -0
- data/lib/wire4_client/models/error_response.rb +1 -1
- data/lib/wire4_client/models/get_depositants.rb +1 -1
- data/lib/wire4_client/models/institution.rb +1 -1
- data/lib/wire4_client/models/institutions_list.rb +1 -1
- data/lib/wire4_client/models/item.rb +205 -0
- data/lib/wire4_client/models/message_account_beneficiary.rb +3 -3
- data/lib/wire4_client/models/message_cep.rb +11 -11
- data/lib/wire4_client/models/message_codi_action.rb +295 -0
- data/lib/wire4_client/models/message_configurations_limits.rb +187 -0
- data/lib/wire4_client/models/message_deposit_authorization_request.rb +375 -0
- data/lib/wire4_client/models/message_deposit_received.rb +13 -3
- data/lib/wire4_client/models/message_institution.rb +1 -1
- data/lib/wire4_client/models/message_payment.rb +24 -3
- data/lib/wire4_client/models/message_payment_state_pending.rb +335 -0
- data/lib/wire4_client/models/message_request_changed.rb +229 -0
- data/lib/wire4_client/models/message_sales_point.rb +205 -0
- data/lib/wire4_client/models/message_subscription.rb +18 -8
- data/lib/wire4_client/models/message_user_authorized.rb +245 -0
- data/lib/wire4_client/models/message_web_hook.rb +3 -3
- data/lib/wire4_client/models/operations.rb +321 -0
- data/lib/wire4_client/models/pager_response_dto.rb +236 -0
- data/lib/wire4_client/models/payment.rb +24 -4
- data/lib/wire4_client/models/payment_codi.rb +269 -0
- data/lib/wire4_client/models/payment_request_codi_response_dto.rb +287 -0
- data/lib/wire4_client/models/payments_request_id.rb +236 -0
- data/lib/wire4_client/models/person.rb +1 -1
- data/lib/wire4_client/models/pre_enrollment_data.rb +1 -1
- data/lib/wire4_client/models/pre_enrollment_response.rb +1 -1
- data/lib/wire4_client/models/pre_monex_authorization.rb +291 -0
- data/lib/wire4_client/models/relationship.rb +1 -1
- data/lib/wire4_client/models/relationships_response.rb +1 -1
- data/lib/wire4_client/models/sales_point.rb +205 -0
- data/lib/wire4_client/models/sales_point_found.rb +279 -0
- data/lib/wire4_client/models/sales_point_request.rb +254 -0
- data/lib/wire4_client/models/sales_point_respose.rb +215 -0
- data/lib/wire4_client/models/spid_beneficiaries_response.rb +186 -0
- data/lib/wire4_client/models/spid_beneficiary_response.rb +365 -0
- data/lib/wire4_client/models/spid_classification_dto.rb +1 -1
- data/lib/wire4_client/models/spid_classifications_response_dto.rb +1 -1
- data/lib/wire4_client/models/token_required_response.rb +1 -1
- data/lib/wire4_client/models/transaction_error_code.rb +201 -0
- data/lib/wire4_client/models/transaction_outgoing.rb +13 -3
- data/lib/wire4_client/models/transaction_outgoing_spid.rb +1 -1
- data/lib/wire4_client/models/transactions_outgoing_register.rb +1 -1
- data/lib/wire4_client/models/update_configurations_request_dto.rb +192 -0
- data/lib/wire4_client/models/urls_redirect.rb +205 -0
- data/lib/wire4_client/models/user_company.rb +269 -0
- data/lib/wire4_client/models/web_hook_deposit_authorization_request.rb +195 -0
- data/lib/wire4_client/models/web_hook_deposit_authorization_response.rb +237 -0
- data/lib/wire4_client/models/webhook.rb +271 -0
- data/lib/wire4_client/models/webhook_request.rb +1 -1
- data/lib/wire4_client/models/webhook_response.rb +1 -1
- data/lib/wire4_client/models/webhooks_list.rb +1 -1
- data/lib/wire4_client/version.rb +2 -2
- data/spec/api/autorizacin_de_depsitos_api_spec.rb +62 -0
- data/spec/api/comprobante_electrnico_de_pago_cep_api_spec.rb +2 -1
- data/spec/api/contacto_api_spec.rb +2 -1
- data/spec/api/contracts_details_api_spec.rb +90 -0
- data/spec/api/cuentas_de_beneficiarios_spei_api_spec.rb +44 -4
- data/spec/api/cuentas_de_beneficiarios_spid_api_spec.rb +22 -1
- data/spec/api/depositantes_api_spec.rb +3 -1
- data/spec/api/empresas_co_di_api_spec.rb +60 -0
- data/spec/api/facturas_api_spec.rb +3 -1
- data/spec/api/instituciones_api_spec.rb +2 -1
- data/spec/api/lmites_de_montos_api_spec.rb +62 -0
- data/spec/api/operaciones_co_di_api_spec.rb +52 -0
- data/spec/api/peticiones_de_pago_por_co_di_api_spec.rb +63 -0
- data/spec/api/puntos_de_venta_co_di_api_spec.rb +62 -0
- data/spec/api/saldo_api_spec.rb +2 -1
- data/spec/api/suscripciones_api_spec.rb +11 -8
- data/spec/api/transferencias_spei_api_spec.rb +34 -1
- data/spec/api/transferencias_spid_api_spec.rb +3 -1
- data/spec/api/webhooks_api_spec.rb +4 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/account_detail_spec.rb +71 -0
- data/spec/models/account_reassigned_spec.rb +125 -0
- data/spec/models/account_request_spec.rb +1 -1
- data/spec/models/account_response_spec.rb +19 -1
- data/spec/models/account_spec.rb +1 -1
- data/spec/models/account_spid_spec.rb +1 -1
- data/spec/models/{timestamp_spec.rb → address_company_spec.rb} +17 -17
- data/spec/models/amount_request_spec.rb +13 -1
- data/spec/models/authorization_transaction_group_spec.rb +47 -0
- data/spec/models/authorized_beneficiaries_response_spec.rb +53 -0
- data/spec/models/authorized_users_spec.rb +71 -0
- data/spec/models/balance_list_response_spec.rb +1 -1
- data/spec/models/balance_spec.rb +1 -1
- data/spec/models/beneficiaries_query_register_status_spec.rb +75 -0
- data/spec/models/beneficiaries_response_spec.rb +1 -1
- data/spec/models/beneficiary_institution_spec.rb +1 -1
- data/spec/models/billing_spec.rb +1 -1
- data/spec/models/billing_transaction_spec.rb +1 -1
- data/spec/models/cep_response_spec.rb +1 -1
- data/spec/models/cep_search_banxico_spec.rb +1 -1
- data/spec/models/certificate_request_spec.rb +59 -0
- data/spec/models/codi_code_qr_response_dto_spec.rb +103 -0
- data/spec/models/codi_code_request_dto_spec.rb +81 -0
- data/spec/models/codi_operation_response_dto_spec.rb +77 -0
- data/spec/models/codi_operations_filters_request_dto_spec.rb +87 -0
- data/spec/models/company_registered_spec.rb +71 -0
- data/spec/models/company_requested_spec.rb +59 -0
- data/spec/models/compay_spec.rb +59 -0
- data/spec/models/configurations_limits_spec.rb +47 -0
- data/spec/models/contact_request_spec.rb +1 -1
- data/spec/models/contract_detail_request_spec.rb +59 -0
- data/spec/models/contract_detail_response_spec.rb +47 -0
- data/spec/models/deposit_authorization_request_spec.rb +53 -0
- data/spec/models/deposit_spec.rb +7 -1
- data/spec/models/depositant_spec.rb +1 -1
- data/spec/models/depositants_register_spec.rb +1 -1
- data/spec/models/depositants_response_spec.rb +1 -1
- data/spec/models/deposits_authorization_response_spec.rb +53 -0
- data/spec/models/detailed_error_response_spec.rb +53 -0
- data/spec/models/error_response_spec.rb +1 -1
- data/spec/models/get_depositants_spec.rb +1 -1
- data/spec/models/institution_spec.rb +1 -1
- data/spec/models/institutions_list_spec.rb +1 -1
- data/spec/models/item_spec.rb +53 -0
- data/spec/models/message_account_beneficiary_spec.rb +1 -1
- data/spec/models/message_cep_spec.rb +1 -1
- data/spec/models/message_codi_action_spec.rb +107 -0
- data/spec/models/message_configurations_limits_spec.rb +41 -0
- data/spec/models/message_deposit_authorization_request_spec.rb +155 -0
- data/spec/models/message_deposit_received_spec.rb +7 -1
- data/spec/models/message_institution_spec.rb +1 -1
- data/spec/models/message_payment_spec.rb +13 -1
- data/spec/models/message_payment_state_pending_spec.rb +131 -0
- data/spec/models/message_request_changed_spec.rb +51 -0
- data/spec/models/message_sales_point_spec.rb +53 -0
- data/spec/models/message_subscription_spec.rb +7 -1
- data/spec/models/message_user_authorized_spec.rb +77 -0
- data/spec/models/message_web_hook_spec.rb +1 -1
- data/spec/models/operations_spec.rb +103 -0
- data/spec/models/pager_response_dto_spec.rb +71 -0
- data/spec/models/payment_codi_spec.rb +75 -0
- data/spec/models/payment_request_codi_response_dto_spec.rb +101 -0
- data/spec/models/payment_spec.rb +13 -1
- data/spec/models/payments_request_id_spec.rb +71 -0
- data/spec/models/person_spec.rb +1 -1
- data/spec/models/pre_enrollment_data_spec.rb +1 -1
- data/spec/models/pre_enrollment_response_spec.rb +1 -1
- data/spec/models/pre_monex_authorization_spec.rb +59 -0
- data/spec/models/relationship_spec.rb +1 -1
- data/spec/models/relationships_response_spec.rb +1 -1
- data/spec/models/sales_point_found_spec.rb +81 -0
- data/spec/models/sales_point_request_spec.rb +59 -0
- data/spec/models/sales_point_respose_spec.rb +59 -0
- data/spec/models/sales_point_spec.rb +53 -0
- data/spec/models/spid_beneficiaries_response_spec.rb +41 -0
- data/spec/models/spid_beneficiary_response_spec.rb +113 -0
- data/spec/models/spid_classification_dto_spec.rb +1 -1
- data/spec/models/spid_classifications_response_dto_spec.rb +1 -1
- data/spec/models/token_required_response_spec.rb +1 -1
- data/spec/models/transaction_error_code_spec.rb +53 -0
- data/spec/models/transaction_outgoing_spec.rb +7 -1
- data/spec/models/transaction_outgoing_spid_spec.rb +1 -1
- data/spec/models/transactions_outgoing_register_spec.rb +1 -1
- data/spec/models/update_configurations_request_dto_spec.rb +41 -0
- data/spec/models/urls_redirect_spec.rb +47 -0
- data/spec/models/user_company_spec.rb +89 -0
- data/spec/models/web_hook_deposit_authorization_request_spec.rb +47 -0
- data/spec/models/web_hook_deposit_authorization_response_spec.rb +71 -0
- data/spec/models/webhook_request_spec.rb +1 -1
- data/spec/models/webhook_response_spec.rb +1 -1
- data/spec/models/webhook_spec.rb +75 -0
- data/spec/models/webhooks_list_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/wire4_client-1.0.9.gem +0 -0
- data/wire4_client.gemspec +2 -2
- metadata +267 -51
- data/Gemfile.lock +0 -69
- data/docs/Timestamp.md +0 -17
@@ -0,0 +1,320 @@
|
|
1
|
+
=begin
|
2
|
+
#Wire4RestAPI
|
3
|
+
|
4
|
+
# # Referencia de API La API de Wire4 está organizada en torno a REST.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.10
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Wire4Client
|
16
|
+
class CodiCodeQrResponseDTO
|
17
|
+
# Monto del pago CODI®
|
18
|
+
attr_accessor :amount
|
19
|
+
|
20
|
+
# El código QR en su represantación base 64
|
21
|
+
attr_accessor :barcode_base64
|
22
|
+
|
23
|
+
# La URL del código QR
|
24
|
+
attr_accessor :barcode_url
|
25
|
+
|
26
|
+
# Descripción del pago CODI®
|
27
|
+
attr_accessor :concept
|
28
|
+
|
29
|
+
# Fecha de creación del código QR para pago CODI®
|
30
|
+
attr_accessor :creation_date
|
31
|
+
|
32
|
+
# Fecha de operación del pago CODI®
|
33
|
+
attr_accessor :due_date
|
34
|
+
|
35
|
+
# Referencia de la transferencia asignada por el cliente
|
36
|
+
attr_accessor :order_id
|
37
|
+
|
38
|
+
# Número de teléfono móvil en caso de ser un pago CODI® usando 'PUSH_NOTIFICATION'
|
39
|
+
attr_accessor :phone_number
|
40
|
+
|
41
|
+
# El estado del código QR para pago CODI®
|
42
|
+
attr_accessor :status
|
43
|
+
|
44
|
+
# El tipo de código QR para pago con CODI®
|
45
|
+
attr_accessor :type
|
46
|
+
|
47
|
+
class EnumAttributeValidator
|
48
|
+
attr_reader :datatype
|
49
|
+
attr_reader :allowable_values
|
50
|
+
|
51
|
+
def initialize(datatype, allowable_values)
|
52
|
+
@allowable_values = allowable_values.map do |value|
|
53
|
+
case datatype.to_s
|
54
|
+
when /Integer/i
|
55
|
+
value.to_i
|
56
|
+
when /Float/i
|
57
|
+
value.to_f
|
58
|
+
else
|
59
|
+
value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def valid?(value)
|
65
|
+
!value || allowable_values.include?(value)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
70
|
+
def self.attribute_map
|
71
|
+
{
|
72
|
+
:'amount' => :'amount',
|
73
|
+
:'barcode_base64' => :'barcode_base64',
|
74
|
+
:'barcode_url' => :'barcode_url',
|
75
|
+
:'concept' => :'concept',
|
76
|
+
:'creation_date' => :'creation_date',
|
77
|
+
:'due_date' => :'due_date',
|
78
|
+
:'order_id' => :'order_id',
|
79
|
+
:'phone_number' => :'phone_number',
|
80
|
+
:'status' => :'status',
|
81
|
+
:'type' => :'type'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Attribute type mapping.
|
86
|
+
def self.swagger_types
|
87
|
+
{
|
88
|
+
:'amount' => :'Float',
|
89
|
+
:'barcode_base64' => :'String',
|
90
|
+
:'barcode_url' => :'String',
|
91
|
+
:'concept' => :'String',
|
92
|
+
:'creation_date' => :'DateTime',
|
93
|
+
:'due_date' => :'DateTime',
|
94
|
+
:'order_id' => :'String',
|
95
|
+
:'phone_number' => :'String',
|
96
|
+
:'status' => :'String',
|
97
|
+
:'type' => :'String'
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
# Initializes the object
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
def initialize(attributes = {})
|
104
|
+
return unless attributes.is_a?(Hash)
|
105
|
+
|
106
|
+
# convert string to symbol for hash key
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
108
|
+
|
109
|
+
if attributes.has_key?(:'amount')
|
110
|
+
self.amount = attributes[:'amount']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.has_key?(:'barcode_base64')
|
114
|
+
self.barcode_base64 = attributes[:'barcode_base64']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'barcode_url')
|
118
|
+
self.barcode_url = attributes[:'barcode_url']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'concept')
|
122
|
+
self.concept = attributes[:'concept']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'creation_date')
|
126
|
+
self.creation_date = attributes[:'creation_date']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'due_date')
|
130
|
+
self.due_date = attributes[:'due_date']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'order_id')
|
134
|
+
self.order_id = attributes[:'order_id']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.has_key?(:'phone_number')
|
138
|
+
self.phone_number = attributes[:'phone_number']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'status')
|
142
|
+
self.status = attributes[:'status']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'type')
|
146
|
+
self.type = attributes[:'type']
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
151
|
+
# @return Array for valid properties with the reasons
|
152
|
+
def list_invalid_properties
|
153
|
+
invalid_properties = Array.new
|
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
|
+
status_validator = EnumAttributeValidator.new('String', ['RECEIVED', 'COMPLETED', 'CANCELLED'])
|
161
|
+
return false unless status_validator.valid?(@status)
|
162
|
+
type_validator = EnumAttributeValidator.new('String', ['PUSH_NOTIFICATION', 'QR_CODE'])
|
163
|
+
return false unless type_validator.valid?(@type)
|
164
|
+
true
|
165
|
+
end
|
166
|
+
|
167
|
+
# Custom attribute writer method checking allowed values (enum).
|
168
|
+
# @param [Object] status Object to be assigned
|
169
|
+
def status=(status)
|
170
|
+
validator = EnumAttributeValidator.new('String', ['RECEIVED', 'COMPLETED', 'CANCELLED'])
|
171
|
+
unless validator.valid?(status)
|
172
|
+
fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
|
173
|
+
end
|
174
|
+
@status = status
|
175
|
+
end
|
176
|
+
|
177
|
+
# Custom attribute writer method checking allowed values (enum).
|
178
|
+
# @param [Object] type Object to be assigned
|
179
|
+
def type=(type)
|
180
|
+
validator = EnumAttributeValidator.new('String', ['PUSH_NOTIFICATION', 'QR_CODE'])
|
181
|
+
unless validator.valid?(type)
|
182
|
+
fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
|
183
|
+
end
|
184
|
+
@type = type
|
185
|
+
end
|
186
|
+
|
187
|
+
# Checks equality by comparing each attribute.
|
188
|
+
# @param [Object] Object to be compared
|
189
|
+
def ==(o)
|
190
|
+
return true if self.equal?(o)
|
191
|
+
self.class == o.class &&
|
192
|
+
amount == o.amount &&
|
193
|
+
barcode_base64 == o.barcode_base64 &&
|
194
|
+
barcode_url == o.barcode_url &&
|
195
|
+
concept == o.concept &&
|
196
|
+
creation_date == o.creation_date &&
|
197
|
+
due_date == o.due_date &&
|
198
|
+
order_id == o.order_id &&
|
199
|
+
phone_number == o.phone_number &&
|
200
|
+
status == o.status &&
|
201
|
+
type == o.type
|
202
|
+
end
|
203
|
+
|
204
|
+
# @see the `==` method
|
205
|
+
# @param [Object] Object to be compared
|
206
|
+
def eql?(o)
|
207
|
+
self == o
|
208
|
+
end
|
209
|
+
|
210
|
+
# Calculates hash code according to all attributes.
|
211
|
+
# @return [Fixnum] Hash code
|
212
|
+
def hash
|
213
|
+
[amount, barcode_base64, barcode_url, concept, creation_date, due_date, order_id, phone_number, status, type].hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Builds the object from hash
|
217
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
218
|
+
# @return [Object] Returns the model itself
|
219
|
+
def build_from_hash(attributes)
|
220
|
+
return nil unless attributes.is_a?(Hash)
|
221
|
+
self.class.swagger_types.each_pair do |key, type|
|
222
|
+
if type =~ /\AArray<(.*)>/i
|
223
|
+
# check to ensure the input is an array given that the the attribute
|
224
|
+
# is documented as an array but the input is not
|
225
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
226
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
227
|
+
end
|
228
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
229
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
230
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
231
|
+
end
|
232
|
+
|
233
|
+
self
|
234
|
+
end
|
235
|
+
|
236
|
+
# Deserializes the data based on type
|
237
|
+
# @param string type Data type
|
238
|
+
# @param string value Value to be deserialized
|
239
|
+
# @return [Object] Deserialized data
|
240
|
+
def _deserialize(type, value)
|
241
|
+
case type.to_sym
|
242
|
+
when :DateTime
|
243
|
+
DateTime.parse(value)
|
244
|
+
when :Date
|
245
|
+
Date.parse(value)
|
246
|
+
when :String
|
247
|
+
value.to_s
|
248
|
+
when :Integer
|
249
|
+
value.to_i
|
250
|
+
when :Float
|
251
|
+
value.to_f
|
252
|
+
when :BOOLEAN
|
253
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
254
|
+
true
|
255
|
+
else
|
256
|
+
false
|
257
|
+
end
|
258
|
+
when :Object
|
259
|
+
# generic object (usually a Hash), return directly
|
260
|
+
value
|
261
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
262
|
+
inner_type = Regexp.last_match[:inner_type]
|
263
|
+
value.map { |v| _deserialize(inner_type, v) }
|
264
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
265
|
+
k_type = Regexp.last_match[:k_type]
|
266
|
+
v_type = Regexp.last_match[:v_type]
|
267
|
+
{}.tap do |hash|
|
268
|
+
value.each do |k, v|
|
269
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
else # model
|
273
|
+
temp_model = Wire4Client.const_get(type).new
|
274
|
+
temp_model.build_from_hash(value)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
# Returns the string representation of the object
|
279
|
+
# @return [String] String presentation of the object
|
280
|
+
def to_s
|
281
|
+
to_hash.to_s
|
282
|
+
end
|
283
|
+
|
284
|
+
# to_body is an alias to to_hash (backward compatibility)
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
286
|
+
def to_body
|
287
|
+
to_hash
|
288
|
+
end
|
289
|
+
|
290
|
+
# Returns the object in the form of hash
|
291
|
+
# @return [Hash] Returns the object in the form of hash
|
292
|
+
def to_hash
|
293
|
+
hash = {}
|
294
|
+
self.class.attribute_map.each_pair do |attr, param|
|
295
|
+
value = self.send(attr)
|
296
|
+
next if value.nil?
|
297
|
+
hash[param] = _to_hash(value)
|
298
|
+
end
|
299
|
+
hash
|
300
|
+
end
|
301
|
+
|
302
|
+
# Outputs non-array value in the form of hash
|
303
|
+
# For object, use to_hash. Otherwise, just return the value
|
304
|
+
# @param [Object] value Any valid value
|
305
|
+
# @return [Hash] Returns the value in the form of hash
|
306
|
+
def _to_hash(value)
|
307
|
+
if value.is_a?(Array)
|
308
|
+
value.compact.map { |v| _to_hash(v) }
|
309
|
+
elsif value.is_a?(Hash)
|
310
|
+
{}.tap do |hash|
|
311
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
312
|
+
end
|
313
|
+
elsif value.respond_to? :to_hash
|
314
|
+
value.to_hash
|
315
|
+
else
|
316
|
+
value
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
@@ -0,0 +1,402 @@
|
|
1
|
+
=begin
|
2
|
+
#Wire4RestAPI
|
3
|
+
|
4
|
+
# # Referencia de API La API de Wire4 está organizada en torno a REST.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.10
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Wire4Client
|
16
|
+
class CodiCodeRequestDTO
|
17
|
+
# Monto del pago CODI®
|
18
|
+
attr_accessor :amount
|
19
|
+
|
20
|
+
# Descripción del pago CODI®
|
21
|
+
attr_accessor :concept
|
22
|
+
|
23
|
+
# Fecha de operación pago CODI®, formato: yyyy-MM-dd'T'HH:mm:ss
|
24
|
+
attr_accessor :due_date
|
25
|
+
|
26
|
+
# Campo de metada CODI®, longitud máxima determinada por configuracion de la empresa, por defecto 100 caracteres
|
27
|
+
attr_accessor :metadata
|
28
|
+
|
29
|
+
# Referencia de la transferencia asignada por el cliente
|
30
|
+
attr_accessor :order_id
|
31
|
+
|
32
|
+
# Número de teléfono móvil en caso de ser un pago CODI® usando 'PUSH_NOTIFICATION' estecampo sería obligatorio
|
33
|
+
attr_accessor :phone_number
|
34
|
+
|
35
|
+
# El tipo de código QR para pago con CODI®
|
36
|
+
attr_accessor :type
|
37
|
+
|
38
|
+
class EnumAttributeValidator
|
39
|
+
attr_reader :datatype
|
40
|
+
attr_reader :allowable_values
|
41
|
+
|
42
|
+
def initialize(datatype, allowable_values)
|
43
|
+
@allowable_values = allowable_values.map do |value|
|
44
|
+
case datatype.to_s
|
45
|
+
when /Integer/i
|
46
|
+
value.to_i
|
47
|
+
when /Float/i
|
48
|
+
value.to_f
|
49
|
+
else
|
50
|
+
value
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def valid?(value)
|
56
|
+
!value || allowable_values.include?(value)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
61
|
+
def self.attribute_map
|
62
|
+
{
|
63
|
+
:'amount' => :'amount',
|
64
|
+
:'concept' => :'concept',
|
65
|
+
:'due_date' => :'due_date',
|
66
|
+
:'metadata' => :'metadata',
|
67
|
+
:'order_id' => :'order_id',
|
68
|
+
:'phone_number' => :'phone_number',
|
69
|
+
:'type' => :'type'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# Attribute type mapping.
|
74
|
+
def self.swagger_types
|
75
|
+
{
|
76
|
+
:'amount' => :'Float',
|
77
|
+
:'concept' => :'String',
|
78
|
+
:'due_date' => :'DateTime',
|
79
|
+
:'metadata' => :'String',
|
80
|
+
:'order_id' => :'String',
|
81
|
+
:'phone_number' => :'String',
|
82
|
+
:'type' => :'String'
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Initializes the object
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
def initialize(attributes = {})
|
89
|
+
return unless attributes.is_a?(Hash)
|
90
|
+
|
91
|
+
# convert string to symbol for hash key
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
93
|
+
|
94
|
+
if attributes.has_key?(:'amount')
|
95
|
+
self.amount = attributes[:'amount']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'concept')
|
99
|
+
self.concept = attributes[:'concept']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'due_date')
|
103
|
+
self.due_date = attributes[:'due_date']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'metadata')
|
107
|
+
self.metadata = attributes[:'metadata']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'order_id')
|
111
|
+
self.order_id = attributes[:'order_id']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'phone_number')
|
115
|
+
self.phone_number = attributes[:'phone_number']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'type')
|
119
|
+
self.type = attributes[:'type']
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
124
|
+
# @return Array for valid properties with the reasons
|
125
|
+
def list_invalid_properties
|
126
|
+
invalid_properties = Array.new
|
127
|
+
if !@amount.nil? && @amount > 8000.0
|
128
|
+
invalid_properties.push('invalid value for "amount", must be smaller than or equal to 8000.0.')
|
129
|
+
end
|
130
|
+
|
131
|
+
if !@amount.nil? && @amount < 0.01
|
132
|
+
invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.01.')
|
133
|
+
end
|
134
|
+
|
135
|
+
if @concept.nil?
|
136
|
+
invalid_properties.push('invalid value for "concept", concept cannot be nil.')
|
137
|
+
end
|
138
|
+
|
139
|
+
if @concept.to_s.length > 200
|
140
|
+
invalid_properties.push('invalid value for "concept", the character length must be smaller than or equal to 200.')
|
141
|
+
end
|
142
|
+
|
143
|
+
if @concept.to_s.length < 0
|
144
|
+
invalid_properties.push('invalid value for "concept", the character length must be great than or equal to 0.')
|
145
|
+
end
|
146
|
+
|
147
|
+
if @due_date.nil?
|
148
|
+
invalid_properties.push('invalid value for "due_date", due_date cannot be nil.')
|
149
|
+
end
|
150
|
+
|
151
|
+
if @order_id.nil?
|
152
|
+
invalid_properties.push('invalid value for "order_id", order_id cannot be nil.')
|
153
|
+
end
|
154
|
+
|
155
|
+
if @order_id.to_s.length > 36
|
156
|
+
invalid_properties.push('invalid value for "order_id", the character length must be smaller than or equal to 36.')
|
157
|
+
end
|
158
|
+
|
159
|
+
if @order_id.to_s.length < 5
|
160
|
+
invalid_properties.push('invalid value for "order_id", the character length must be great than or equal to 5.')
|
161
|
+
end
|
162
|
+
|
163
|
+
if !@phone_number.nil? && @phone_number.to_s.length > 10
|
164
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 10.')
|
165
|
+
end
|
166
|
+
|
167
|
+
if !@phone_number.nil? && @phone_number.to_s.length < 10
|
168
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be great than or equal to 10.')
|
169
|
+
end
|
170
|
+
|
171
|
+
if @type.nil?
|
172
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
173
|
+
end
|
174
|
+
|
175
|
+
invalid_properties
|
176
|
+
end
|
177
|
+
|
178
|
+
# Check to see if the all the properties in the model are valid
|
179
|
+
# @return true if the model is valid
|
180
|
+
def valid?
|
181
|
+
return false if !@amount.nil? && @amount > 8000.0
|
182
|
+
return false if !@amount.nil? && @amount < 0.01
|
183
|
+
return false if @concept.nil?
|
184
|
+
return false if @concept.to_s.length > 200
|
185
|
+
return false if @concept.to_s.length < 0
|
186
|
+
return false if @due_date.nil?
|
187
|
+
return false if @order_id.nil?
|
188
|
+
return false if @order_id.to_s.length > 36
|
189
|
+
return false if @order_id.to_s.length < 5
|
190
|
+
return false if !@phone_number.nil? && @phone_number.to_s.length > 10
|
191
|
+
return false if !@phone_number.nil? && @phone_number.to_s.length < 10
|
192
|
+
return false if @type.nil?
|
193
|
+
type_validator = EnumAttributeValidator.new('String', ['PUSH_NOTIFICATION', 'QR_CODE'])
|
194
|
+
return false unless type_validator.valid?(@type)
|
195
|
+
true
|
196
|
+
end
|
197
|
+
|
198
|
+
# Custom attribute writer method with validation
|
199
|
+
# @param [Object] amount Value to be assigned
|
200
|
+
def amount=(amount)
|
201
|
+
if !amount.nil? && amount > 8000.0
|
202
|
+
fail ArgumentError, 'invalid value for "amount", must be smaller than or equal to 8000.0.'
|
203
|
+
end
|
204
|
+
|
205
|
+
if !amount.nil? && amount < 0.01
|
206
|
+
fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.01.'
|
207
|
+
end
|
208
|
+
|
209
|
+
@amount = amount
|
210
|
+
end
|
211
|
+
|
212
|
+
# Custom attribute writer method with validation
|
213
|
+
# @param [Object] concept Value to be assigned
|
214
|
+
def concept=(concept)
|
215
|
+
if concept.nil?
|
216
|
+
fail ArgumentError, 'concept cannot be nil'
|
217
|
+
end
|
218
|
+
|
219
|
+
if concept.to_s.length > 200
|
220
|
+
fail ArgumentError, 'invalid value for "concept", the character length must be smaller than or equal to 200.'
|
221
|
+
end
|
222
|
+
|
223
|
+
if concept.to_s.length < 0
|
224
|
+
fail ArgumentError, 'invalid value for "concept", the character length must be great than or equal to 0.'
|
225
|
+
end
|
226
|
+
|
227
|
+
@concept = concept
|
228
|
+
end
|
229
|
+
|
230
|
+
# Custom attribute writer method with validation
|
231
|
+
# @param [Object] order_id Value to be assigned
|
232
|
+
def order_id=(order_id)
|
233
|
+
if order_id.nil?
|
234
|
+
fail ArgumentError, 'order_id cannot be nil'
|
235
|
+
end
|
236
|
+
|
237
|
+
if order_id.to_s.length > 36
|
238
|
+
fail ArgumentError, 'invalid value for "order_id", the character length must be smaller than or equal to 36.'
|
239
|
+
end
|
240
|
+
|
241
|
+
if order_id.to_s.length < 5
|
242
|
+
fail ArgumentError, 'invalid value for "order_id", the character length must be great than or equal to 5.'
|
243
|
+
end
|
244
|
+
|
245
|
+
@order_id = order_id
|
246
|
+
end
|
247
|
+
|
248
|
+
# Custom attribute writer method with validation
|
249
|
+
# @param [Object] phone_number Value to be assigned
|
250
|
+
def phone_number=(phone_number)
|
251
|
+
if !phone_number.nil? && phone_number.to_s.length > 10
|
252
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 10.'
|
253
|
+
end
|
254
|
+
|
255
|
+
if !phone_number.nil? && phone_number.to_s.length < 10
|
256
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be great than or equal to 10.'
|
257
|
+
end
|
258
|
+
|
259
|
+
@phone_number = phone_number
|
260
|
+
end
|
261
|
+
|
262
|
+
# Custom attribute writer method checking allowed values (enum).
|
263
|
+
# @param [Object] type Object to be assigned
|
264
|
+
def type=(type)
|
265
|
+
validator = EnumAttributeValidator.new('String', ['PUSH_NOTIFICATION', 'QR_CODE'])
|
266
|
+
unless validator.valid?(type)
|
267
|
+
fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
|
268
|
+
end
|
269
|
+
@type = type
|
270
|
+
end
|
271
|
+
|
272
|
+
# Checks equality by comparing each attribute.
|
273
|
+
# @param [Object] Object to be compared
|
274
|
+
def ==(o)
|
275
|
+
return true if self.equal?(o)
|
276
|
+
self.class == o.class &&
|
277
|
+
amount == o.amount &&
|
278
|
+
concept == o.concept &&
|
279
|
+
due_date == o.due_date &&
|
280
|
+
metadata == o.metadata &&
|
281
|
+
order_id == o.order_id &&
|
282
|
+
phone_number == o.phone_number &&
|
283
|
+
type == o.type
|
284
|
+
end
|
285
|
+
|
286
|
+
# @see the `==` method
|
287
|
+
# @param [Object] Object to be compared
|
288
|
+
def eql?(o)
|
289
|
+
self == o
|
290
|
+
end
|
291
|
+
|
292
|
+
# Calculates hash code according to all attributes.
|
293
|
+
# @return [Fixnum] Hash code
|
294
|
+
def hash
|
295
|
+
[amount, concept, due_date, metadata, order_id, phone_number, type].hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Builds the object from hash
|
299
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
300
|
+
# @return [Object] Returns the model itself
|
301
|
+
def build_from_hash(attributes)
|
302
|
+
return nil unless attributes.is_a?(Hash)
|
303
|
+
self.class.swagger_types.each_pair do |key, type|
|
304
|
+
if type =~ /\AArray<(.*)>/i
|
305
|
+
# check to ensure the input is an array given that the the attribute
|
306
|
+
# is documented as an array but the input is not
|
307
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
308
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
309
|
+
end
|
310
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
311
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
312
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
313
|
+
end
|
314
|
+
|
315
|
+
self
|
316
|
+
end
|
317
|
+
|
318
|
+
# Deserializes the data based on type
|
319
|
+
# @param string type Data type
|
320
|
+
# @param string value Value to be deserialized
|
321
|
+
# @return [Object] Deserialized data
|
322
|
+
def _deserialize(type, value)
|
323
|
+
case type.to_sym
|
324
|
+
when :DateTime
|
325
|
+
DateTime.parse(value)
|
326
|
+
when :Date
|
327
|
+
Date.parse(value)
|
328
|
+
when :String
|
329
|
+
value.to_s
|
330
|
+
when :Integer
|
331
|
+
value.to_i
|
332
|
+
when :Float
|
333
|
+
value.to_f
|
334
|
+
when :BOOLEAN
|
335
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
336
|
+
true
|
337
|
+
else
|
338
|
+
false
|
339
|
+
end
|
340
|
+
when :Object
|
341
|
+
# generic object (usually a Hash), return directly
|
342
|
+
value
|
343
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
344
|
+
inner_type = Regexp.last_match[:inner_type]
|
345
|
+
value.map { |v| _deserialize(inner_type, v) }
|
346
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
347
|
+
k_type = Regexp.last_match[:k_type]
|
348
|
+
v_type = Regexp.last_match[:v_type]
|
349
|
+
{}.tap do |hash|
|
350
|
+
value.each do |k, v|
|
351
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
352
|
+
end
|
353
|
+
end
|
354
|
+
else # model
|
355
|
+
temp_model = Wire4Client.const_get(type).new
|
356
|
+
temp_model.build_from_hash(value)
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
# Returns the string representation of the object
|
361
|
+
# @return [String] String presentation of the object
|
362
|
+
def to_s
|
363
|
+
to_hash.to_s
|
364
|
+
end
|
365
|
+
|
366
|
+
# to_body is an alias to to_hash (backward compatibility)
|
367
|
+
# @return [Hash] Returns the object in the form of hash
|
368
|
+
def to_body
|
369
|
+
to_hash
|
370
|
+
end
|
371
|
+
|
372
|
+
# Returns the object in the form of hash
|
373
|
+
# @return [Hash] Returns the object in the form of hash
|
374
|
+
def to_hash
|
375
|
+
hash = {}
|
376
|
+
self.class.attribute_map.each_pair do |attr, param|
|
377
|
+
value = self.send(attr)
|
378
|
+
next if value.nil?
|
379
|
+
hash[param] = _to_hash(value)
|
380
|
+
end
|
381
|
+
hash
|
382
|
+
end
|
383
|
+
|
384
|
+
# Outputs non-array value in the form of hash
|
385
|
+
# For object, use to_hash. Otherwise, just return the value
|
386
|
+
# @param [Object] value Any valid value
|
387
|
+
# @return [Hash] Returns the value in the form of hash
|
388
|
+
def _to_hash(value)
|
389
|
+
if value.is_a?(Array)
|
390
|
+
value.compact.map { |v| _to_hash(v) }
|
391
|
+
elsif value.is_a?(Hash)
|
392
|
+
{}.tap do |hash|
|
393
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
394
|
+
end
|
395
|
+
elsif value.respond_to? :to_hash
|
396
|
+
value.to_hash
|
397
|
+
else
|
398
|
+
value
|
399
|
+
end
|
400
|
+
end
|
401
|
+
end
|
402
|
+
end
|