wire4_client 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +28 -1
  4. data/docs/AccountReassigned.md +1 -1
  5. data/docs/AccountResponse.md +1 -0
  6. data/docs/BeneficiaryDTO.md +10 -0
  7. data/docs/CargosRecurrentesApi.md +110 -0
  8. data/docs/CepResponse.md +1 -0
  9. data/docs/CepSearchBanxico.md +1 -0
  10. data/docs/CertificateRequest.md +1 -1
  11. data/docs/CodiCodeQrResponseDTO.md +1 -0
  12. data/docs/CodiCodeRequestDTO.md +6 -3
  13. data/docs/ConfirmRecurringCharge.md +9 -0
  14. data/docs/CuentasDeBeneficiariosSPEIApi.md +4 -0
  15. data/docs/CuentasDeBeneficiariosSPIDApi.md +4 -0
  16. data/docs/Customer.md +9 -0
  17. data/docs/Deposit.md +1 -0
  18. data/docs/Depositant.md +1 -0
  19. data/docs/DepositantCountResponse.md +8 -0
  20. data/docs/DepositantesApi.md +164 -1
  21. data/docs/FailedChargesDataDTO.md +13 -0
  22. data/docs/MessageDepositReceived.md +3 -0
  23. data/docs/PaymentRequestReportDTO.md +17 -0
  24. data/docs/PaymentRequestReq.md +18 -0
  25. data/docs/PaymentRequestResponse.md +10 -0
  26. data/docs/PaymentsSpeiAndSpidOrderId.md +9 -0
  27. data/docs/PaymentsSpeiAndSpidRequestId.md +12 -0
  28. data/docs/Person.md +1 -1
  29. data/docs/Product.md +11 -0
  30. data/docs/RecurringChargeRequest.md +14 -0
  31. data/docs/ReporteDeSolicitudesDePagosApi.md +107 -0
  32. data/docs/SolicitudDePagosApi.md +59 -0
  33. data/docs/SpidBeneficiaryResponse.md +1 -0
  34. data/docs/SuccessChargesDataDTO.md +12 -0
  35. data/docs/SuccessDataDTO.md +9 -0
  36. data/docs/TransactionSpeiSpid.md +15 -0
  37. data/docs/TransactionsRegister.md +11 -0
  38. data/docs/TransferenciasSPEIApi.md +163 -0
  39. data/lib/wire4_client/api/cargos_recurrentes_api.rb +143 -0
  40. data/lib/wire4_client/api/cuentas_de_beneficiarios_spei_api.rb +6 -0
  41. data/lib/wire4_client/api/cuentas_de_beneficiarios_spid_api.rb +6 -0
  42. data/lib/wire4_client/api/depositantes_api.rb +138 -4
  43. data/lib/wire4_client/api/reporte_de_solicitudes_de_pagos_api.rb +134 -0
  44. data/lib/wire4_client/api/solicitud_de_pagos_api.rb +84 -0
  45. data/lib/wire4_client/api/transferencias_spei_api.rb +234 -4
  46. data/lib/wire4_client/models/account_reassigned.rb +11 -11
  47. data/lib/wire4_client/models/account_response.rb +11 -1
  48. data/lib/wire4_client/models/amount_request.rb +10 -10
  49. data/lib/wire4_client/models/beneficiary_dto.rb +201 -0
  50. data/lib/wire4_client/models/cep_response.rb +45 -1
  51. data/lib/wire4_client/models/cep_search_banxico.rb +48 -4
  52. data/lib/wire4_client/models/certificate_request.rb +6 -15
  53. data/lib/wire4_client/models/codi_code_qr_response_dto.rb +15 -5
  54. data/lib/wire4_client/models/codi_code_request_dto.rb +94 -20
  55. data/lib/wire4_client/models/codi_operations_filters_request_dto.rb +2 -2
  56. data/lib/wire4_client/models/confirm_recurring_charge.rb +194 -0
  57. data/lib/wire4_client/models/customer.rb +205 -0
  58. data/lib/wire4_client/models/deposit.rb +48 -4
  59. data/lib/wire4_client/models/depositant.rb +14 -4
  60. data/lib/wire4_client/models/failed_charges_data_dto.rb +228 -0
  61. data/lib/wire4_client/models/message_deposit_received.rb +31 -1
  62. data/lib/wire4_client/models/operations.rb +4 -4
  63. data/lib/wire4_client/models/payment_codi.rb +2 -2
  64. data/lib/wire4_client/models/payment_request_report_dto.rb +300 -0
  65. data/lib/wire4_client/models/payment_request_req.rb +401 -0
  66. data/lib/wire4_client/models/payment_request_response.rb +204 -0
  67. data/lib/wire4_client/models/payments_spei_and_spid_order_id.rb +199 -0
  68. data/lib/wire4_client/models/payments_spei_and_spid_request_id.rb +229 -0
  69. data/lib/wire4_client/models/person.rb +0 -5
  70. data/lib/wire4_client/models/product.rb +288 -0
  71. data/lib/wire4_client/models/recurring_charge_request.rb +278 -0
  72. data/lib/wire4_client/models/sales_point_request.rb +5 -5
  73. data/lib/wire4_client/models/spid_beneficiary_response.rb +11 -1
  74. data/lib/wire4_client/models/success_charges_data_dto.rb +219 -0
  75. data/lib/wire4_client/models/success_data_dto.rb +226 -0
  76. data/lib/wire4_client/models/transaction_outgoing.rb +5 -5
  77. data/lib/wire4_client/models/transaction_spei_spid.rb +390 -0
  78. data/lib/wire4_client/models/transactions_register.rb +229 -0
  79. data/lib/wire4_client/version.rb +1 -1
  80. data/lib/wire4_client.rb +18 -0
  81. data/spec/api/cargos_recurrentes_api_spec.rb +61 -0
  82. data/spec/api/cuentas_de_beneficiarios_spei_api_spec.rb +2 -0
  83. data/spec/api/cuentas_de_beneficiarios_spid_api_spec.rb +2 -0
  84. data/spec/api/depositantes_api_spec.rb +42 -1
  85. data/spec/api/reporte_de_solicitudes_de_pagos_api_spec.rb +59 -0
  86. data/spec/api/solicitud_de_pagos_api_spec.rb +48 -0
  87. data/spec/api/transferencias_spei_api_spec.rb +42 -0
  88. data/spec/models/account_reassigned_spec.rb +3 -3
  89. data/spec/models/account_response_spec.rb +6 -0
  90. data/spec/models/beneficiary_dto_spec.rb +53 -0
  91. data/spec/models/cep_response_spec.rb +10 -0
  92. data/spec/models/cep_search_banxico_spec.rb +10 -0
  93. data/spec/models/codi_code_qr_response_dto_spec.rb +8 -2
  94. data/spec/models/codi_code_request_dto_spec.rb +23 -1
  95. data/spec/models/codi_operations_filters_request_dto_spec.rb +1 -1
  96. data/spec/models/confirm_recurring_charge_spec.rb +47 -0
  97. data/spec/models/customer_spec.rb +47 -0
  98. data/spec/models/deposit_spec.rb +10 -0
  99. data/spec/models/depositant_count_response_spec.rb +41 -0
  100. data/spec/models/depositant_spec.rb +6 -0
  101. data/spec/models/failed_charges_data_dto_spec.rb +71 -0
  102. data/spec/models/message_deposit_received_spec.rb +18 -0
  103. data/spec/models/operations_spec.rb +2 -2
  104. data/spec/models/payment_codi_spec.rb +1 -1
  105. data/spec/models/payment_request_report_dto_spec.rb +99 -0
  106. data/spec/models/payment_request_req_spec.rb +109 -0
  107. data/spec/models/payment_request_response_spec.rb +53 -0
  108. data/spec/models/payments_spei_and_spid_order_id_spec.rb +47 -0
  109. data/spec/models/payments_spei_and_spid_request_id_spec.rb +65 -0
  110. data/spec/models/product_spec.rb +63 -0
  111. data/spec/models/recurring_charge_request_spec.rb +77 -0
  112. data/spec/models/spid_beneficiary_response_spec.rb +6 -0
  113. data/spec/models/success_charges_data_dto_spec.rb +65 -0
  114. data/spec/models/success_data_dto_spec.rb +51 -0
  115. data/spec/models/transaction_spei_spid_spec.rb +83 -0
  116. data/spec/models/transactions_register_spec.rb +59 -0
  117. data/wire4_client-1.1.3.gem +0 -0
  118. data/wire4_client.gemspec +7 -7
  119. metadata +107 -55
