wire4_client 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +27 -0
- data/docs/AccountReassigned.md +1 -1
- data/docs/AccountResponse.md +1 -0
- data/docs/BeneficiaryDTO.md +10 -0
- data/docs/CargosRecurrentesApi.md +110 -0
- data/docs/CepResponse.md +1 -0
- data/docs/CepSearchBanxico.md +1 -0
- data/docs/CertificateRequest.md +1 -1
- data/docs/CodiCodeQrResponseDTO.md +1 -0
- data/docs/CodiCodeRequestDTO.md +6 -3
- data/docs/ConfirmRecurringCharge.md +9 -0
- data/docs/CuentasDeBeneficiariosSPEIApi.md +4 -0
- data/docs/CuentasDeBeneficiariosSPIDApi.md +4 -0
- data/docs/Customer.md +9 -0
- data/docs/Deposit.md +1 -0
- data/docs/Depositant.md +1 -0
- data/docs/DepositantCountResponse.md +8 -0
- data/docs/DepositantesApi.md +164 -1
- data/docs/FailedChargesDataDTO.md +13 -0
- data/docs/MessageDepositReceived.md +3 -0
- data/docs/PaymentRequestReportDTO.md +17 -0
- data/docs/PaymentRequestReq.md +18 -0
- data/docs/PaymentRequestResponse.md +10 -0
- data/docs/PaymentsSpeiAndSpidOrderId.md +9 -0
- data/docs/PaymentsSpeiAndSpidRequestId.md +12 -0
- data/docs/Person.md +1 -1
- data/docs/Product.md +11 -0
- data/docs/RecurringChargeRequest.md +14 -0
- data/docs/ReporteDeSolicitudesDePagosApi.md +107 -0
- data/docs/SolicitudDePagosApi.md +59 -0
- data/docs/SpidBeneficiaryResponse.md +1 -0
- data/docs/SuccessChargesDataDTO.md +12 -0
- data/docs/SuccessDataDTO.md +9 -0
- data/docs/TransactionSpeiSpid.md +15 -0
- data/docs/TransactionsRegister.md +11 -0
- data/docs/TransferenciasSPEIApi.md +163 -0
- data/lib/wire4_client/api/cargos_recurrentes_api.rb +143 -0
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spei_api.rb +6 -0
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spid_api.rb +6 -0
- data/lib/wire4_client/api/depositantes_api.rb +207 -2
- data/lib/wire4_client/api/reporte_de_solicitudes_de_pagos_api.rb +134 -0
- data/lib/wire4_client/api/solicitud_de_pagos_api.rb +84 -0
- data/lib/wire4_client/api/transferencias_spei_api.rb +234 -4
- data/lib/wire4_client/models/account_reassigned.rb +11 -11
- data/lib/wire4_client/models/account_response.rb +11 -1
- data/lib/wire4_client/models/amount_request.rb +10 -10
- data/lib/wire4_client/models/beneficiary_dto.rb +201 -0
- data/lib/wire4_client/models/cep_response.rb +45 -1
- data/lib/wire4_client/models/cep_search_banxico.rb +48 -4
- data/lib/wire4_client/models/certificate_request.rb +6 -15
- data/lib/wire4_client/models/codi_code_qr_response_dto.rb +15 -5
- data/lib/wire4_client/models/codi_code_request_dto.rb +94 -20
- data/lib/wire4_client/models/codi_operations_filters_request_dto.rb +2 -2
- data/lib/wire4_client/models/confirm_recurring_charge.rb +194 -0
- data/lib/wire4_client/models/customer.rb +205 -0
- data/lib/wire4_client/models/deposit.rb +48 -4
- data/lib/wire4_client/models/depositant.rb +14 -4
- data/lib/wire4_client/models/depositant_count_response.rb +185 -0
- data/lib/wire4_client/models/failed_charges_data_dto.rb +228 -0
- data/lib/wire4_client/models/message_deposit_received.rb +31 -1
- data/lib/wire4_client/models/operations.rb +4 -4
- data/lib/wire4_client/models/payment_codi.rb +2 -2
- data/lib/wire4_client/models/payment_request_report_dto.rb +300 -0
- data/lib/wire4_client/models/payment_request_req.rb +401 -0
- data/lib/wire4_client/models/payment_request_response.rb +204 -0
- data/lib/wire4_client/models/payments_spei_and_spid_order_id.rb +199 -0
- data/lib/wire4_client/models/payments_spei_and_spid_request_id.rb +229 -0
- data/lib/wire4_client/models/person.rb +0 -5
- data/lib/wire4_client/models/product.rb +288 -0
- data/lib/wire4_client/models/recurring_charge_request.rb +278 -0
- data/lib/wire4_client/models/sales_point_request.rb +5 -5
- data/lib/wire4_client/models/spid_beneficiary_response.rb +11 -1
- data/lib/wire4_client/models/success_charges_data_dto.rb +219 -0
- data/lib/wire4_client/models/success_data_dto.rb +226 -0
- data/lib/wire4_client/models/transaction_outgoing.rb +5 -5
- data/lib/wire4_client/models/transaction_spei_spid.rb +390 -0
- data/lib/wire4_client/models/transactions_register.rb +229 -0
- data/lib/wire4_client/version.rb +1 -1
- data/lib/wire4_client.rb +19 -0
- data/spec/api/cargos_recurrentes_api_spec.rb +61 -0
- data/spec/api/cuentas_de_beneficiarios_spei_api_spec.rb +2 -0
- data/spec/api/cuentas_de_beneficiarios_spid_api_spec.rb +2 -0
- data/spec/api/depositantes_api_spec.rb +42 -1
- data/spec/api/reporte_de_solicitudes_de_pagos_api_spec.rb +59 -0
- data/spec/api/solicitud_de_pagos_api_spec.rb +48 -0
- data/spec/api/transferencias_spei_api_spec.rb +42 -0
- data/spec/models/account_reassigned_spec.rb +3 -3
- data/spec/models/account_response_spec.rb +6 -0
- data/spec/models/beneficiary_dto_spec.rb +53 -0
- data/spec/models/cep_response_spec.rb +10 -0
- data/spec/models/cep_search_banxico_spec.rb +10 -0
- data/spec/models/codi_code_qr_response_dto_spec.rb +8 -2
- data/spec/models/codi_code_request_dto_spec.rb +23 -1
- data/spec/models/codi_operations_filters_request_dto_spec.rb +1 -1
- data/spec/models/confirm_recurring_charge_spec.rb +47 -0
- data/spec/models/customer_spec.rb +47 -0
- data/spec/models/deposit_spec.rb +10 -0
- data/spec/models/depositant_count_response_spec.rb +41 -0
- data/spec/models/depositant_spec.rb +6 -0
- data/spec/models/failed_charges_data_dto_spec.rb +71 -0
- data/spec/models/message_deposit_received_spec.rb +18 -0
- data/spec/models/operations_spec.rb +2 -2
- data/spec/models/payment_codi_spec.rb +1 -1
- data/spec/models/payment_request_report_dto_spec.rb +99 -0
- data/spec/models/payment_request_req_spec.rb +109 -0
- data/spec/models/payment_request_response_spec.rb +53 -0
- data/spec/models/payments_spei_and_spid_order_id_spec.rb +47 -0
- data/spec/models/payments_spei_and_spid_request_id_spec.rb +65 -0
- data/spec/models/product_spec.rb +63 -0
- data/spec/models/recurring_charge_request_spec.rb +77 -0
- data/spec/models/spid_beneficiary_response_spec.rb +6 -0
- data/spec/models/success_charges_data_dto_spec.rb +65 -0
- data/spec/models/success_data_dto_spec.rb +51 -0
- data/spec/models/transaction_spei_spid_spec.rb +83 -0
- data/spec/models/transactions_register_spec.rb +59 -0
- data/wire4_client-1.1.3.gem +0 -0
- data/wire4_client.gemspec +7 -7
- metadata +108 -55
|
@@ -0,0 +1,219 @@
|
|
|
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 SuccessChargesDataDTO
|
|
17
|
+
attr_accessor :authorization
|
|
18
|
+
|
|
19
|
+
attr_accessor :brand
|
|
20
|
+
|
|
21
|
+
attr_accessor :card_number
|
|
22
|
+
|
|
23
|
+
attr_accessor :date
|
|
24
|
+
|
|
25
|
+
attr_accessor :holder_name
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'authorization' => :'authorization',
|
|
31
|
+
:'brand' => :'brand',
|
|
32
|
+
:'card_number' => :'card_number',
|
|
33
|
+
:'date' => :'date',
|
|
34
|
+
:'holder_name' => :'holder_name'
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.swagger_types
|
|
40
|
+
{
|
|
41
|
+
:'authorization' => :'String',
|
|
42
|
+
:'brand' => :'String',
|
|
43
|
+
:'card_number' => :'String',
|
|
44
|
+
:'date' => :'String',
|
|
45
|
+
:'holder_name' => :'String'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Initializes the object
|
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
51
|
+
def initialize(attributes = {})
|
|
52
|
+
return unless attributes.is_a?(Hash)
|
|
53
|
+
|
|
54
|
+
# convert string to symbol for hash key
|
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
56
|
+
|
|
57
|
+
if attributes.has_key?(:'authorization')
|
|
58
|
+
self.authorization = attributes[:'authorization']
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
if attributes.has_key?(:'brand')
|
|
62
|
+
self.brand = attributes[:'brand']
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
if attributes.has_key?(:'card_number')
|
|
66
|
+
self.card_number = attributes[:'card_number']
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if attributes.has_key?(:'date')
|
|
70
|
+
self.date = attributes[:'date']
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
if attributes.has_key?(:'holder_name')
|
|
74
|
+
self.holder_name = attributes[:'holder_name']
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
79
|
+
# @return Array for valid properties with the reasons
|
|
80
|
+
def list_invalid_properties
|
|
81
|
+
invalid_properties = Array.new
|
|
82
|
+
invalid_properties
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Check to see if the all the properties in the model are valid
|
|
86
|
+
# @return true if the model is valid
|
|
87
|
+
def valid?
|
|
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
|
+
authorization == o.authorization &&
|
|
97
|
+
brand == o.brand &&
|
|
98
|
+
card_number == o.card_number &&
|
|
99
|
+
date == o.date &&
|
|
100
|
+
holder_name == o.holder_name
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# @see the `==` method
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def eql?(o)
|
|
106
|
+
self == o
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Calculates hash code according to all attributes.
|
|
110
|
+
# @return [Fixnum] Hash code
|
|
111
|
+
def hash
|
|
112
|
+
[authorization, brand, card_number, date, holder_name].hash
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Builds the object from hash
|
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
117
|
+
# @return [Object] Returns the model itself
|
|
118
|
+
def build_from_hash(attributes)
|
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
|
120
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
121
|
+
if type =~ /\AArray<(.*)>/i
|
|
122
|
+
# check to ensure the input is an array given that the the attribute
|
|
123
|
+
# is documented as an array but the input is not
|
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
126
|
+
end
|
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
129
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
self
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Deserializes the data based on type
|
|
136
|
+
# @param string type Data type
|
|
137
|
+
# @param string value Value to be deserialized
|
|
138
|
+
# @return [Object] Deserialized data
|
|
139
|
+
def _deserialize(type, value)
|
|
140
|
+
case type.to_sym
|
|
141
|
+
when :DateTime
|
|
142
|
+
DateTime.parse(value)
|
|
143
|
+
when :Date
|
|
144
|
+
Date.parse(value)
|
|
145
|
+
when :String
|
|
146
|
+
value.to_s
|
|
147
|
+
when :Integer
|
|
148
|
+
value.to_i
|
|
149
|
+
when :Float
|
|
150
|
+
value.to_f
|
|
151
|
+
when :BOOLEAN
|
|
152
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
153
|
+
true
|
|
154
|
+
else
|
|
155
|
+
false
|
|
156
|
+
end
|
|
157
|
+
when :Object
|
|
158
|
+
# generic object (usually a Hash), return directly
|
|
159
|
+
value
|
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
163
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
|
166
|
+
{}.tap do |hash|
|
|
167
|
+
value.each do |k, v|
|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
else # model
|
|
172
|
+
temp_model = Wire4Client.const_get(type).new
|
|
173
|
+
temp_model.build_from_hash(value)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Returns the string representation of the object
|
|
178
|
+
# @return [String] String presentation of the object
|
|
179
|
+
def to_s
|
|
180
|
+
to_hash.to_s
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_body
|
|
186
|
+
to_hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Returns the object in the form of hash
|
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
|
191
|
+
def to_hash
|
|
192
|
+
hash = {}
|
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
194
|
+
value = self.send(attr)
|
|
195
|
+
next if value.nil?
|
|
196
|
+
hash[param] = _to_hash(value)
|
|
197
|
+
end
|
|
198
|
+
hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Outputs non-array value in the form of hash
|
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
203
|
+
# @param [Object] value Any valid value
|
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
|
205
|
+
def _to_hash(value)
|
|
206
|
+
if value.is_a?(Array)
|
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
|
208
|
+
elsif value.is_a?(Hash)
|
|
209
|
+
{}.tap do |hash|
|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
211
|
+
end
|
|
212
|
+
elsif value.respond_to? :to_hash
|
|
213
|
+
value.to_hash
|
|
214
|
+
else
|
|
215
|
+
value
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
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 SuccessDataDTO
|
|
17
|
+
attr_accessor :data
|
|
18
|
+
|
|
19
|
+
attr_accessor :method
|
|
20
|
+
|
|
21
|
+
class EnumAttributeValidator
|
|
22
|
+
attr_reader :datatype
|
|
23
|
+
attr_reader :allowable_values
|
|
24
|
+
|
|
25
|
+
def initialize(datatype, allowable_values)
|
|
26
|
+
@allowable_values = allowable_values.map do |value|
|
|
27
|
+
case datatype.to_s
|
|
28
|
+
when /Integer/i
|
|
29
|
+
value.to_i
|
|
30
|
+
when /Float/i
|
|
31
|
+
value.to_f
|
|
32
|
+
else
|
|
33
|
+
value
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def valid?(value)
|
|
39
|
+
!value || allowable_values.include?(value)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
|
+
def self.attribute_map
|
|
45
|
+
{
|
|
46
|
+
:'data' => :'data',
|
|
47
|
+
:'method' => :'method'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.swagger_types
|
|
53
|
+
{
|
|
54
|
+
:'data' => :'SuccessChargesDataDTO',
|
|
55
|
+
:'method' => :'String'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Initializes the object
|
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
61
|
+
def initialize(attributes = {})
|
|
62
|
+
return unless attributes.is_a?(Hash)
|
|
63
|
+
|
|
64
|
+
# convert string to symbol for hash key
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
66
|
+
|
|
67
|
+
if attributes.has_key?(:'data')
|
|
68
|
+
self.data = attributes[:'data']
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
if attributes.has_key?(:'method')
|
|
72
|
+
self.method = attributes[:'method']
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
invalid_properties = Array.new
|
|
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
|
+
method_validator = EnumAttributeValidator.new('String', ['CARD', 'CASH'])
|
|
87
|
+
return false unless method_validator.valid?(@method)
|
|
88
|
+
true
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
92
|
+
# @param [Object] method Object to be assigned
|
|
93
|
+
def method=(method)
|
|
94
|
+
validator = EnumAttributeValidator.new('String', ['CARD', 'CASH'])
|
|
95
|
+
unless validator.valid?(method)
|
|
96
|
+
fail ArgumentError, 'invalid value for "method", must be one of #{validator.allowable_values}.'
|
|
97
|
+
end
|
|
98
|
+
@method = method
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Checks equality by comparing each attribute.
|
|
102
|
+
# @param [Object] Object to be compared
|
|
103
|
+
def ==(o)
|
|
104
|
+
return true if self.equal?(o)
|
|
105
|
+
self.class == o.class &&
|
|
106
|
+
data == o.data &&
|
|
107
|
+
method == o.method
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# @see the `==` method
|
|
111
|
+
# @param [Object] Object to be compared
|
|
112
|
+
def eql?(o)
|
|
113
|
+
self == o
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Calculates hash code according to all attributes.
|
|
117
|
+
# @return [Fixnum] Hash code
|
|
118
|
+
def hash
|
|
119
|
+
[data, method].hash
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Builds the object from hash
|
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
124
|
+
# @return [Object] Returns the model itself
|
|
125
|
+
def build_from_hash(attributes)
|
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
|
127
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
128
|
+
if type =~ /\AArray<(.*)>/i
|
|
129
|
+
# check to ensure the input is an array given that the the attribute
|
|
130
|
+
# is documented as an array but the input is not
|
|
131
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
132
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
133
|
+
end
|
|
134
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
135
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
136
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
self
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Deserializes the data based on type
|
|
143
|
+
# @param string type Data type
|
|
144
|
+
# @param string value Value to be deserialized
|
|
145
|
+
# @return [Object] Deserialized data
|
|
146
|
+
def _deserialize(type, value)
|
|
147
|
+
case type.to_sym
|
|
148
|
+
when :DateTime
|
|
149
|
+
DateTime.parse(value)
|
|
150
|
+
when :Date
|
|
151
|
+
Date.parse(value)
|
|
152
|
+
when :String
|
|
153
|
+
value.to_s
|
|
154
|
+
when :Integer
|
|
155
|
+
value.to_i
|
|
156
|
+
when :Float
|
|
157
|
+
value.to_f
|
|
158
|
+
when :BOOLEAN
|
|
159
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
160
|
+
true
|
|
161
|
+
else
|
|
162
|
+
false
|
|
163
|
+
end
|
|
164
|
+
when :Object
|
|
165
|
+
# generic object (usually a Hash), return directly
|
|
166
|
+
value
|
|
167
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
168
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
169
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
170
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
171
|
+
k_type = Regexp.last_match[:k_type]
|
|
172
|
+
v_type = Regexp.last_match[:v_type]
|
|
173
|
+
{}.tap do |hash|
|
|
174
|
+
value.each do |k, v|
|
|
175
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
else # model
|
|
179
|
+
temp_model = Wire4Client.const_get(type).new
|
|
180
|
+
temp_model.build_from_hash(value)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Returns the string representation of the object
|
|
185
|
+
# @return [String] String presentation of the object
|
|
186
|
+
def to_s
|
|
187
|
+
to_hash.to_s
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_body
|
|
193
|
+
to_hash
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Returns the object in the form of hash
|
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
|
198
|
+
def to_hash
|
|
199
|
+
hash = {}
|
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
201
|
+
value = self.send(attr)
|
|
202
|
+
next if value.nil?
|
|
203
|
+
hash[param] = _to_hash(value)
|
|
204
|
+
end
|
|
205
|
+
hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Outputs non-array value in the form of hash
|
|
209
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
210
|
+
# @param [Object] value Any valid value
|
|
211
|
+
# @return [Hash] Returns the value in the form of hash
|
|
212
|
+
def _to_hash(value)
|
|
213
|
+
if value.is_a?(Array)
|
|
214
|
+
value.compact.map { |v| _to_hash(v) }
|
|
215
|
+
elsif value.is_a?(Hash)
|
|
216
|
+
{}.tap do |hash|
|
|
217
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
218
|
+
end
|
|
219
|
+
elsif value.respond_to? :to_hash
|
|
220
|
+
value.to_hash
|
|
221
|
+
else
|
|
222
|
+
value
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|
|
@@ -146,8 +146,8 @@ module Wire4Client
|
|
|
146
146
|
invalid_properties.push('invalid value for "order_id", order_id cannot be nil.')
|
|
147
147
|
end
|
|
148
148
|
|
|
149
|
-
if @order_id.to_s.length >
|
|
150
|
-
invalid_properties.push('invalid value for "order_id", the character length must be smaller than or equal to
|
|
149
|
+
if @order_id.to_s.length > 256
|
|
150
|
+
invalid_properties.push('invalid value for "order_id", the character length must be smaller than or equal to 256.')
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
if @order_id.to_s.length < 1
|
|
@@ -180,7 +180,7 @@ module Wire4Client
|
|
|
180
180
|
return false if @concept.to_s.length < 1
|
|
181
181
|
return false if @currency_code.nil?
|
|
182
182
|
return false if @order_id.nil?
|
|
183
|
-
return false if @order_id.to_s.length >
|
|
183
|
+
return false if @order_id.to_s.length > 256
|
|
184
184
|
return false if @order_id.to_s.length < 1
|
|
185
185
|
return false if @reference.nil?
|
|
186
186
|
return false if @reference > 9999999
|
|
@@ -227,8 +227,8 @@ module Wire4Client
|
|
|
227
227
|
fail ArgumentError, 'order_id cannot be nil'
|
|
228
228
|
end
|
|
229
229
|
|
|
230
|
-
if order_id.to_s.length >
|
|
231
|
-
fail ArgumentError, 'invalid value for "order_id", the character length must be smaller than or equal to
|
|
230
|
+
if order_id.to_s.length > 256
|
|
231
|
+
fail ArgumentError, 'invalid value for "order_id", the character length must be smaller than or equal to 256.'
|
|
232
232
|
end
|
|
233
233
|
|
|
234
234
|
if order_id.to_s.length < 1
|