wire4_client 1.0.3 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +50 -7
  3. data/docs/Account.md +3 -3
  4. data/docs/AccountDetail.md +13 -0
  5. data/docs/AccountReassigned.md +21 -0
  6. data/docs/AccountResponse.md +4 -3
  7. data/docs/AddressCompany.md +17 -0
  8. data/docs/AmountRequest.md +2 -0
  9. data/docs/AuthorizationTransactionGroup.md +9 -0
  10. data/docs/AuthorizedBeneficiariesResponse.md +10 -0
  11. data/docs/AuthorizedUsers.md +13 -0
  12. data/docs/CertificateRequest.md +11 -0
  13. data/docs/CodiCodeQrResponseDTO.md +17 -0
  14. data/docs/CodiCodeRequestDTO.md +14 -0
  15. data/docs/CodiOperationResponseDTO.md +14 -0
  16. data/docs/CodiOperationsFiltersRequestDTO.md +15 -0
  17. data/docs/CompanyRegistered.md +13 -0
  18. data/docs/CompanyRequested.md +11 -0
  19. data/docs/Compay.md +11 -0
  20. data/docs/ContractDetailRequest.md +11 -0
  21. data/docs/ContractDetailResponse.md +9 -0
  22. data/docs/ContractsDetailsApi.md +167 -0
  23. data/docs/CuentasDeBeneficiariosSPEIApi.md +69 -4
  24. data/docs/CuentasDeBeneficiariosSPIDApi.md +11 -1
  25. data/docs/EmpresasCoDiApi.md +107 -0
  26. data/docs/MessageAccountBeneficiary.md +2 -2
  27. data/docs/MessageCEP.md +9 -9
  28. data/docs/MessageCodiAction.md +19 -0
  29. data/docs/MessagePayment.md +3 -1
  30. data/docs/MessagePaymentStatePending.md +23 -0
  31. data/docs/MessageRequestChanged.md +2 -2
  32. data/docs/MessageSalesPoint.md +10 -0
  33. data/docs/MessageSubscription.md +6 -6
  34. data/docs/MessageUserAuthorized.md +13 -0
  35. data/docs/MessageWebHook.md +2 -2
  36. data/docs/OperacionesCoDiApi.md +68 -0
  37. data/docs/Operations.md +17 -0
  38. data/docs/PagerResponseDto.md +13 -0
  39. data/docs/Payment.md +3 -1
  40. data/docs/PaymentRequestCodiResponseDTO.md +18 -0
  41. data/docs/PeticionesDePagoPorCoDiApi.md +116 -0
  42. data/docs/PreMonexAuthorization.md +11 -0
  43. data/docs/PuntosDeVentaCoDiApi.md +113 -0
  44. data/docs/SalesPoint.md +10 -0
  45. data/docs/SalesPointFound.md +14 -0
  46. data/docs/SalesPointRequest.md +11 -0
  47. data/docs/SalesPointRespose.md +11 -0
  48. data/docs/SpidBeneficiaryResponse.md +2 -0
  49. data/docs/SuscripcionesApi.md +14 -14
  50. data/docs/TransactionOutgoing.md +2 -1
  51. data/docs/TransferenciasSPEIApi.md +60 -2
  52. data/docs/UrlsRedirect.md +9 -0
  53. data/docs/UserCompany.md +16 -0
  54. data/docs/Webhook.md +13 -0
  55. data/lib/wire4_client.rb +36 -0
  56. data/lib/wire4_client/api/contracts_details_api.rb +230 -0
  57. data/lib/wire4_client/api/cuentas_de_beneficiarios_spei_api.rb +100 -5
  58. data/lib/wire4_client/api/cuentas_de_beneficiarios_spid_api.rb +15 -0
  59. data/lib/wire4_client/api/empresas_co_di_api.rb +137 -0
  60. data/lib/wire4_client/api/operaciones_co_di_api.rb +92 -0
  61. data/lib/wire4_client/api/peticiones_de_pago_por_co_di_api.rb +178 -0
  62. data/lib/wire4_client/api/puntos_de_venta_co_di_api.rb +151 -0
  63. data/lib/wire4_client/api/suscripciones_api.rb +14 -14
  64. data/lib/wire4_client/api/transferencias_spei_api.rb +82 -0
  65. data/lib/wire4_client/models/account.rb +3 -3
  66. data/lib/wire4_client/models/account_detail.rb +239 -0
  67. data/lib/wire4_client/models/account_reassigned.rb +375 -0
  68. data/lib/wire4_client/models/account_response.rb +14 -4
  69. data/lib/wire4_client/models/address_company.rb +275 -0
  70. data/lib/wire4_client/models/amount_request.rb +90 -4
  71. data/lib/wire4_client/models/authorization_transaction_group.rb +207 -0
  72. data/lib/wire4_client/models/authorized_beneficiaries_response.rb +206 -0
  73. data/lib/wire4_client/models/authorized_users.rb +235 -0
  74. data/lib/wire4_client/models/certificate_request.rb +248 -0
  75. data/lib/wire4_client/models/codi_code_qr_response_dto.rb +320 -0
  76. data/lib/wire4_client/models/codi_code_request_dto.rb +402 -0
  77. data/lib/wire4_client/models/codi_operation_response_dto.rb +245 -0
  78. data/lib/wire4_client/models/codi_operations_filters_request_dto.rb +336 -0
  79. data/lib/wire4_client/models/company_registered.rb +235 -0
  80. data/lib/wire4_client/models/company_requested.rb +215 -0
  81. data/lib/wire4_client/models/compay.rb +215 -0
  82. data/lib/wire4_client/models/contract_detail_request.rb +247 -0
  83. data/lib/wire4_client/models/contract_detail_response.rb +194 -0
  84. data/lib/wire4_client/models/message_account_beneficiary.rb +2 -2
  85. data/lib/wire4_client/models/message_cep.rb +10 -10
  86. data/lib/wire4_client/models/message_codi_action.rb +295 -0
  87. data/lib/wire4_client/models/message_deposit_received.rb +1 -1
  88. data/lib/wire4_client/models/message_payment.rb +23 -2
  89. data/lib/wire4_client/models/message_payment_state_pending.rb +335 -0
  90. data/lib/wire4_client/models/message_request_changed.rb +3 -3
  91. data/lib/wire4_client/models/message_sales_point.rb +205 -0
  92. data/lib/wire4_client/models/message_subscription.rb +7 -7
  93. data/lib/wire4_client/models/message_user_authorized.rb +235 -0
  94. data/lib/wire4_client/models/message_web_hook.rb +2 -2
  95. data/lib/wire4_client/models/operations.rb +321 -0
  96. data/lib/wire4_client/models/pager_response_dto.rb +236 -0
  97. data/lib/wire4_client/models/payment.rb +22 -2
  98. data/lib/wire4_client/models/payment_request_codi_response_dto.rb +287 -0
  99. data/lib/wire4_client/models/pre_monex_authorization.rb +291 -0
  100. data/lib/wire4_client/models/sales_point.rb +205 -0
  101. data/lib/wire4_client/models/sales_point_found.rb +279 -0
  102. data/lib/wire4_client/models/sales_point_request.rb +254 -0
  103. data/lib/wire4_client/models/sales_point_respose.rb +215 -0
  104. data/lib/wire4_client/models/spid_beneficiary_response.rb +24 -4
  105. data/lib/wire4_client/models/transaction_outgoing.rb +12 -2
  106. data/lib/wire4_client/models/urls_redirect.rb +205 -0
  107. data/lib/wire4_client/models/user_company.rb +269 -0
  108. data/lib/wire4_client/models/webhook.rb +271 -0
  109. data/lib/wire4_client/version.rb +1 -1
  110. data/spec/api/contracts_details_api_spec.rb +76 -0
  111. data/spec/api/cuentas_de_beneficiarios_spei_api_spec.rb +20 -1
  112. data/spec/api/cuentas_de_beneficiarios_spid_api_spec.rb +5 -0
  113. data/spec/api/empresas_co_di_api_spec.rb +60 -0
  114. data/spec/api/operaciones_co_di_api_spec.rb +52 -0
  115. data/spec/api/peticiones_de_pago_por_co_di_api_spec.rb +63 -0
  116. data/spec/api/puntos_de_venta_co_di_api_spec.rb +62 -0
  117. data/spec/api/suscripciones_api_spec.rb +7 -7
  118. data/spec/api/transferencias_spei_api_spec.rb +15 -0
  119. data/spec/models/account_detail_spec.rb +71 -0
  120. data/spec/models/account_reassigned_spec.rb +119 -0
  121. data/spec/models/account_response_spec.rb +6 -0
  122. data/spec/models/address_company_spec.rb +95 -0
  123. data/spec/models/amount_request_spec.rb +12 -0
  124. data/spec/models/authorization_transaction_group_spec.rb +47 -0
  125. data/spec/models/authorized_beneficiaries_response_spec.rb +53 -0
  126. data/spec/models/authorized_users_spec.rb +71 -0
  127. data/spec/models/certificate_request_spec.rb +59 -0
  128. data/spec/models/codi_code_qr_response_dto_spec.rb +103 -0
  129. data/spec/models/codi_code_request_dto_spec.rb +81 -0
  130. data/spec/models/codi_operation_response_dto_spec.rb +77 -0
  131. data/spec/models/codi_operations_filters_request_dto_spec.rb +87 -0
  132. data/spec/models/company_registered_spec.rb +71 -0
  133. data/spec/models/company_requested_spec.rb +59 -0
  134. data/spec/models/compay_spec.rb +59 -0
  135. data/spec/models/contract_detail_request_spec.rb +59 -0
  136. data/spec/models/contract_detail_response_spec.rb +47 -0
  137. data/spec/models/message_codi_action_spec.rb +107 -0
  138. data/spec/models/message_payment_spec.rb +12 -0
  139. data/spec/models/message_payment_state_pending_spec.rb +131 -0
  140. data/spec/models/message_sales_point_spec.rb +53 -0
  141. data/spec/models/message_user_authorized_spec.rb +71 -0
  142. data/spec/models/operations_spec.rb +103 -0
  143. data/spec/models/pager_response_dto_spec.rb +71 -0
  144. data/spec/models/payment_request_codi_response_dto_spec.rb +101 -0
  145. data/spec/models/payment_spec.rb +12 -0
  146. data/spec/models/pre_monex_authorization_spec.rb +59 -0
  147. data/spec/models/sales_point_found_spec.rb +81 -0
  148. data/spec/models/sales_point_request_spec.rb +59 -0
  149. data/spec/models/sales_point_respose_spec.rb +59 -0
  150. data/spec/models/sales_point_spec.rb +53 -0
  151. data/spec/models/spid_beneficiary_response_spec.rb +12 -0
  152. data/spec/models/transaction_outgoing_spec.rb +6 -0
  153. data/spec/models/urls_redirect_spec.rb +47 -0
  154. data/spec/models/user_company_spec.rb +89 -0
  155. data/spec/models/webhook_spec.rb +75 -0
  156. metadata +146 -3
  157. data/Gemfile.lock +0 -69