@@ -0,0 +1,288 @@
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
+ # Información del producto sobre el cual se aplicarán los cobros recurrentes
17
+ class Product
18
+ # Monto del calgo que se aplicará de forma periodica
19
+ attr_accessor :amount
20
+
21
+ # Periodo en el cual se aplicará el cargo, si no se especifica la propiedad frequency por defecto sera la unidad
22
+ attr_accessor :billing_period
23
+
24
+ # La frecuencia en la que se aplicará el cargo, trabaja en conjunto con la propiedad billingPeriod
25
+ attr_accessor :frequency
26
+
27
+ # Nombre del producto sobre el cual se aplicará el cobro recurrente
28
+ attr_accessor :name
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'amount' => :'amount',
56
+ :'billing_period' => :'billing_period',
57
+ :'frequency' => :'frequency',
58
+ :'name' => :'name'
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.swagger_types
64
+ {
65
+ :'amount' => :'Float',
66
+ :'billing_period' => :'String',
67
+ :'frequency' => :'Integer',
68
+ :'name' => :'String'
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
79
+
80
+ if attributes.has_key?(:'amount')
81
+ self.amount = attributes[:'amount']
82
+ end
83
+
84
+ if attributes.has_key?(:'billing_period')
85
+ self.billing_period = attributes[:'billing_period']
86
+ end
87
+
88
+ if attributes.has_key?(:'frequency')
89
+ self.frequency = attributes[:'frequency']
90
+ end
91
+
92
+ if attributes.has_key?(:'name')
93
+ self.name = attributes[:'name']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @amount.nil?
102
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
103
+ end
104
+
105
+ if @amount > 8000
106
+ invalid_properties.push('invalid value for "amount", must be smaller than or equal to 8000.')
107
+ end
108
+
109
+ if @billing_period.nil?
110
+ invalid_properties.push('invalid value for "billing_period", billing_period cannot be nil.')
111
+ end
112
+
113
+ if @frequency.nil?
114
+ invalid_properties.push('invalid value for "frequency", frequency cannot be nil.')
115
+ end
116
+
117
+ if @name.nil?
118
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ return false if @amount.nil?
128
+ return false if @amount > 8000
129
+ return false if @billing_period.nil?
130
+ billing_period_validator = EnumAttributeValidator.new('String', ['WEEKLY', 'MONTHLY', 'YEARLY'])
131
+ return false unless billing_period_validator.valid?(@billing_period)
132
+ return false if @frequency.nil?
133
+ return false if @name.nil?
134
+ true
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] amount Value to be assigned
139
+ def amount=(amount)
140
+ if amount.nil?
141
+ fail ArgumentError, 'amount cannot be nil'
142
+ end
143
+
144
+ if amount > 8000
145
+ fail ArgumentError, 'invalid value for "amount", must be smaller than or equal to 8000.'
146
+ end
147
+
148
+ @amount = amount
149
+ end
150
+
151
+ # Custom attribute writer method checking allowed values (enum).
152
+ # @param [Object] billing_period Object to be assigned
153
+ def billing_period=(billing_period)
154
+ validator = EnumAttributeValidator.new('String', ['WEEKLY', 'MONTHLY', 'YEARLY'])
155
+ unless validator.valid?(billing_period)
156
+ fail ArgumentError, 'invalid value for "billing_period", must be one of #{validator.allowable_values}.'
157
+ end
158
+ @billing_period = billing_period
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ amount == o.amount &&
167
+ billing_period == o.billing_period &&
168
+ frequency == o.frequency &&
169
+ name == o.name
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Fixnum] Hash code
180
+ def hash
181
+ [amount, billing_period, frequency, name].hash
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.swagger_types.each_pair do |key, type|
190
+ if type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
194
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
195
+ end
196
+ elsif !attributes[self.class.attribute_map[key]].nil?
197
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
198
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
199
+ end
200
+
201
+ self
202
+ end
203
+
204
+ # Deserializes the data based on type
205
+ # @param string type Data type
206
+ # @param string value Value to be deserialized
207
+ # @return [Object] Deserialized data
208
+ def _deserialize(type, value)
209
+ case type.to_sym
210
+ when :DateTime
211
+ DateTime.parse(value)
212
+ when :Date
213
+ Date.parse(value)
214
+ when :String
215
+ value.to_s
216
+ when :Integer
217
+ value.to_i
218
+ when :Float
219
+ value.to_f
220
+ when :BOOLEAN
221
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
222
+ true
223
+ else
224
+ false
225
+ end
226
+ when :Object
227
+ # generic object (usually a Hash), return directly
228
+ value
229
+ when /\AArray<(?<inner_type>.+)>\z/
230
+ inner_type = Regexp.last_match[:inner_type]
231
+ value.map { |v| _deserialize(inner_type, v) }
232
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
233
+ k_type = Regexp.last_match[:k_type]
234
+ v_type = Regexp.last_match[:v_type]
235
+ {}.tap do |hash|
236
+ value.each do |k, v|
237
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
238
+ end
239
+ end
240
+ else # model
241
+ temp_model = Wire4Client.const_get(type).new
242
+ temp_model.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ next if value.nil?
265
+ hash[param] = _to_hash(value)
266
+ end
267
+ hash
268
+ end
269
+
270
+ # Outputs non-array value in the form of hash
271
+ # For object, use to_hash. Otherwise, just return the value
272
+ # @param [Object] value Any valid value
273
+ # @return [Hash] Returns the value in the form of hash
274
+ def _to_hash(value)
275
+ if value.is_a?(Array)
276
+ value.compact.map { |v| _to_hash(v) }
277
+ elsif value.is_a?(Hash)
278
+ {}.tap do |hash|
279
+ value.each { |k, v| hash[k] = _to_hash(v) }
280
+ end
281
+ elsif value.respond_to? :to_hash
282
+ value.to_hash
283
+ else
284
+ value
285
+ end
286
+ end
287
+ end
288
+ end
@@ -0,0 +1,278 @@
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 request para solictar la aplicación de Cargos Recurrentes
17
+ class RecurringChargeRequest
18
+ # Es la dirección URL a la que se redirigirá en caso de que el usuario cancele.
19
+ attr_accessor :cancel_return_url
20
+
21
+ # Número de cargos que se aplicarán a la tarjeta del cliente final a partir de la fecha del primer cargo
22
+ attr_accessor :charges
23
+
24
+ attr_accessor :customer
25
+
26
+ # Fecha en la que se aplicará el primer cargo a la tarjeta del cliente final
27
+ attr_accessor :first_charge_date
28
+
29
+ # Número de orden asignado por el cliente de Wire4
30
+ attr_accessor :order_id
31
+
32
+ attr_accessor :product
33
+
34
+ # Es la dirección URL a la que se redirigirá en caso de éxito.
35
+ attr_accessor :return_url
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'cancel_return_url' => :'cancel_return_url',
41
+ :'charges' => :'charges',
42
+ :'customer' => :'customer',
43
+ :'first_charge_date' => :'first_charge_date',
44
+ :'order_id' => :'order_id',
45
+ :'product' => :'product',
46
+ :'return_url' => :'return_url'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'cancel_return_url' => :'String',
54
+ :'charges' => :'Integer',
55
+ :'customer' => :'Customer',
56
+ :'first_charge_date' => :'DateTime',
57
+ :'order_id' => :'String',
58
+ :'product' => :'Product',
59
+ :'return_url' => :'String'
60
+ }
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ return unless attributes.is_a?(Hash)
67
+
68
+ # convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
70
+
71
+ if attributes.has_key?(:'cancel_return_url')
72
+ self.cancel_return_url = attributes[:'cancel_return_url']
73
+ end
74
+
75
+ if attributes.has_key?(:'charges')
76
+ self.charges = attributes[:'charges']
77
+ end
78
+
79
+ if attributes.has_key?(:'customer')
80
+ self.customer = attributes[:'customer']
81
+ end
82
+
83
+ if attributes.has_key?(:'first_charge_date')
84
+ self.first_charge_date = attributes[:'first_charge_date']
85
+ end
86
+
87
+ if attributes.has_key?(:'order_id')
88
+ self.order_id = attributes[:'order_id']
89
+ end
90
+
91
+ if attributes.has_key?(:'product')
92
+ self.product = attributes[:'product']
93
+ end
94
+
95
+ if attributes.has_key?(:'return_url')
96
+ self.return_url = attributes[:'return_url']
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ invalid_properties = Array.new
104
+ if @cancel_return_url.nil?
105
+ invalid_properties.push('invalid value for "cancel_return_url", cancel_return_url cannot be nil.')
106
+ end
107
+
108
+ if @charges.nil?
109
+ invalid_properties.push('invalid value for "charges", charges cannot be nil.')
110
+ end
111
+
112
+ if @customer.nil?
113
+ invalid_properties.push('invalid value for "customer", customer cannot be nil.')
114
+ end
115
+
116
+ if @first_charge_date.nil?
117
+ invalid_properties.push('invalid value for "first_charge_date", first_charge_date cannot be nil.')
118
+ end
119
+
120
+ if @order_id.nil?
121
+ invalid_properties.push('invalid value for "order_id", order_id cannot be nil.')
122
+ end
123
+
124
+ if @product.nil?
125
+ invalid_properties.push('invalid value for "product", product cannot be nil.')
126
+ end
127
+
128
+ if @return_url.nil?
129
+ invalid_properties.push('invalid value for "return_url", return_url cannot be nil.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ return false if @cancel_return_url.nil?
139
+ return false if @charges.nil?
140
+ return false if @customer.nil?
141
+ return false if @first_charge_date.nil?
142
+ return false if @order_id.nil?
143
+ return false if @product.nil?
144
+ return false if @return_url.nil?
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ cancel_return_url == o.cancel_return_url &&
154
+ charges == o.charges &&
155
+ customer == o.customer &&
156
+ first_charge_date == o.first_charge_date &&
157
+ order_id == o.order_id &&
158
+ product == o.product &&
159
+ return_url == o.return_url
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Fixnum] Hash code
170
+ def hash
171
+ [cancel_return_url, charges, customer, first_charge_date, order_id, product, return_url].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.swagger_types.each_pair do |key, type|
180
+ if type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ DateTime.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ temp_model = Wire4Client.const_get(type).new
232
+ temp_model.build_from_hash(value)
233
+ end
234
+ end
235
+
236
+ # Returns the string representation of the object
237
+ # @return [String] String presentation of the object
238
+ def to_s
239
+ to_hash.to_s
240
+ end
241
+
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_body
245
+ to_hash
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ next if value.nil?
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+ end
278
+ end
@@ -80,8 +80,8 @@ module Wire4Client
80
80
  invalid_properties.push('invalid value for "access_ip", access_ip cannot be nil.')
