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
@@ -0,0 +1,245 @@
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 solicitud de pago por CODI®.
17
+ class CodiOperationResponseDTO
18
+ # Monto de la operacion.
19
+ attr_accessor :amount
20
+
21
+ # Concepto del pago.
22
+ attr_accessor :concept
23
+
24
+ # Identificador de la operacion.
25
+ attr_accessor :id
26
+
27
+ # Fecha de la operacion.
28
+ attr_accessor :operation_date
29
+
30
+ # Tipo de pago.
31
+ attr_accessor :payment_type
32
+
33
+ # Estatus.
34
+ attr_accessor :status
35
+
36
+ # Identificador de la transacción.
37
+ attr_accessor :transaction_id
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'amount' => :'amount',
43
+ :'concept' => :'concept',
44
+ :'id' => :'id',
45
+ :'operation_date' => :'operation_date',
46
+ :'payment_type' => :'payment_type',
47
+ :'status' => :'status',
48
+ :'transaction_id' => :'transaction_id'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'amount' => :'Float',
56
+ :'concept' => :'String',
57
+ :'id' => :'String',
58
+ :'operation_date' => :'DateTime',
59
+ :'payment_type' => :'String',
60
+ :'status' => :'String',
61
+ :'transaction_id' => :'String'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ if attributes.has_key?(:'amount')
74
+ self.amount = attributes[:'amount']
75
+ end
76
+
77
+ if attributes.has_key?(:'concept')
78
+ self.concept = attributes[:'concept']
79
+ end
80
+
81
+ if attributes.has_key?(:'id')
82
+ self.id = attributes[:'id']
83
+ end
84
+
85
+ if attributes.has_key?(:'operation_date')
86
+ self.operation_date = attributes[:'operation_date']
87
+ end
88
+
89
+ if attributes.has_key?(:'payment_type')
90
+ self.payment_type = attributes[:'payment_type']
91
+ end
92
+
93
+ if attributes.has_key?(:'status')
94
+ self.status = attributes[:'status']
95
+ end
96
+
97
+ if attributes.has_key?(:'transaction_id')
98
+ self.transaction_id = attributes[:'transaction_id']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ amount == o.amount &&
121
+ concept == o.concept &&
122
+ id == o.id &&
123
+ operation_date == o.operation_date &&
124
+ payment_type == o.payment_type &&
125
+ status == o.status &&
126
+ transaction_id == o.transaction_id
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Fixnum] Hash code
137
+ def hash
138
+ [amount, concept, id, operation_date, payment_type, status, transaction_id].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.swagger_types.each_pair do |key, type|
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :DateTime
168
+ DateTime.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :BOOLEAN
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ temp_model = Wire4Client.const_get(type).new
199
+ temp_model.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ next if value.nil?
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ # Outputs non-array value in the form of hash
228
+ # For object, use to_hash. Otherwise, just return the value
229
+ # @param [Object] value Any valid value
230
+ # @return [Hash] Returns the value in the form of hash
231
+ def _to_hash(value)
232
+ if value.is_a?(Array)
233
+ value.compact.map { |v| _to_hash(v) }
234
+ elsif value.is_a?(Hash)
235
+ {}.tap do |hash|
236
+ value.each { |k, v| hash[k] = _to_hash(v) }
237
+ end
238
+ elsif value.respond_to? :to_hash
239
+ value.to_hash
240
+ else
241
+ value
242
+ end
243
+ end
244
+ end
245
+ end
@@ -0,0 +1,336 @@
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 CodiOperationsFiltersRequestDTO
17
+ # Monto minimo, dos decimales
18
+ attr_accessor :amount_from
19
+
20
+ # Monto máximo,dos decimales
21
+ attr_accessor :amount_to
22
+
23
+ # Fecha de operación desde
24
+ attr_accessor :operation_date_from
25
+
26
+ # Fecha de operación hasta
27
+ attr_accessor :operation_date_to
28
+
29
+ # Order id de la petición
30
+ attr_accessor :order_id
31
+
32
+ # Fecha de petición desde
33
+ attr_accessor :request_date_from
34
+
35
+ # Fecha de petición hasta
36
+ attr_accessor :request_date_to
37
+
38
+ # Estatus de petición
39
+ attr_accessor :status
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'amount_from' => :'amount_from',
67
+ :'amount_to' => :'amount_to',
68
+ :'operation_date_from' => :'operation_date_from',
69
+ :'operation_date_to' => :'operation_date_to',
70
+ :'order_id' => :'order_id',
71
+ :'request_date_from' => :'request_date_from',
72
+ :'request_date_to' => :'request_date_to',
73
+ :'status' => :'status'
74
+ }
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.swagger_types
79
+ {
80
+ :'amount_from' => :'Float',
81
+ :'amount_to' => :'Float',
82
+ :'operation_date_from' => :'Date',
83
+ :'operation_date_to' => :'Date',
84
+ :'order_id' => :'String',
85
+ :'request_date_from' => :'Date',
86
+ :'request_date_to' => :'Date',
87
+ :'status' => :'String'
88
+ }
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ return unless attributes.is_a?(Hash)
95
+
96
+ # convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
98
+
99
+ if attributes.has_key?(:'amount_from')
100
+ self.amount_from = attributes[:'amount_from']
101
+ end
102
+
103
+ if attributes.has_key?(:'amount_to')
104
+ self.amount_to = attributes[:'amount_to']
105
+ end
106
+
107
+ if attributes.has_key?(:'operation_date_from')
108
+ self.operation_date_from = attributes[:'operation_date_from']
109
+ end
110
+
111
+ if attributes.has_key?(:'operation_date_to')
112
+ self.operation_date_to = attributes[:'operation_date_to']
113
+ end
114
+
115
+ if attributes.has_key?(:'order_id')
116
+ self.order_id = attributes[:'order_id']
117
+ end
118
+
119
+ if attributes.has_key?(:'request_date_from')
120
+ self.request_date_from = attributes[:'request_date_from']
121
+ end
122
+
123
+ if attributes.has_key?(:'request_date_to')
124
+ self.request_date_to = attributes[:'request_date_to']
125
+ end
126
+
127
+ if attributes.has_key?(:'status')
128
+ self.status = attributes[:'status']
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+ if !@amount_from.nil? && @amount_from > 9999999.99
137
+ invalid_properties.push('invalid value for "amount_from", must be smaller than or equal to 9999999.99.')
138
+ end
139
+
140
+ if !@amount_from.nil? && @amount_from < 0.01
141
+ invalid_properties.push('invalid value for "amount_from", must be greater than or equal to 0.01.')
142
+ end
143
+
144
+ if !@amount_to.nil? && @amount_to > 9999999.99
145
+ invalid_properties.push('invalid value for "amount_to", must be smaller than or equal to 9999999.99.')
146
+ end
147
+
148
+ if !@amount_to.nil? && @amount_to < 0.01
149
+ invalid_properties.push('invalid value for "amount_to", must be greater than or equal to 0.01.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ return false if !@amount_from.nil? && @amount_from > 9999999.99
159
+ return false if !@amount_from.nil? && @amount_from < 0.01
160
+ return false if !@amount_to.nil? && @amount_to > 9999999.99
161
+ return false if !@amount_to.nil? && @amount_to < 0.01
162
+ status_validator = EnumAttributeValidator.new('String', ['RECEIVED', 'COMPLETED', 'CANCELLED'])
163
+ return false unless status_validator.valid?(@status)
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] amount_from Value to be assigned
169
+ def amount_from=(amount_from)
170
+ if !amount_from.nil? && amount_from > 9999999.99
171
+ fail ArgumentError, 'invalid value for "amount_from", must be smaller than or equal to 9999999.99.'
172
+ end
173
+
174
+ if !amount_from.nil? && amount_from < 0.01
175
+ fail ArgumentError, 'invalid value for "amount_from", must be greater than or equal to 0.01.'
176
+ end
177
+
178
+ @amount_from = amount_from
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] amount_to Value to be assigned
183
+ def amount_to=(amount_to)
184
+ if !amount_to.nil? && amount_to > 9999999.99
185
+ fail ArgumentError, 'invalid value for "amount_to", must be smaller than or equal to 9999999.99.'
186
+ end
187
+
188
+ if !amount_to.nil? && amount_to < 0.01
189
+ fail ArgumentError, 'invalid value for "amount_to", must be greater than or equal to 0.01.'
190
+ end
191
+
192
+ @amount_to = amount_to
193
+ end
194
+
195
+ # Custom attribute writer method checking allowed values (enum).
196
+ # @param [Object] status Object to be assigned
197
+ def status=(status)
198
+ validator = EnumAttributeValidator.new('String', ['RECEIVED', 'COMPLETED', 'CANCELLED'])
199
+ unless validator.valid?(status)
200
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
201
+ end
202
+ @status = status
203
+ end
204
+
205
+ # Checks equality by comparing each attribute.
206
+ # @param [Object] Object to be compared
207
+ def ==(o)
208
+ return true if self.equal?(o)
209
+ self.class == o.class &&
210
+ amount_from == o.amount_from &&
211
+ amount_to == o.amount_to &&
212
+ operation_date_from == o.operation_date_from &&
213
+ operation_date_to == o.operation_date_to &&
214
+ order_id == o.order_id &&
215
+ request_date_from == o.request_date_from &&
216
+ request_date_to == o.request_date_to &&
217
+ status == o.status
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Fixnum] Hash code
228
+ def hash
229
+ [amount_from, amount_to, operation_date_from, operation_date_to, order_id, request_date_from, request_date_to, status].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ self.class.swagger_types.each_pair do |key, type|
238
+ if type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
242
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
243
+ end
244
+ elsif !attributes[self.class.attribute_map[key]].nil?
245
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
247
+ end
248
+
249
+ self
250
+ end
251
+
252
+ # Deserializes the data based on type
253
+ # @param string type Data type
254
+ # @param string value Value to be deserialized
255
+ # @return [Object] Deserialized data
256
+ def _deserialize(type, value)
257
+ case type.to_sym
258
+ when :DateTime
259
+ DateTime.parse(value)
260
+ when :Date
261
+ Date.parse(value)
262
+ when :String
263
+ value.to_s
264
+ when :Integer
265
+ value.to_i
266
+ when :Float
267
+ value.to_f
268
+ when :BOOLEAN
269
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
270
+ true
271
+ else
272
+ false
273
+ end
274
+ when :Object
275
+ # generic object (usually a Hash), return directly
276
+ value
277
+ when /\AArray<(?<inner_type>.+)>\z/
278
+ inner_type = Regexp.last_match[:inner_type]
279
+ value.map { |v| _deserialize(inner_type, v) }
280
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
281
+ k_type = Regexp.last_match[:k_type]
282
+ v_type = Regexp.last_match[:v_type]
283
+ {}.tap do |hash|
284
+ value.each do |k, v|
285
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
286
+ end
287
+ end
288
+ else # model
289
+ temp_model = Wire4Client.const_get(type).new
290
+ temp_model.build_from_hash(value)
291
+ end
292
+ end
293
+
294
+ # Returns the string representation of the object
295
+ # @return [String] String presentation of the object
296
+ def to_s
297
+ to_hash.to_s
298
+ end
299
+
300
+ # to_body is an alias to to_hash (backward compatibility)
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_body
303
+ to_hash
304
+ end
305
+
306
+ # Returns the object in the form of hash
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_hash
309
+ hash = {}
310
+ self.class.attribute_map.each_pair do |attr, param|
311
+ value = self.send(attr)
312
+ next if value.nil?
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ # Outputs non-array value in the form of hash
319
+ # For object, use to_hash. Otherwise, just return the value
320
+ # @param [Object] value Any valid value
321
+ # @return [Hash] Returns the value in the form of hash
322
+ def _to_hash(value)
323
+ if value.is_a?(Array)
324
+ value.compact.map { |v| _to_hash(v) }
325
+ elsif value.is_a?(Hash)
326
+ {}.tap do |hash|
327
+ value.each { |k, v| hash[k] = _to_hash(v) }
328
+ end
329
+ elsif value.respond_to? :to_hash
330
+ value.to_hash
331
+ else
332
+ value
333
+ end
334
+ end
335
+ end
336
+ end