@@ -18,18 +18,26 @@ module Wire4Client
18
18
  # Nuevo monto límite que reemplazará al actual, un monto de 0.0 implica que no hay límite
19
19
  attr_accessor :amount_limit
20
20
 
21
+ # Url a la que se redirigirá en caso de que el cliente cancele el registro
22
+ attr_accessor :cancel_return_url
23
+
21
24
  # Código de moneda de la cuenta
22
25
  attr_accessor :currency_code
23
26
 
24
27
  # Monto límite registrado actualmente, un monto de 0.0 implica que no hay límite
25
28
  attr_accessor :previous_amount_limit
26
29
 
30
+ # Url a la que se redirigirá en caso de éxito
31
+ attr_accessor :return_url
32
+
27
33
  # Attribute mapping from ruby-style variable name to JSON key.
28
34
  def self.attribute_map
29
35
  {
30
36
  :'amount_limit' => :'amount_limit',
37
+ :'cancel_return_url' => :'cancel_return_url',
31
38
  :'currency_code' => :'currency_code',
32
- :'previous_amount_limit' => :'previous_amount_limit'
39
+ :'previous_amount_limit' => :'previous_amount_limit',
40
+ :'return_url' => :'return_url'
33
41
  }
34
42
  end
35
43
 
@@ -37,8 +45,10 @@ module Wire4Client
37
45
  def self.swagger_types
