wire4_client 0.0.1.pre.SNAPSHOT

Sign up to get free protection for your applications and to get access to all the features.
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,217 @@
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 guardar la cuenta del beneficiario
17
+ class AccountRequest
18
+ # Lista de cuentas del beneficiario que serán registradas
19
+ attr_accessor :accounts
20
+
21
+ # Url a la que se redirigira en caso de que el cliente cancele el registro
22
+ attr_accessor :cancel_return_url
23
+
24
+ # Url a la que se redireccionara en caso exitoso
25
+ attr_accessor :return_url
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'accounts' => :'accounts',
31
+ :'cancel_return_url' => :'cancel_return_url',
32
+ :'return_url' => :'return_url'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'accounts' => :'Array<Account>',
40
+ :'cancel_return_url' => :'String',
41
+ :'return_url' => :'String'
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?(:'accounts')
54
+ if (value = attributes[:'accounts']).is_a?(Array)
55
+ self.accounts = value
56
+ end
57
+ end
58
+
59
+ if attributes.has_key?(:'cancel_return_url')
60
+ self.cancel_return_url = attributes[:'cancel_return_url']
61
+ end
62
+
63
+ if attributes.has_key?(:'return_url')
64
+ self.return_url = attributes[:'return_url']
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
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return false if @cancel_return_url.nil?
87
+ return false if @return_url.nil?
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ accounts == o.accounts &&
97
+ cancel_return_url == o.cancel_return_url &&
98
+ return_url == o.return_url
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Fixnum] Hash code
109
+ def hash
110
+ [accounts, cancel_return_url, return_url].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.swagger_types.each_pair do |key, type|
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :BOOLEAN
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ temp_model = Wire4Client.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+ end
217
+ end
@@ -0,0 +1,345 @@
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 AccountResponse
18
+ # Monto límite permitido registrado para la cuenta
19
+ attr_accessor :amount_limit
20
+
21
+ # El banco al cual pertenece la cuenta
22
+ attr_accessor :bank
23
+
24
+ # Cuenta del beneficiario, podría ser teléfono celular, TDD o cuenta CLABE
25
+ attr_accessor :beneficiary_account
26
+
27
+ # Lista de email's, este dato es opcional
28
+ attr_accessor :email
29
+
30
+ # Objeto que contiene el nombre de la institución, es mutuamente exclusivo con el objeto Person
31
+ attr_accessor :institution
32
+
33
+ # Tipo de relación con el propietario de la cuenta, para registrar una cuenta este valor se debe obtener del recurso relationships
34
+ attr_accessor :kind_of_relationship
35
+
36
+ # Referencia numérica a utilizar cuando se realice una transferencia y no se especifique una referencia
37
+ attr_accessor :numeric_reference_spei
38
+
39
+ # Concepto de pago a utilizar cuando se realice una transferencia y no se especifique un concepto
40
+ attr_accessor :payment_concept_spei
41
+
42
+ # Objeto que contiene los datos de la persona propietaria de la cuenta, si se incluye este atributo, el atributo institution no debe estar presente
43
+ attr_accessor :person
44
+
45
+ # Relación con el propietario de la cuenta, para registrar una cuenta este valor se debe obtener del recurso relationships
46
+ attr_accessor :relationship
47
+
48
+ # Registro federal de contribuyentes de la persona o institución propietaria de la cuenta
49
+ attr_accessor :rfc
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'amount_limit' => :'amount_limit',
55
+ :'bank' => :'bank',
56
+ :'beneficiary_account' => :'beneficiary_account',
57
+ :'email' => :'email',
58
+ :'institution' => :'institution',
59
+ :'kind_of_relationship' => :'kind_of_relationship',
60
+ :'numeric_reference_spei' => :'numeric_reference_spei',
61
+ :'payment_concept_spei' => :'payment_concept_spei',
62
+ :'person' => :'person',
63
+ :'relationship' => :'relationship',
64
+ :'rfc' => :'rfc'
65
+ }
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ {
71
+ :'amount_limit' => :'Float',
72
+ :'bank' => :'Institution',
73
+ :'beneficiary_account' => :'String',
74
+ :'email' => :'Array<String>',
75
+ :'institution' => :'BeneficiaryInstitution',
76
+ :'kind_of_relationship' => :'String',
77
+ :'numeric_reference_spei' => :'String',
78
+ :'payment_concept_spei' => :'String',
79
+ :'person' => :'Person',
80
+ :'relationship' => :'String',
81
+ :'rfc' => :'String'
82
+ }
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ return unless attributes.is_a?(Hash)
89
+
90
+ # convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
92
+
93
+ if attributes.has_key?(:'amount_limit')
94
+ self.amount_limit = attributes[:'amount_limit']
95
+ end
96
+
97
+ if attributes.has_key?(:'bank')
98
+ self.bank = attributes[:'bank']
99
+ end
100
+
101
+ if attributes.has_key?(:'beneficiary_account')
102
+ self.beneficiary_account = attributes[:'beneficiary_account']
103
+ end
104
+
105
+ if attributes.has_key?(:'email')
106
+ if (value = attributes[:'email']).is_a?(Array)
107
+ self.email = value
108
+ end
109
+ end
110
+
111
+ if attributes.has_key?(:'institution')
112
+ self.institution = attributes[:'institution']
113
+ end
114
+
115
+ if attributes.has_key?(:'kind_of_relationship')
116
+ self.kind_of_relationship = attributes[:'kind_of_relationship']
117
+ end
118
+
119
+ if attributes.has_key?(:'numeric_reference_spei')
120
+ self.numeric_reference_spei = attributes[:'numeric_reference_spei']
121
+ end
122
+
123
+ if attributes.has_key?(:'payment_concept_spei')
124
+ self.payment_concept_spei = attributes[:'payment_concept_spei']
125
+ end
126
+
127
+ if attributes.has_key?(:'person')
128
+ self.person = attributes[:'person']
129
+ end
130
+
131
+ if attributes.has_key?(:'relationship')
132
+ self.relationship = attributes[:'relationship']
133
+ end
134
+
135
+ if attributes.has_key?(:'rfc')
136
+ self.rfc = attributes[:'rfc']
137
+ end
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ invalid_properties = Array.new
144
+ if @amount_limit.nil?
145
+ invalid_properties.push('invalid value for "amount_limit", amount_limit cannot be nil.')
146
+ end
147
+
148
+ if @beneficiary_account.nil?
149
+ invalid_properties.push('invalid value for "beneficiary_account", beneficiary_account cannot be nil.')
150
+ end
151
+
152
+ if @kind_of_relationship.nil?
153
+ invalid_properties.push('invalid value for "kind_of_relationship", kind_of_relationship cannot be nil.')
154
+ end
155
+
156
+ if !@numeric_reference_spei.nil? && @numeric_reference_spei.to_s.length > 7
157
+ invalid_properties.push('invalid value for "numeric_reference_spei", the character length must be smaller than or equal to 7.')
158
+ end
159
+
160
+ if !@numeric_reference_spei.nil? && @numeric_reference_spei.to_s.length < 1
161
+ invalid_properties.push('invalid value for "numeric_reference_spei", the character length must be great than or equal to 1.')
162
+ end
163
+
164
+ if !@numeric_reference_spei.nil? && @numeric_reference_spei !~ Regexp.new(/[0-9][0-9]*/)
165
+ invalid_properties.push('invalid value for "numeric_reference_spei", must conform to the pattern /[0-9][0-9]*/.')
166
+ end
167
+
168
+ if @relationship.nil?
169
+ invalid_properties.push('invalid value for "relationship", relationship cannot be nil.')
170
+ end
171
+
172
+ if @rfc.nil?
173
+ invalid_properties.push('invalid value for "rfc", rfc cannot be nil.')
174
+ end
175
+
176
+ invalid_properties
177
+ end
178
+
179
+ # Check to see if the all the properties in the model are valid
180
+ # @return true if the model is valid
181
+ def valid?
182
+ return false if @amount_limit.nil?
183
+ return false if @beneficiary_account.nil?
184
+ return false if @kind_of_relationship.nil?
185
+ return false if !@numeric_reference_spei.nil? && @numeric_reference_spei.to_s.length > 7
186
+ return false if !@numeric_reference_spei.nil? && @numeric_reference_spei.to_s.length < 1
187
+ return false if !@numeric_reference_spei.nil? && @numeric_reference_spei !~ Regexp.new(/[0-9][0-9]*/)
188
+ return false if @relationship.nil?
189
+ return false if @rfc.nil?
190
+ true
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] numeric_reference_spei Value to be assigned
195
+ def numeric_reference_spei=(numeric_reference_spei)
196
+ if !numeric_reference_spei.nil? && numeric_reference_spei.to_s.length > 7
197
+ fail ArgumentError, 'invalid value for "numeric_reference_spei", the character length must be smaller than or equal to 7.'
198
+ end
199
+
200
+ if !numeric_reference_spei.nil? && numeric_reference_spei.to_s.length < 1
201
+ fail ArgumentError, 'invalid value for "numeric_reference_spei", the character length must be great than or equal to 1.'
202
+ end
203
+
204
+ if !numeric_reference_spei.nil? && numeric_reference_spei !~ Regexp.new(/[0-9][0-9]*/)
205
+ fail ArgumentError, 'invalid value for "numeric_reference_spei", must conform to the pattern /[0-9][0-9]*/.'
206
+ end
207
+
208
+ @numeric_reference_spei = numeric_reference_spei
209
+ end
210
+
211
+ # Checks equality by comparing each attribute.
212
+ # @param [Object] Object to be compared
213
+ def ==(o)
214
+ return true if self.equal?(o)
215
+ self.class == o.class &&
216
+ amount_limit == o.amount_limit &&
217
+ bank == o.bank &&
218
+ beneficiary_account == o.beneficiary_account &&
219
+ email == o.email &&
220
+ institution == o.institution &&
221
+ kind_of_relationship == o.kind_of_relationship &&
222
+ numeric_reference_spei == o.numeric_reference_spei &&
223
+ payment_concept_spei == o.payment_concept_spei &&
224
+ person == o.person &&
225
+ relationship == o.relationship &&
226
+ rfc == o.rfc
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Fixnum] Hash code
237
+ def hash
238
+ [amount_limit, bank, beneficiary_account, email, institution, kind_of_relationship, numeric_reference_spei, payment_concept_spei, person, relationship, rfc].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ self.class.swagger_types.each_pair do |key, type|
247
+ if type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the the attribute
249
+ # is documented as an array but the input is not
250
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
251
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
252
+ end
253
+ elsif !attributes[self.class.attribute_map[key]].nil?
254
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
255
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
256
+ end
257
+
258
+ self
259
+ end
260
+
261
+ # Deserializes the data based on type
262
+ # @param string type Data type
263
+ # @param string value Value to be deserialized
264
+ # @return [Object] Deserialized data
265
+ def _deserialize(type, value)
266
+ case type.to_sym
267
+ when :DateTime
268
+ DateTime.parse(value)
269
+ when :Date
270
+ Date.parse(value)
271
+ when :String
272
+ value.to_s
273
+ when :Integer
274
+ value.to_i
275
+ when :Float
276
+ value.to_f
277
+ when :BOOLEAN
278
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
279
+ true
280
+ else
281
+ false
282
+ end
283
+ when :Object
284
+ # generic object (usually a Hash), return directly
285
+ value
286
+ when /\AArray<(?<inner_type>.+)>\z/
287
+ inner_type = Regexp.last_match[:inner_type]
288
+ value.map { |v| _deserialize(inner_type, v) }
289
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
290
+ k_type = Regexp.last_match[:k_type]
291
+ v_type = Regexp.last_match[:v_type]
292
+ {}.tap do |hash|
293
+ value.each do |k, v|
294
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
295
+ end
296
+ end
297
+ else # model
298
+ temp_model = Wire4Client.const_get(type).new
299
+ temp_model.build_from_hash(value)
300
+ end
301
+ end
302
+
303
+ # Returns the string representation of the object
304
+ # @return [String] String presentation of the object
305
+ def to_s
306
+ to_hash.to_s
307
+ end
308
+
309
+ # to_body is an alias to to_hash (backward compatibility)
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_body
312
+ to_hash
313
+ end
314
+
315
+ # Returns the object in the form of hash
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_hash
318
+ hash = {}
319
+ self.class.attribute_map.each_pair do |attr, param|
320
+ value = self.send(attr)
321
+ next if value.nil?
322
+ hash[param] = _to_hash(value)
323
+ end
324
+ hash
325
+ end
326
+
327
+ # Outputs non-array value in the form of hash
328
+ # For object, use to_hash. Otherwise, just return the value
329
+ # @param [Object] value Any valid value
330
+ # @return [Hash] Returns the value in the form of hash
331
+ def _to_hash(value)
332
+ if value.is_a?(Array)
333
+ value.compact.map { |v| _to_hash(v) }
334
+ elsif value.is_a?(Hash)
335
+ {}.tap do |hash|
336
+ value.each { |k, v| hash[k] = _to_hash(v) }
337
+ end
338
+ elsif value.respond_to? :to_hash
339
+ value.to_hash
340
+ else
341
+ value
342
+ end
343
+ end
344
+ end
345
+ end