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