38
46
  {
39
47
  :'amount_limit' => :'Float',
48
+ :'cancel_return_url' => :'String',
40
49
  :'currency_code' => :'String',
41
- :'previous_amount_limit' => :'Float'
50
+ :'previous_amount_limit' => :'Float',
51
+ :'return_url' => :'String'
42
52
  }
43
53
  end
44
54
 
@@ -54,6 +64,10 @@ module Wire4Client
54
64
  self.amount_limit = attributes[:'amount_limit']
55
65
  end
56
66
 
67
+ if attributes.has_key?(:'cancel_return_url')
68
+ self.cancel_return_url = attributes[:'cancel_return_url']
69
+ end
70
+
57
71
  if attributes.has_key?(:'currency_code')
58
72
  self.currency_code = attributes[:'currency_code']
59
73
  end
@@ -61,6 +75,10 @@ module Wire4Client
61
75
  if attributes.has_key?(:'previous_amount_limit')
62
76
  self.previous_amount_limit = attributes[:'previous_amount_limit']
63
77
  end
78
+
79
+ if attributes.has_key?(:'return_url')
80
+ self.return_url = attributes[:'return_url']
81
+ end
64
82
  end
65
83
 
66
84
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -75,6 +93,18 @@ module Wire4Client
75
93
  invalid_properties.push('invalid value for "amount_limit", must be greater than or equal to 0.0.')
