wire4_client 0.0.1.pre.SNAPSHOT
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 +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +188 -0
- data/Rakefile +8 -0
- data/docs/Account.md +18 -0
- data/docs/AccountRequest.md +10 -0
- data/docs/AccountResponse.md +18 -0
- data/docs/AccountSpid.md +19 -0
- data/docs/AmountRequest.md +10 -0
- data/docs/Balance.md +10 -0
- data/docs/BalanceListResponse.md +8 -0
- data/docs/BeneficiariesResponse.md +8 -0
- data/docs/BeneficiaryInstitution.md +8 -0
- data/docs/Billing.md +16 -0
- data/docs/BillingTransaction.md +15 -0
- data/docs/CepResponse.md +28 -0
- data/docs/CepSearchBanxico.md +15 -0
- data/docs/ComprobanteElectrnicoDePagoCEPApi.md +61 -0
- data/docs/ContactRequest.md +12 -0
- data/docs/ContactoApi.md +60 -0
- data/docs/CuentasDeBeneficiariosSPEIApi.md +342 -0
- data/docs/CuentasDeBeneficiariosSPIDApi.md +62 -0
- data/docs/Deposit.md +27 -0
- data/docs/Depositant.md +12 -0
- data/docs/DepositantesApi.md +117 -0
- data/docs/DepositantsRegister.md +11 -0
- data/docs/DepositantsResponse.md +8 -0
- data/docs/ErrorResponse.md +9 -0
- data/docs/FacturasApi.md +115 -0
- data/docs/GetDepositants.md +8 -0
- data/docs/InstitucionesApi.md +53 -0
- data/docs/Institution.md +11 -0
- data/docs/InstitutionsList.md +8 -0
- data/docs/MessageAccountBeneficiary.md +10 -0
- data/docs/MessageCEP.md +28 -0
- data/docs/MessageDepositReceived.md +27 -0
- data/docs/MessageInstitution.md +11 -0
- data/docs/MessagePayment.md +25 -0
- data/docs/MessageSubscription.md +12 -0
- data/docs/MessageWebHook.md +16 -0
- data/docs/Payment.md +24 -0
- data/docs/Person.md +10 -0
- data/docs/PreEnrollmentData.md +9 -0
- data/docs/PreEnrollmentResponse.md +9 -0
- data/docs/Relationship.md +9 -0
- data/docs/RelationshipsResponse.md +8 -0
- data/docs/SaldoApi.md +61 -0
- data/docs/SpidClassificationDTO.md +9 -0
- data/docs/SpidClassificationsResponseDTO.md +8 -0
- data/docs/SuscripcionesApi.md +165 -0
- data/docs/Timestamp.md +17 -0
- data/docs/TokenRequiredResponse.md +9 -0
- data/docs/TransactionOutgoing.md +14 -0
- data/docs/TransactionOutgoingSpid.md +17 -0
- data/docs/TransactionsOutgoingRegister.md +10 -0
- data/docs/TransferenciasSPEIApi.md +229 -0
- data/docs/TransferenciasSPIDApi.md +117 -0
- data/docs/WebhookRequest.md +10 -0
- data/docs/WebhookResponse.md +13 -0
- data/docs/WebhooksApi.md +161 -0
- data/docs/WebhooksList.md +8 -0
- data/git_push.sh +55 -0
- data/lib/wire4_client.rb +96 -0
- data/lib/wire4_client/api/comprobante_electrnico_de_pago_cep_api.rb +77 -0
- data/lib/wire4_client/api/contacto_api.rb +76 -0
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spei_api.rb +453 -0
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spid_api.rb +93 -0
- data/lib/wire4_client/api/depositantes_api.rb +159 -0
- data/lib/wire4_client/api/facturas_api.rb +124 -0
- data/lib/wire4_client/api/instituciones_api.rb +67 -0
- data/lib/wire4_client/api/saldo_api.rb +87 -0
- data/lib/wire4_client/api/suscripciones_api.rb +203 -0
- data/lib/wire4_client/api/transferencias_spei_api.rb +307 -0
- data/lib/wire4_client/api/transferencias_spid_api.rb +155 -0
- data/lib/wire4_client/api/webhooks_api.rb +175 -0
- data/lib/wire4_client/api_client.rb +389 -0
- data/lib/wire4_client/api_error.rb +38 -0
- data/lib/wire4_client/configuration.rb +223 -0
- data/lib/wire4_client/models/account.rb +345 -0
- data/lib/wire4_client/models/account_request.rb +217 -0
- data/lib/wire4_client/models/account_response.rb +345 -0
- data/lib/wire4_client/models/account_spid.rb +388 -0
- data/lib/wire4_client/models/amount_request.rb +258 -0
- data/lib/wire4_client/models/balance.rb +205 -0
- data/lib/wire4_client/models/balance_list_response.rb +187 -0
- data/lib/wire4_client/models/beneficiaries_response.rb +186 -0
- data/lib/wire4_client/models/beneficiary_institution.rb +185 -0
- data/lib/wire4_client/models/billing.rb +300 -0
- data/lib/wire4_client/models/billing_transaction.rb +289 -0
- data/lib/wire4_client/models/cep_response.rb +384 -0
- data/lib/wire4_client/models/cep_search_banxico.rb +373 -0
- data/lib/wire4_client/models/contact_request.rb +272 -0
- data/lib/wire4_client/models/deposit.rb +374 -0
- data/lib/wire4_client/models/depositant.rb +227 -0
- data/lib/wire4_client/models/depositants_register.rb +315 -0
- data/lib/wire4_client/models/depositants_response.rb +184 -0
- data/lib/wire4_client/models/error_response.rb +192 -0
- data/lib/wire4_client/models/get_depositants.rb +192 -0
- data/lib/wire4_client/models/institution.rb +215 -0
- data/lib/wire4_client/models/institutions_list.rb +186 -0
- data/lib/wire4_client/models/message_account_beneficiary.rb +205 -0
- data/lib/wire4_client/models/message_cep.rb +385 -0
- data/lib/wire4_client/models/message_deposit_received.rb +375 -0
- data/lib/wire4_client/models/message_institution.rb +215 -0
- data/lib/wire4_client/models/message_payment.rb +354 -0
- data/lib/wire4_client/models/message_subscription.rb +225 -0
- data/lib/wire4_client/models/message_web_hook.rb +265 -0
- data/lib/wire4_client/models/payment.rb +344 -0
- data/lib/wire4_client/models/person.rb +220 -0
- data/lib/wire4_client/models/pre_enrollment_data.rb +260 -0
- data/lib/wire4_client/models/pre_enrollment_response.rb +194 -0
- data/lib/wire4_client/models/relationship.rb +194 -0
- data/lib/wire4_client/models/relationships_response.rb +186 -0
- data/lib/wire4_client/models/spid_classification_dto.rb +195 -0
- data/lib/wire4_client/models/spid_classifications_response_dto.rb +186 -0
- data/lib/wire4_client/models/timestamp.rb +264 -0
- data/lib/wire4_client/models/token_required_response.rb +195 -0
- data/lib/wire4_client/models/transaction_outgoing.rb +380 -0
- data/lib/wire4_client/models/transaction_outgoing_spid.rb +425 -0
- data/lib/wire4_client/models/transactions_outgoing_register.rb +222 -0
- data/lib/wire4_client/models/webhook_request.rb +222 -0
- data/lib/wire4_client/models/webhook_response.rb +271 -0
- data/lib/wire4_client/models/webhooks_list.rb +186 -0
- data/lib/wire4_client/version.rb +15 -0
- data/spec/api/comprobante_electrnico_de_pago_cep_api_spec.rb +47 -0
- data/spec/api/contacto_api_spec.rb +47 -0
- data/spec/api/cuentas_de_beneficiarios_spei_api_spec.rb +113 -0
- data/spec/api/cuentas_de_beneficiarios_spid_api_spec.rb +47 -0
- data/spec/api/depositantes_api_spec.rb +60 -0
- data/spec/api/facturas_api_spec.rb +59 -0
- data/spec/api/instituciones_api_spec.rb +45 -0
- data/spec/api/saldo_api_spec.rb +47 -0
- data/spec/api/suscripciones_api_spec.rb +71 -0
- data/spec/api/transferencias_spei_api_spec.rb +86 -0
- data/spec/api/transferencias_spid_api_spec.rb +60 -0
- data/spec/api/webhooks_api_spec.rb +70 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_request_spec.rb +53 -0
- data/spec/models/account_response_spec.rb +101 -0
- data/spec/models/account_spec.rb +101 -0
- data/spec/models/account_spid_spec.rb +107 -0
- data/spec/models/amount_request_spec.rb +53 -0
- data/spec/models/balance_list_response_spec.rb +41 -0
- data/spec/models/balance_spec.rb +53 -0
- data/spec/models/beneficiaries_response_spec.rb +41 -0
- data/spec/models/beneficiary_institution_spec.rb +41 -0
- data/spec/models/billing_spec.rb +93 -0
- data/spec/models/billing_transaction_spec.rb +87 -0
- data/spec/models/cep_response_spec.rb +161 -0
- data/spec/models/cep_search_banxico_spec.rb +83 -0
- data/spec/models/contact_request_spec.rb +65 -0
- data/spec/models/deposit_spec.rb +155 -0
- data/spec/models/depositant_spec.rb +65 -0
- data/spec/models/depositants_register_spec.rb +59 -0
- data/spec/models/depositants_response_spec.rb +41 -0
- data/spec/models/error_response_spec.rb +47 -0
- data/spec/models/get_depositants_spec.rb +41 -0
- data/spec/models/institution_spec.rb +59 -0
- data/spec/models/institutions_list_spec.rb +41 -0
- data/spec/models/message_account_beneficiary_spec.rb +53 -0
- data/spec/models/message_cep_spec.rb +161 -0
- data/spec/models/message_deposit_received_spec.rb +155 -0
- data/spec/models/message_institution_spec.rb +59 -0
- data/spec/models/message_payment_spec.rb +143 -0
- data/spec/models/message_subscription_spec.rb +65 -0
- data/spec/models/message_web_hook_spec.rb +89 -0
- data/spec/models/payment_spec.rb +137 -0
- data/spec/models/person_spec.rb +53 -0
- data/spec/models/pre_enrollment_data_spec.rb +47 -0
- data/spec/models/pre_enrollment_response_spec.rb +47 -0
- data/spec/models/relationship_spec.rb +47 -0
- data/spec/models/relationships_response_spec.rb +41 -0
- data/spec/models/spid_classification_dto_spec.rb +47 -0
- data/spec/models/spid_classifications_response_dto_spec.rb +41 -0
- data/spec/models/timestamp_spec.rb +95 -0
- data/spec/models/token_required_response_spec.rb +47 -0
- data/spec/models/transaction_outgoing_spec.rb +77 -0
- data/spec/models/transaction_outgoing_spid_spec.rb +95 -0
- data/spec/models/transactions_outgoing_register_spec.rb +53 -0
- data/spec/models/webhook_request_spec.rb +53 -0
- data/spec/models/webhook_response_spec.rb +75 -0
- data/spec/models/webhooks_list_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- data/wire4_client.gemspec +45 -0
- metadata +468 -0
@@ -0,0 +1,388 @@
|
|
1
|
+
=begin
|
2
|
+
#Wire4RestAPI
|
3
|
+
|
4
|
+
#Referencia de la API de Wire4
|
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
|
+
# Objeto que contiene información de la cuenta
|
17
|
+
class AccountSpid
|
18
|
+
# Monto límite permitido para la cuenta
|
19
|
+
attr_accessor :amount_limit
|
20
|
+
|
21
|
+
# Código banxico con una longitud de 5 dígitos, es requerido en caso de que la cuenta del beneficiario sea un número de celular
|
22
|
+
attr_accessor :bank_code_banxico
|
23
|
+
|
24
|
+
# Cuenta del beneficiario debe ser una cuenta CLABE
|
25
|
+
attr_accessor :beneficiary_account
|
26
|
+
|
27
|
+
# Url a la que se redirigira en caso no exitoso
|
28
|
+
attr_accessor :cancel_return_url
|
29
|
+
|
30
|
+
# Lista de email's, este dato es opcional
|
31
|
+
attr_accessor :email
|
32
|
+
|
33
|
+
# Objeto que contiene el nombre de la institución, es mutuamente exclusivo con el objeto Person
|
34
|
+
attr_accessor :institution
|
35
|
+
|
36
|
+
# Tipo de relación de la cuentaobtained of endpoint relationships
|
37
|
+
attr_accessor :kind_of_relationship
|
38
|
+
|
39
|
+
# Referencia numérica
|
40
|
+
attr_accessor :numeric_reference
|
41
|
+
|
42
|
+
# Concepto de pago
|
43
|
+
attr_accessor :payment_concept
|
44
|
+
|
45
|
+
# Código de relación de la cuenta, este valor debe ser igual a un valor obtenido del endpoint relationship
|
46
|
+
attr_accessor :relationship
|
47
|
+
|
48
|
+
# Url a la que se redireccionara en caso exitoso
|
49
|
+
attr_accessor :return_url
|
50
|
+
|
51
|
+
# Registro federal de contribuyentes
|
52
|
+
attr_accessor :rfc
|
53
|
+
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
55
|
+
def self.attribute_map
|
56
|
+
{
|
57
|
+
:'amount_limit' => :'amount_limit',
|
58
|
+
:'bank_code_banxico' => :'bank_code_banxico',
|
59
|
+
:'beneficiary_account' => :'beneficiary_account',
|
60
|
+
:'cancel_return_url' => :'cancel_return_url',
|
61
|
+
:'email' => :'email',
|
62
|
+
:'institution' => :'institution',
|
63
|
+
:'kind_of_relationship' => :'kind_of_relationship',
|
64
|
+
:'numeric_reference' => :'numeric_reference',
|
65
|
+
:'payment_concept' => :'payment_concept',
|
66
|
+
:'relationship' => :'relationship',
|
67
|
+
:'return_url' => :'return_url',
|
68
|
+
:'rfc' => :'rfc'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.swagger_types
|
74
|
+
{
|
75
|
+
:'amount_limit' => :'Float',
|
76
|
+
:'bank_code_banxico' => :'String',
|
77
|
+
:'beneficiary_account' => :'String',
|
78
|
+
:'cancel_return_url' => :'String',
|
79
|
+
:'email' => :'Array<String>',
|
80
|
+
:'institution' => :'BeneficiaryInstitution',
|
81
|
+
:'kind_of_relationship' => :'String',
|
82
|
+
:'numeric_reference' => :'String',
|
83
|
+
:'payment_concept' => :'String',
|
84
|
+
:'relationship' => :'String',
|
85
|
+
:'return_url' => :'String',
|
86
|
+
:'rfc' => :'String'
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
# Initializes the object
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
def initialize(attributes = {})
|
93
|
+
return unless attributes.is_a?(Hash)
|
94
|
+
|
95
|
+
# convert string to symbol for hash key
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
97
|
+
|
98
|
+
if attributes.has_key?(:'amount_limit')
|
99
|
+
self.amount_limit = attributes[:'amount_limit']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'bank_code_banxico')
|
103
|
+
self.bank_code_banxico = attributes[:'bank_code_banxico']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'beneficiary_account')
|
107
|
+
self.beneficiary_account = attributes[:'beneficiary_account']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'cancel_return_url')
|
111
|
+
self.cancel_return_url = attributes[:'cancel_return_url']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'email')
|
115
|
+
if (value = attributes[:'email']).is_a?(Array)
|
116
|
+
self.email = value
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.has_key?(:'institution')
|
121
|
+
self.institution = attributes[:'institution']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.has_key?(:'kind_of_relationship')
|
125
|
+
self.kind_of_relationship = attributes[:'kind_of_relationship']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.has_key?(:'numeric_reference')
|
129
|
+
self.numeric_reference = attributes[:'numeric_reference']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.has_key?(:'payment_concept')
|
133
|
+
self.payment_concept = attributes[:'payment_concept']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.has_key?(:'relationship')
|
137
|
+
self.relationship = attributes[:'relationship']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.has_key?(:'return_url')
|
141
|
+
self.return_url = attributes[:'return_url']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.has_key?(:'rfc')
|
145
|
+
self.rfc = attributes[:'rfc']
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
150
|
+
# @return Array for valid properties with the reasons
|
151
|
+
def list_invalid_properties
|
152
|
+
invalid_properties = Array.new
|
153
|
+
if @amount_limit.nil?
|
154
|
+
invalid_properties.push('invalid value for "amount_limit", amount_limit cannot be nil.')
|
155
|
+
end
|
156
|
+
|
157
|
+
if !@bank_code_banxico.nil? && @bank_code_banxico.to_s.length > 5
|
158
|
+
invalid_properties.push('invalid value for "bank_code_banxico", the character length must be smaller than or equal to 5.')
|
159
|
+
end
|
160
|
+
|
161
|
+
if !@bank_code_banxico.nil? && @bank_code_banxico.to_s.length < 5
|
162
|
+
invalid_properties.push('invalid value for "bank_code_banxico", the character length must be great than or equal to 5.')
|
163
|
+
end
|
164
|
+
|
165
|
+
if !@bank_code_banxico.nil? && @bank_code_banxico !~ Regexp.new(/[0-9][0-9]*/)
|
166
|
+
invalid_properties.push('invalid value for "bank_code_banxico", must conform to the pattern /[0-9][0-9]*/.')
|
167
|
+
end
|
168
|
+
|
169
|
+
if @beneficiary_account.nil?
|
170
|
+
invalid_properties.push('invalid value for "beneficiary_account", beneficiary_account cannot be nil.')
|
171
|
+
end
|
172
|
+
|
173
|
+
if @institution.nil?
|
174
|
+
invalid_properties.push('invalid value for "institution", institution cannot be nil.')
|
175
|
+
end
|
176
|
+
|
177
|
+
if @kind_of_relationship.nil?
|
178
|
+
invalid_properties.push('invalid value for "kind_of_relationship", kind_of_relationship cannot be nil.')
|
179
|
+
end
|
180
|
+
|
181
|
+
if !@numeric_reference.nil? && @numeric_reference.to_s.length > 7
|
182
|
+
invalid_properties.push('invalid value for "numeric_reference", the character length must be smaller than or equal to 7.')
|
183
|
+
end
|
184
|
+
|
185
|
+
if !@numeric_reference.nil? && @numeric_reference.to_s.length < 1
|
186
|
+
invalid_properties.push('invalid value for "numeric_reference", the character length must be great than or equal to 1.')
|
187
|
+
end
|
188
|
+
|
189
|
+
if !@numeric_reference.nil? && @numeric_reference !~ Regexp.new(/[0-9][0-9]*/)
|
190
|
+
invalid_properties.push('invalid value for "numeric_reference", must conform to the pattern /[0-9][0-9]*/.')
|
191
|
+
end
|
192
|
+
|
193
|
+
if @relationship.nil?
|
194
|
+
invalid_properties.push('invalid value for "relationship", relationship cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
invalid_properties
|
198
|
+
end
|
199
|
+
|
200
|
+
# Check to see if the all the properties in the model are valid
|
201
|
+
# @return true if the model is valid
|
202
|
+
def valid?
|
203
|
+
return false if @amount_limit.nil?
|
204
|
+
return false if !@bank_code_banxico.nil? && @bank_code_banxico.to_s.length > 5
|
205
|
+
return false if !@bank_code_banxico.nil? && @bank_code_banxico.to_s.length < 5
|
206
|
+
return false if !@bank_code_banxico.nil? && @bank_code_banxico !~ Regexp.new(/[0-9][0-9]*/)
|
207
|
+
return false if @beneficiary_account.nil?
|
208
|
+
return false if @institution.nil?
|
209
|
+
return false if @kind_of_relationship.nil?
|
210
|
+
return false if !@numeric_reference.nil? && @numeric_reference.to_s.length > 7
|
211
|
+
return false if !@numeric_reference.nil? && @numeric_reference.to_s.length < 1
|
212
|
+
return false if !@numeric_reference.nil? && @numeric_reference !~ Regexp.new(/[0-9][0-9]*/)
|
213
|
+
return false if @relationship.nil?
|
214
|
+
true
|
215
|
+
end
|
216
|
+
|
217
|
+
# Custom attribute writer method with validation
|
218
|
+
# @param [Object] bank_code_banxico Value to be assigned
|
219
|
+
def bank_code_banxico=(bank_code_banxico)
|
220
|
+
if !bank_code_banxico.nil? && bank_code_banxico.to_s.length > 5
|
221
|
+
fail ArgumentError, 'invalid value for "bank_code_banxico", the character length must be smaller than or equal to 5.'
|
222
|
+
end
|
223
|
+
|
224
|
+
if !bank_code_banxico.nil? && bank_code_banxico.to_s.length < 5
|
225
|
+
fail ArgumentError, 'invalid value for "bank_code_banxico", the character length must be great than or equal to 5.'
|
226
|
+
end
|
227
|
+
|
228
|
+
if !bank_code_banxico.nil? && bank_code_banxico !~ Regexp.new(/[0-9][0-9]*/)
|
229
|
+
fail ArgumentError, 'invalid value for "bank_code_banxico", must conform to the pattern /[0-9][0-9]*/.'
|
230
|
+
end
|
231
|
+
|
232
|
+
@bank_code_banxico = bank_code_banxico
|
233
|
+
end
|
234
|
+
|
235
|
+
# Custom attribute writer method with validation
|
236
|
+
# @param [Object] numeric_reference Value to be assigned
|
237
|
+
def numeric_reference=(numeric_reference)
|
238
|
+
if !numeric_reference.nil? && numeric_reference.to_s.length > 7
|
239
|
+
fail ArgumentError, 'invalid value for "numeric_reference", the character length must be smaller than or equal to 7.'
|
240
|
+
end
|
241
|
+
|
242
|
+
if !numeric_reference.nil? && numeric_reference.to_s.length < 1
|
243
|
+
fail ArgumentError, 'invalid value for "numeric_reference", the character length must be great than or equal to 1.'
|
244
|
+
end
|
245
|
+
|
246
|
+
if !numeric_reference.nil? && numeric_reference !~ Regexp.new(/[0-9][0-9]*/)
|
247
|
+
fail ArgumentError, 'invalid value for "numeric_reference", must conform to the pattern /[0-9][0-9]*/.'
|
248
|
+
end
|
249
|
+
|
250
|
+
@numeric_reference = numeric_reference
|
251
|
+
end
|
252
|
+
|
253
|
+
# Checks equality by comparing each attribute.
|
254
|
+
# @param [Object] Object to be compared
|
255
|
+
def ==(o)
|
256
|
+
return true if self.equal?(o)
|
257
|
+
self.class == o.class &&
|
258
|
+
amount_limit == o.amount_limit &&
|
259
|
+
bank_code_banxico == o.bank_code_banxico &&
|
260
|
+
beneficiary_account == o.beneficiary_account &&
|
261
|
+
cancel_return_url == o.cancel_return_url &&
|
262
|
+
email == o.email &&
|
263
|
+
institution == o.institution &&
|
264
|
+
kind_of_relationship == o.kind_of_relationship &&
|
265
|
+
numeric_reference == o.numeric_reference &&
|
266
|
+
payment_concept == o.payment_concept &&
|
267
|
+
relationship == o.relationship &&
|
268
|
+
return_url == o.return_url &&
|
269
|
+
rfc == o.rfc
|
270
|
+
end
|
271
|
+
|
272
|
+
# @see the `==` method
|
273
|
+
# @param [Object] Object to be compared
|
274
|
+
def eql?(o)
|
275
|
+
self == o
|
276
|
+
end
|
277
|
+
|
278
|
+
# Calculates hash code according to all attributes.
|
279
|
+
# @return [Fixnum] Hash code
|
280
|
+
def hash
|
281
|
+
[amount_limit, bank_code_banxico, beneficiary_account, cancel_return_url, email, institution, kind_of_relationship, numeric_reference, payment_concept, relationship, return_url, rfc].hash
|
282
|
+
end
|
283
|
+
|
284
|
+
# Builds the object from hash
|
285
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
286
|
+
# @return [Object] Returns the model itself
|
287
|
+
def build_from_hash(attributes)
|
288
|
+
return nil unless attributes.is_a?(Hash)
|
289
|
+
self.class.swagger_types.each_pair do |key, type|
|
290
|
+
if type =~ /\AArray<(.*)>/i
|
291
|
+
# check to ensure the input is an array given that the the attribute
|
292
|
+
# is documented as an array but the input is not
|
293
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
294
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
295
|
+
end
|
296
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
297
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
298
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
299
|
+
end
|
300
|
+
|
301
|
+
self
|
302
|
+
end
|
303
|
+
|
304
|
+
# Deserializes the data based on type
|
305
|
+
# @param string type Data type
|
306
|
+
# @param string value Value to be deserialized
|
307
|
+
# @return [Object] Deserialized data
|
308
|
+
def _deserialize(type, value)
|
309
|
+
case type.to_sym
|
310
|
+
when :DateTime
|
311
|
+
DateTime.parse(value)
|
312
|
+
when :Date
|
313
|
+
Date.parse(value)
|
314
|
+
when :String
|
315
|
+
value.to_s
|
316
|
+
when :Integer
|
317
|
+
value.to_i
|
318
|
+
when :Float
|
319
|
+
value.to_f
|
320
|
+
when :BOOLEAN
|
321
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
322
|
+
true
|
323
|
+
else
|
324
|
+
false
|
325
|
+
end
|
326
|
+
when :Object
|
327
|
+
# generic object (usually a Hash), return directly
|
328
|
+
value
|
329
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
330
|
+
inner_type = Regexp.last_match[:inner_type]
|
331
|
+
value.map { |v| _deserialize(inner_type, v) }
|
332
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
333
|
+
k_type = Regexp.last_match[:k_type]
|
334
|
+
v_type = Regexp.last_match[:v_type]
|
335
|
+
{}.tap do |hash|
|
336
|
+
value.each do |k, v|
|
337
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
338
|
+
end
|
339
|
+
end
|
340
|
+
else # model
|
341
|
+
temp_model = Wire4Client.const_get(type).new
|
342
|
+
temp_model.build_from_hash(value)
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
# Returns the string representation of the object
|
347
|
+
# @return [String] String presentation of the object
|
348
|
+
def to_s
|
349
|
+
to_hash.to_s
|
350
|
+
end
|
351
|
+
|
352
|
+
# to_body is an alias to to_hash (backward compatibility)
|
353
|
+
# @return [Hash] Returns the object in the form of hash
|
354
|
+
def to_body
|
355
|
+
to_hash
|
356
|
+
end
|
357
|
+
|
358
|
+
# Returns the object in the form of hash
|
359
|
+
# @return [Hash] Returns the object in the form of hash
|
360
|
+
def to_hash
|
361
|
+
hash = {}
|
362
|
+
self.class.attribute_map.each_pair do |attr, param|
|
363
|
+
value = self.send(attr)
|
364
|
+
next if value.nil?
|
365
|
+
hash[param] = _to_hash(value)
|
366
|
+
end
|
367
|
+
hash
|
368
|
+
end
|
369
|
+
|
370
|
+
# Outputs non-array value in the form of hash
|
371
|
+
# For object, use to_hash. Otherwise, just return the value
|
372
|
+
# @param [Object] value Any valid value
|
373
|
+
# @return [Hash] Returns the value in the form of hash
|
374
|
+
def _to_hash(value)
|
375
|
+
if value.is_a?(Array)
|
376
|
+
value.compact.map { |v| _to_hash(v) }
|
377
|
+
elsif value.is_a?(Hash)
|
378
|
+
{}.tap do |hash|
|
379
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
380
|
+
end
|
381
|
+
elsif value.respond_to? :to_hash
|
382
|
+
value.to_hash
|
383
|
+
else
|
384
|
+
value
|
385
|
+
end
|
386
|
+
end
|
387
|
+
end
|
388
|
+
end
|
@@ -0,0 +1,258 @@
|
|
1
|
+
=begin
|
2
|
+
#Wire4RestAPI
|
3
|
+
|
4
|
+
#Referencia de la API de Wire4
|
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
|
+
# Objeto que contiene la información del previo y nuevo monto límite
|
17
|
+
class AmountRequest
|
18
|
+
# Nuevo monto límite que reemplazará al actual, un monto de 0.0 implica que no hay límite
|
19
|
+
attr_accessor :amount_limit
|
20
|
+
|
21
|
+
# Código de moneda de la cuenta
|
22
|
+
attr_accessor :currency_code
|
23
|
+
|
24
|
+
# Monto límite registrado actualmente, un monto de 0.0 implica que no hay límite
|
25
|
+
attr_accessor :previous_amount_limit
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'amount_limit' => :'amount_limit',
|
31
|
+
:'currency_code' => :'currency_code',
|
32
|
+
:'previous_amount_limit' => :'previous_amount_limit'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.swagger_types
|
38
|
+
{
|
39
|
+
:'amount_limit' => :'Float',
|
40
|
+
:'currency_code' => :'String',
|
41
|
+
:'previous_amount_limit' => :'Float'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
52
|
+
|
53
|
+
if attributes.has_key?(:'amount_limit')
|
54
|
+
self.amount_limit = attributes[:'amount_limit']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'currency_code')
|
58
|
+
self.currency_code = attributes[:'currency_code']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'previous_amount_limit')
|
62
|
+
self.previous_amount_limit = attributes[:'previous_amount_limit']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
if @amount_limit.nil?
|
71
|
+
invalid_properties.push('invalid value for "amount_limit", amount_limit cannot be nil.')
|
72
|
+
end
|
73
|
+
|
74
|
+
if @amount_limit < 0.0
|
75
|
+
invalid_properties.push('invalid value for "amount_limit", must be greater than or equal to 0.0.')
|
76
|
+
end
|
77
|
+
|
78
|
+
if @currency_code.nil?
|
79
|
+
invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
|
80
|
+
end
|
81
|
+
|
82
|
+
if @previous_amount_limit.nil?
|
83
|
+
invalid_properties.push('invalid value for "previous_amount_limit", previous_amount_limit cannot be nil.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if @previous_amount_limit < 0.0
|
87
|
+
invalid_properties.push('invalid value for "previous_amount_limit", must be greater than or equal to 0.0.')
|
88
|
+
end
|
89
|
+
|
90
|
+
invalid_properties
|
91
|
+
end
|
92
|
+
|
93
|
+
# Check to see if the all the properties in the model are valid
|
94
|
+
# @return true if the model is valid
|
95
|
+
def valid?
|
96
|
+
return false if @amount_limit.nil?
|
97
|
+
return false if @amount_limit < 0.0
|
98
|
+
return false if @currency_code.nil?
|
99
|
+
return false if @previous_amount_limit.nil?
|
100
|
+
return false if @previous_amount_limit < 0.0
|
101
|
+
true
|
102
|
+
end
|
103
|
+
|
104
|
+
# Custom attribute writer method with validation
|
105
|
+
# @param [Object] amount_limit Value to be assigned
|
106
|
+
def amount_limit=(amount_limit)
|
107
|
+
if amount_limit.nil?
|
108
|
+
fail ArgumentError, 'amount_limit cannot be nil'
|
109
|
+
end
|
110
|
+
|
111
|
+
if amount_limit < 0.0
|
112
|
+
fail ArgumentError, 'invalid value for "amount_limit", must be greater than or equal to 0.0.'
|
113
|
+
end
|
114
|
+
|
115
|
+
@amount_limit = amount_limit
|
116
|
+
end
|
117
|
+
|
118
|
+
# Custom attribute writer method with validation
|
119
|
+
# @param [Object] previous_amount_limit Value to be assigned
|
120
|
+
def previous_amount_limit=(previous_amount_limit)
|
121
|
+
if previous_amount_limit.nil?
|
122
|
+
fail ArgumentError, 'previous_amount_limit cannot be nil'
|
123
|
+
end
|
124
|
+
|
125
|
+
if previous_amount_limit < 0.0
|
126
|
+
fail ArgumentError, 'invalid value for "previous_amount_limit", must be greater than or equal to 0.0.'
|
127
|
+
end
|
128
|
+
|
129
|
+
@previous_amount_limit = previous_amount_limit
|
130
|
+
end
|
131
|
+
|
132
|
+
# Checks equality by comparing each attribute.
|
133
|
+
# @param [Object] Object to be compared
|
134
|
+
def ==(o)
|
135
|
+
return true if self.equal?(o)
|
136
|
+
self.class == o.class &&
|
137
|
+
amount_limit == o.amount_limit &&
|
138
|
+
currency_code == o.currency_code &&
|
139
|
+
previous_amount_limit == o.previous_amount_limit
|
140
|
+
end
|
141
|
+
|
142
|
+
# @see the `==` method
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def eql?(o)
|
145
|
+
self == o
|
146
|
+
end
|
147
|
+
|
148
|
+
# Calculates hash code according to all attributes.
|
149
|
+
# @return [Fixnum] Hash code
|
150
|
+
def hash
|
151
|
+
[amount_limit, currency_code, previous_amount_limit].hash
|
152
|
+
end
|
153
|
+
|
154
|
+
# Builds the object from hash
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
# @return [Object] Returns the model itself
|
157
|
+
def build_from_hash(attributes)
|
158
|
+
return nil unless attributes.is_a?(Hash)
|
159
|
+
self.class.swagger_types.each_pair do |key, type|
|
160
|
+
if type =~ /\AArray<(.*)>/i
|
161
|
+
# check to ensure the input is an array given that the the attribute
|
162
|
+
# is documented as an array but the input is not
|
163
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
164
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
165
|
+
end
|
166
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
167
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
168
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
169
|
+
end
|
170
|
+
|
171
|
+
self
|
172
|
+
end
|
173
|
+
|
174
|
+
# Deserializes the data based on type
|
175
|
+
# @param string type Data type
|
176
|
+
# @param string value Value to be deserialized
|
177
|
+
# @return [Object] Deserialized data
|
178
|
+
def _deserialize(type, value)
|
179
|
+
case type.to_sym
|
180
|
+
when :DateTime
|
181
|
+
DateTime.parse(value)
|
182
|
+
when :Date
|
183
|
+
Date.parse(value)
|
184
|
+
when :String
|
185
|
+
value.to_s
|
186
|
+
when :Integer
|
187
|
+
value.to_i
|
188
|
+
when :Float
|
189
|
+
value.to_f
|
190
|
+
when :BOOLEAN
|
191
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
192
|
+
true
|
193
|
+
else
|
194
|
+
false
|
195
|
+
end
|
196
|
+
when :Object
|
197
|
+
# generic object (usually a Hash), return directly
|
198
|
+
value
|
199
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
200
|
+
inner_type = Regexp.last_match[:inner_type]
|
201
|
+
value.map { |v| _deserialize(inner_type, v) }
|
202
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
203
|
+
k_type = Regexp.last_match[:k_type]
|
204
|
+
v_type = Regexp.last_match[:v_type]
|
205
|
+
{}.tap do |hash|
|
206
|
+
value.each do |k, v|
|
207
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
else # model
|
211
|
+
temp_model = Wire4Client.const_get(type).new
|
212
|
+
temp_model.build_from_hash(value)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the string representation of the object
|
217
|
+
# @return [String] String presentation of the object
|
218
|
+
def to_s
|
219
|
+
to_hash.to_s
|
220
|
+
end
|
221
|
+
|
222
|
+
# to_body is an alias to to_hash (backward compatibility)
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_body
|
225
|
+
to_hash
|
226
|
+
end
|
227
|
+
|
228
|
+
# Returns the object in the form of hash
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
230
|
+
def to_hash
|
231
|
+
hash = {}
|
232
|
+
self.class.attribute_map.each_pair do |attr, param|
|
233
|
+
value = self.send(attr)
|
234
|
+
next if value.nil?
|
235
|
+
hash[param] = _to_hash(value)
|
236
|
+
end
|
237
|
+
hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Outputs non-array value in the form of hash
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
242
|
+
# @param [Object] value Any valid value
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
244
|
+
def _to_hash(value)
|
245
|
+
if value.is_a?(Array)
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
247
|
+
elsif value.is_a?(Hash)
|
248
|
+
{}.tap do |hash|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
250
|
+
end
|
251
|
+
elsif value.respond_to? :to_hash
|
252
|
+
value.to_hash
|
253
|
+
else
|
254
|
+
value
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|