81
81
  end
82
82
 
83
- if @access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
84
- invalid_properties.push('invalid value for "access_ip", must conform to the pattern /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.')
83
+ if @access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
84
+ invalid_properties.push('invalid value for "access_ip", must conform to the pattern /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.')
85
85
  end
86
86
 
87
87
  if @account.nil?
@@ -103,7 +103,7 @@ module Wire4Client
103
103
  # @return true if the model is valid
104
104
  def valid?
105
105
  return false if @access_ip.nil?
106
- return false if @access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
106
+ return false if @access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
107
107
  return false if @account.nil?
108
108
  return false if @name.nil?
109
109
  return false if @notifications_url.nil?
@@ -117,8 +117,8 @@ module Wire4Client
117
117
  fail ArgumentError, 'access_ip cannot be nil'
118
118
  end
119
119
 
120
- if access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
121
- fail ArgumentError, 'invalid value for "access_ip", must conform to the pattern /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.'
120
+ if access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
121
+ fail ArgumentError, 'invalid value for "access_ip", must conform to the pattern /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.'
122
122
  end
123
123
 
124
124
  @access_ip = access_ip
@@ -18,6 +18,9 @@ module Wire4Client
18
18
  # Monto límite permitido para la cuenta. Ejemplo: 1000.00
19
19
  attr_accessor :amount_limit