76
94
  end
77
95
 
96
+ if @cancel_return_url.nil?
97
+ invalid_properties.push('invalid value for "cancel_return_url", cancel_return_url cannot be nil.')
98
+ end
99
+
100
+ if @cancel_return_url.to_s.length > 512
101
+ invalid_properties.push('invalid value for "cancel_return_url", the character length must be smaller than or equal to 512.')
102
+ end
103
+
104
+ if @cancel_return_url.to_s.length < 10
105
+ invalid_properties.push('invalid value for "cancel_return_url", the character length must be great than or equal to 10.')
106
+ end
107
+
78
108
  if @currency_code.nil?
79
109
  invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
80
110
  end
@@ -87,6 +117,18 @@ module Wire4Client
87
117
  invalid_properties.push('invalid value for "previous_amount_limit", must be greater than or equal to 0.0.')
88
118
  end
89
119
 
120
+ if @return_url.nil?
121
+ invalid_properties.push('invalid value for "return_url", return_url cannot be nil.')
122
+ end
123
+
124
+ if @return_url.to_s.length > 512
125
+ invalid_properties.push('invalid value for "return_url", the character length must be smaller than or equal to 512.')
126
+ end
127
+
128
+ if @return_url.to_s.length < 10
129
+ invalid_properties.push('invalid value for "return_url", the character length must be great than or equal to 10.')
130
+ end
131
+
90
132
  invalid_properties
91
133
  end
92
134
 
@@ -95,9 +137,15 @@ module Wire4Client
95
137
  def valid?
96
138
  return false if @amount_limit.nil?
97
139
  return false if @amount_limit < 0.0
140
+ return false if @cancel_return_url.nil?
141
+ return false if @cancel_return_url.to_s.length > 512
142
+ return false if @cancel_return_url.to_s.length < 10
98
143
  return false if @currency_code.nil?
99
144
  return false if @previous_amount_limit.nil?
100
145
  return false if @previous_amount_limit < 0.0
146
+ return false if @return_url.nil?
147
+ return false if @return_url.to_s.length > 512
148
+ return false if @return_url.to_s.length < 10
101
149
  true
102
150
  end
103
151
 
@@ -115,6 +163,24 @@ module Wire4Client
115
163
  @amount_limit = amount_limit
116
164
  end
117
165
 
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] cancel_return_url Value to be assigned
168
+ def cancel_return_url=(cancel_return_url)
169
+ if cancel_return_url.nil?
170
+ fail ArgumentError, 'cancel_return_url cannot be nil'
171
+ end
172
+
173
+ if cancel_return_url.to_s.length > 512
174
+ fail ArgumentError, 'invalid value for "cancel_return_url", the character length must be smaller than or equal to 512.'
175
+ end
176
+
177
+ if cancel_return_url.to_s.length < 10
178
+ fail ArgumentError, 'invalid value for "cancel_return_url", the character length must be great than or equal to 10.'
179
+ end
180
+
181
+ @cancel_return_url = cancel_return_url
182
+ end
183
+
118
184
  # Custom attribute writer method with validation
119
185
  # @param [Object] previous_amount_limit Value to be assigned
120
186
  def previous_amount_limit=(previous_amount_limit)
@@ -129,14 +195,34 @@ module Wire4Client
129
195
  @previous_amount_limit = previous_amount_limit
130
196
  end
131
197
 
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] return_url Value to be assigned
200
+ def return_url=(return_url)
201
+ if return_url.nil?
202
+ fail ArgumentError, 'return_url cannot be nil'
203
+ end
204
+
205
+ if return_url.to_s.length > 512
206
+ fail ArgumentError, 'invalid value for "return_url", the character length must be smaller than or equal to 512.'
207
+ end
208
+
209
+ if return_url.to_s.length < 10
210
+ fail ArgumentError, 'invalid value for "return_url", the character length must be great than or equal to 10.'
211
+ end
212
+
213
+ @return_url = return_url
214
+ end
215
+
132
216
  # Checks equality by comparing each attribute.
133
217
  # @param [Object] Object to be compared
134
218
  def ==(o)
135
219
  return true if self.equal?(o)
136
220
  self.class == o.class &&
137
221
  amount_limit == o.amount_limit &&
222
+ cancel_return_url == o.cancel_return_url &&
138
223
  currency_code == o.currency_code &&
139
- previous_amount_limit == o.previous_amount_limit
224
+ previous_amount_limit == o.previous_amount_limit &&
225
+ return_url == o.return_url
140
226
  end
141
227
 
142
228
  # @see the `==` method
@@ -148,7 +234,7 @@ module Wire4Client
148
234
  # Calculates hash code according to all attributes.
149
235
  # @return [Fixnum] Hash code
150
236
  def hash
151
- [amount_limit, currency_code, previous_amount_limit].hash
237
+ [amount_limit, cancel_return_url, currency_code, previous_amount_limit, return_url].hash
152
238
  end
153
239
 
154
240
  # Builds the object from hash
@@ -0,0 +1,207 @@
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
+ # Contiene la información para agrupar transacciones existentes y autorizarlas de forma conjunta
17
+ class AuthorizationTransactionGroup
18
+ # Urls de redirección al autorizar las transacciones
19
+ attr_accessor :redirect_urls
20
+
21
+ # Listado de order_id de las transacciones a agrupar
22
+ attr_accessor :transactions
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'redirect_urls' => :'redirect_urls',
28
+ :'transactions' => :'transactions'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'redirect_urls' => :'UrlsRedirect',
36
+ :'transactions' => :'Array<String>'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'redirect_urls')
49
+ self.redirect_urls = attributes[:'redirect_urls']
50
+ end
51
+
52
+ if attributes.has_key?(:'transactions')
53
+ if (value = attributes[:'transactions']).is_a?(Array)
54
+ self.transactions = value
55
+ end
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ if @redirect_urls.nil?
64
+ invalid_properties.push('invalid value for "redirect_urls", redirect_urls cannot be nil.')
65
+ end
66
+
67
+ if @transactions.nil?
68
+ invalid_properties.push('invalid value for "transactions", transactions cannot be nil.')
69
+ end
70
+
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ return false if @redirect_urls.nil?
78
+ return false if @transactions.nil?
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ redirect_urls == o.redirect_urls &&
88
+ transactions == o.transactions
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [redirect_urls, transactions].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = Wire4Client.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+ end
207
+ end
@@ -0,0 +1,206 @@
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
+ class AuthorizedBeneficiariesResponse
17
+ # Lista de cuentas obtenidas
18
+ attr_accessor :accounts
19
+
20
+ # Identificador público generado para la petición
21
+ attr_accessor :request_id
22
+
23
+ # La url generada para confirmación de la operación
24
+ attr_accessor :url
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'accounts' => :'accounts',
30
+ :'request_id' => :'request_id',
31
+ :'url' => :'url'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ :'accounts' => :'Array<AccountReassigned>',
39
+ :'request_id' => :'String',
40
+ :'url' => :'String'
41
+ }
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ return unless attributes.is_a?(Hash)
48
+
49
+ # convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
51
+
52
+ if attributes.has_key?(:'accounts')
53
+ if (value = attributes[:'accounts']).is_a?(Array)
54
+ self.accounts = value
55
+ end
56
+ end
57
+
58
+ if attributes.has_key?(:'request_id')
59
+ self.request_id = attributes[:'request_id']
60
+ end
61
+
62
+ if attributes.has_key?(:'url')
63
+ self.url = attributes[:'url']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ accounts == o.accounts &&
86
+ request_id == o.request_id &&
87
+ url == o.url
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [accounts, request_id, url].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.swagger_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ temp_model = Wire4Client.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+ end
206
+ end