20
20
 
21
+ # La fecha en la que se registro el beneficiario.
22
+ attr_accessor :authorization_date
23
+
21
24
  # El banco al cual pertenece la cuenta.
22
25
  attr_accessor :bank
23
26
 
@@ -55,6 +58,7 @@ module Wire4Client
55
58
  def self.attribute_map
56
59
  {
57
60
  :'amount_limit' => :'amount_limit',
61
+ :'authorization_date' => :'authorization_date',
58
62
  :'bank' => :'bank',
59
63
  :'beneficiary_account' => :'beneficiary_account',
60
64
  :'email' => :'email',
@@ -73,6 +77,7 @@ module Wire4Client
73
77
  def self.swagger_types
74
78
  {
75
79
  :'amount_limit' => :'Float',
80
+ :'authorization_date' => :'DateTime',
76
81
  :'bank' => :'Institution',
77
82
  :'beneficiary_account' => :'String',
78
83
  :'email' => :'Array<String>',
@@ -99,6 +104,10 @@ module Wire4Client
99
104
  self.amount_limit = attributes[:'amount_limit']
100
105
  end
101
106
 
107
+ if attributes.has_key?(:'authorization_date')
108
+ self.authorization_date = attributes[:'authorization_date']
109
+ end
110
+
102
111
  if attributes.has_key?(:'bank')
103
112
  self.bank = attributes[:'bank']
104
113
  end
@@ -223,6 +232,7 @@ module Wire4Client
223
232
  return true if self.equal?(o)
224
233
  self.class == o.class &&
225
234
  amount_limit == o.amount_limit &&
235
+ authorization_date == o.authorization_date &&
226
236
  bank == o.bank &&
227
237
  beneficiary_account == o.beneficiary_account &&
228
238
  email == o.email &&
@@ -245,7 +255,7 @@ module Wire4Client
245
255
  # Calculates hash code according to all attributes.
246
256
  # @return [Fixnum] Hash code
247
257
  def hash
248
- [amount_limit, bank, beneficiary_account, email, institution, kind_of_relationship, numeric_reference_spid, payment_concept_spid, register_date, relationship, rfc, status].hash
258
+ [amount_limit, authorization_date, bank, beneficiary_account, email, institution, kind_of_relationship, numeric_reference_spid, payment_concept_spid, register_date, relationship, rfc, status].hash
249
259
  end
250
260
 
251
261
  # Builds the object from hash