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.
- checksums.yaml +4 -4
- data/README.md +50 -7
- data/docs/Account.md +3 -3
- data/docs/AccountDetail.md +13 -0
- data/docs/AccountReassigned.md +21 -0
- data/docs/AccountResponse.md +4 -3
- data/docs/AddressCompany.md +17 -0
- data/docs/AmountRequest.md +2 -0
- data/docs/AuthorizationTransactionGroup.md +9 -0
- data/docs/AuthorizedBeneficiariesResponse.md +10 -0
- data/docs/AuthorizedUsers.md +13 -0
- data/docs/CertificateRequest.md +11 -0
- data/docs/CodiCodeQrResponseDTO.md +17 -0
- data/docs/CodiCodeRequestDTO.md +14 -0
- data/docs/CodiOperationResponseDTO.md +14 -0
- data/docs/CodiOperationsFiltersRequestDTO.md +15 -0
- data/docs/CompanyRegistered.md +13 -0
- data/docs/CompanyRequested.md +11 -0
- data/docs/Compay.md +11 -0
- data/docs/ContractDetailRequest.md +11 -0
- data/docs/ContractDetailResponse.md +9 -0
- data/docs/ContractsDetailsApi.md +167 -0
- data/docs/CuentasDeBeneficiariosSPEIApi.md +69 -4
- data/docs/CuentasDeBeneficiariosSPIDApi.md +11 -1
- data/docs/EmpresasCoDiApi.md +107 -0
- data/docs/MessageAccountBeneficiary.md +2 -2
- data/docs/MessageCEP.md +9 -9
- data/docs/MessageCodiAction.md +19 -0
- data/docs/MessagePayment.md +3 -1
- data/docs/MessagePaymentStatePending.md +23 -0
- data/docs/MessageRequestChanged.md +2 -2
- data/docs/MessageSalesPoint.md +10 -0
- data/docs/MessageSubscription.md +6 -6
- data/docs/MessageUserAuthorized.md +13 -0
- data/docs/MessageWebHook.md +2 -2
- data/docs/OperacionesCoDiApi.md +68 -0
- data/docs/Operations.md +17 -0
- data/docs/PagerResponseDto.md +13 -0
- data/docs/Payment.md +3 -1
- data/docs/PaymentRequestCodiResponseDTO.md +18 -0
- data/docs/PeticionesDePagoPorCoDiApi.md +116 -0
- data/docs/PreMonexAuthorization.md +11 -0
- data/docs/PuntosDeVentaCoDiApi.md +113 -0
- data/docs/SalesPoint.md +10 -0
- data/docs/SalesPointFound.md +14 -0
- data/docs/SalesPointRequest.md +11 -0
- data/docs/SalesPointRespose.md +11 -0
- data/docs/SpidBeneficiaryResponse.md +2 -0
- data/docs/SuscripcionesApi.md +14 -14
- data/docs/TransactionOutgoing.md +2 -1
- data/docs/TransferenciasSPEIApi.md +60 -2
- data/docs/UrlsRedirect.md +9 -0
- data/docs/UserCompany.md +16 -0
- data/docs/Webhook.md +13 -0
- data/lib/wire4_client.rb +36 -0
- data/lib/wire4_client/api/contracts_details_api.rb +230 -0
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spei_api.rb +100 -5
- data/lib/wire4_client/api/cuentas_de_beneficiarios_spid_api.rb +15 -0
- data/lib/wire4_client/api/empresas_co_di_api.rb +137 -0
- data/lib/wire4_client/api/operaciones_co_di_api.rb +92 -0
- data/lib/wire4_client/api/peticiones_de_pago_por_co_di_api.rb +178 -0
- data/lib/wire4_client/api/puntos_de_venta_co_di_api.rb +151 -0
- data/lib/wire4_client/api/suscripciones_api.rb +14 -14
- data/lib/wire4_client/api/transferencias_spei_api.rb +82 -0
- data/lib/wire4_client/models/account.rb +3 -3
- data/lib/wire4_client/models/account_detail.rb +239 -0
- data/lib/wire4_client/models/account_reassigned.rb +375 -0
- data/lib/wire4_client/models/account_response.rb +14 -4
- data/lib/wire4_client/models/address_company.rb +275 -0
- data/lib/wire4_client/models/amount_request.rb +90 -4
- data/lib/wire4_client/models/authorization_transaction_group.rb +207 -0
- data/lib/wire4_client/models/authorized_beneficiaries_response.rb +206 -0
- data/lib/wire4_client/models/authorized_users.rb +235 -0
- data/lib/wire4_client/models/certificate_request.rb +248 -0
- data/lib/wire4_client/models/codi_code_qr_response_dto.rb +320 -0
- data/lib/wire4_client/models/codi_code_request_dto.rb +402 -0
- data/lib/wire4_client/models/codi_operation_response_dto.rb +245 -0
- data/lib/wire4_client/models/codi_operations_filters_request_dto.rb +336 -0
- data/lib/wire4_client/models/company_registered.rb +235 -0
- data/lib/wire4_client/models/company_requested.rb +215 -0
- data/lib/wire4_client/models/compay.rb +215 -0
- data/lib/wire4_client/models/contract_detail_request.rb +247 -0
- data/lib/wire4_client/models/contract_detail_response.rb +194 -0
- data/lib/wire4_client/models/message_account_beneficiary.rb +2 -2
- data/lib/wire4_client/models/message_cep.rb +10 -10
- data/lib/wire4_client/models/message_codi_action.rb +295 -0
- data/lib/wire4_client/models/message_deposit_received.rb +1 -1
- data/lib/wire4_client/models/message_payment.rb +23 -2
- data/lib/wire4_client/models/message_payment_state_pending.rb +335 -0
- data/lib/wire4_client/models/message_request_changed.rb +3 -3
- data/lib/wire4_client/models/message_sales_point.rb +205 -0
- data/lib/wire4_client/models/message_subscription.rb +7 -7
- data/lib/wire4_client/models/message_user_authorized.rb +235 -0
- data/lib/wire4_client/models/message_web_hook.rb +2 -2
- data/lib/wire4_client/models/operations.rb +321 -0
- data/lib/wire4_client/models/pager_response_dto.rb +236 -0
- data/lib/wire4_client/models/payment.rb +22 -2
- data/lib/wire4_client/models/payment_request_codi_response_dto.rb +287 -0
- data/lib/wire4_client/models/pre_monex_authorization.rb +291 -0
- data/lib/wire4_client/models/sales_point.rb +205 -0
- data/lib/wire4_client/models/sales_point_found.rb +279 -0
- data/lib/wire4_client/models/sales_point_request.rb +254 -0
- data/lib/wire4_client/models/sales_point_respose.rb +215 -0
- data/lib/wire4_client/models/spid_beneficiary_response.rb +24 -4
- data/lib/wire4_client/models/transaction_outgoing.rb +12 -2
- data/lib/wire4_client/models/urls_redirect.rb +205 -0
- data/lib/wire4_client/models/user_company.rb +269 -0
- data/lib/wire4_client/models/webhook.rb +271 -0
- data/lib/wire4_client/version.rb +1 -1
- data/spec/api/contracts_details_api_spec.rb +76 -0
- data/spec/api/cuentas_de_beneficiarios_spei_api_spec.rb +20 -1
- data/spec/api/cuentas_de_beneficiarios_spid_api_spec.rb +5 -0
- data/spec/api/empresas_co_di_api_spec.rb +60 -0
- data/spec/api/operaciones_co_di_api_spec.rb +52 -0
- data/spec/api/peticiones_de_pago_por_co_di_api_spec.rb +63 -0
- data/spec/api/puntos_de_venta_co_di_api_spec.rb +62 -0
- data/spec/api/suscripciones_api_spec.rb +7 -7
- data/spec/api/transferencias_spei_api_spec.rb +15 -0
- data/spec/models/account_detail_spec.rb +71 -0
- data/spec/models/account_reassigned_spec.rb +119 -0
- data/spec/models/account_response_spec.rb +6 -0
- data/spec/models/address_company_spec.rb +95 -0
- data/spec/models/amount_request_spec.rb +12 -0
- data/spec/models/authorization_transaction_group_spec.rb +47 -0
- data/spec/models/authorized_beneficiaries_response_spec.rb +53 -0
- data/spec/models/authorized_users_spec.rb +71 -0
- data/spec/models/certificate_request_spec.rb +59 -0
- data/spec/models/codi_code_qr_response_dto_spec.rb +103 -0
- data/spec/models/codi_code_request_dto_spec.rb +81 -0
- data/spec/models/codi_operation_response_dto_spec.rb +77 -0
- data/spec/models/codi_operations_filters_request_dto_spec.rb +87 -0
- data/spec/models/company_registered_spec.rb +71 -0
- data/spec/models/company_requested_spec.rb +59 -0
- data/spec/models/compay_spec.rb +59 -0
- data/spec/models/contract_detail_request_spec.rb +59 -0
- data/spec/models/contract_detail_response_spec.rb +47 -0
- data/spec/models/message_codi_action_spec.rb +107 -0
- data/spec/models/message_payment_spec.rb +12 -0
- data/spec/models/message_payment_state_pending_spec.rb +131 -0
- data/spec/models/message_sales_point_spec.rb +53 -0
- data/spec/models/message_user_authorized_spec.rb +71 -0
- data/spec/models/operations_spec.rb +103 -0
- data/spec/models/pager_response_dto_spec.rb +71 -0
- data/spec/models/payment_request_codi_response_dto_spec.rb +101 -0
- data/spec/models/payment_spec.rb +12 -0
- data/spec/models/pre_monex_authorization_spec.rb +59 -0
- data/spec/models/sales_point_found_spec.rb +81 -0
- data/spec/models/sales_point_request_spec.rb +59 -0
- data/spec/models/sales_point_respose_spec.rb +59 -0
- data/spec/models/sales_point_spec.rb +53 -0
- data/spec/models/spid_beneficiary_response_spec.rb +12 -0
- data/spec/models/transaction_outgoing_spec.rb +6 -0
- data/spec/models/urls_redirect_spec.rb +47 -0
- data/spec/models/user_company_spec.rb +89 -0
- data/spec/models/webhook_spec.rb +75 -0
- metadata +146 -3
- data/Gemfile.lock +0 -69
@@ -0,0 +1,279 @@
|
|
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 del punto de venta encontrada
|
17
|
+
class SalesPointFound
|
18
|
+
# Ip desde la que accede el punto de venta a wire4 y a la que se devuelven las notificaciones
|
19
|
+
attr_accessor :access_ip
|
20
|
+
|
21
|
+
# Cuenta registra para el punto de venta
|
22
|
+
attr_accessor :account
|
23
|
+
|
24
|
+
# Fecha en la que se creó el punto de venta
|
25
|
+
attr_accessor :created_at
|
26
|
+
|
27
|
+
# Nombre del punto de venta
|
28
|
+
attr_accessor :name
|
29
|
+
|
30
|
+
# Identificador del punto de venta
|
31
|
+
attr_accessor :public_id
|
32
|
+
|
33
|
+
# Estatus ACTIVO/INACTIVO el punto de venta
|
34
|
+
attr_accessor :status
|
35
|
+
|
36
|
+
# Fecha en la que se actualizó el punto de venta
|
37
|
+
attr_accessor :updated_at
|
38
|
+
|
39
|
+
class EnumAttributeValidator
|
40
|
+
attr_reader :datatype
|
41
|
+
attr_reader :allowable_values
|
42
|
+
|
43
|
+
def initialize(datatype, allowable_values)
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
45
|
+
case datatype.to_s
|
46
|
+
when /Integer/i
|
47
|
+
value.to_i
|
48
|
+
when /Float/i
|
49
|
+
value.to_f
|
50
|
+
else
|
51
|
+
value
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def valid?(value)
|
57
|
+
!value || allowable_values.include?(value)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
62
|
+
def self.attribute_map
|
63
|
+
{
|
64
|
+
:'access_ip' => :'access_ip',
|
65
|
+
:'account' => :'account',
|
66
|
+
:'created_at' => :'created_at',
|
67
|
+
:'name' => :'name',
|
68
|
+
:'public_id' => :'public_id',
|
69
|
+
:'status' => :'status',
|
70
|
+
:'updated_at' => :'updated_at'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Attribute type mapping.
|
75
|
+
def self.swagger_types
|
76
|
+
{
|
77
|
+
:'access_ip' => :'String',
|
78
|
+
:'account' => :'String',
|
79
|
+
:'created_at' => :'Timestamp',
|
80
|
+
:'name' => :'String',
|
81
|
+
:'public_id' => :'String',
|
82
|
+
:'status' => :'String',
|
83
|
+
:'updated_at' => :'Timestamp'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# Initializes the object
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
def initialize(attributes = {})
|
90
|
+
return unless attributes.is_a?(Hash)
|
91
|
+
|
92
|
+
# convert string to symbol for hash key
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
94
|
+
|
95
|
+
if attributes.has_key?(:'access_ip')
|
96
|
+
self.access_ip = attributes[:'access_ip']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'account')
|
100
|
+
self.account = attributes[:'account']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'created_at')
|
104
|
+
self.created_at = attributes[:'created_at']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'name')
|
108
|
+
self.name = attributes[:'name']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'public_id')
|
112
|
+
self.public_id = attributes[:'public_id']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.has_key?(:'status')
|
116
|
+
self.status = attributes[:'status']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.has_key?(:'updated_at')
|
120
|
+
self.updated_at = attributes[:'updated_at']
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
125
|
+
# @return Array for valid properties with the reasons
|
126
|
+
def list_invalid_properties
|
127
|
+
invalid_properties = Array.new
|
128
|
+
invalid_properties
|
129
|
+
end
|
130
|
+
|
131
|
+
# Check to see if the all the properties in the model are valid
|
132
|
+
# @return true if the model is valid
|
133
|
+
def valid?
|
134
|
+
status_validator = EnumAttributeValidator.new('String', ['ACTIVE', 'INACTIVE'])
|
135
|
+
return false unless status_validator.valid?(@status)
|
136
|
+
true
|
137
|
+
end
|
138
|
+
|
139
|
+
# Custom attribute writer method checking allowed values (enum).
|
140
|
+
# @param [Object] status Object to be assigned
|
141
|
+
def status=(status)
|
142
|
+
validator = EnumAttributeValidator.new('String', ['ACTIVE', 'INACTIVE'])
|
143
|
+
unless validator.valid?(status)
|
144
|
+
fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
|
145
|
+
end
|
146
|
+
@status = status
|
147
|
+
end
|
148
|
+
|
149
|
+
# Checks equality by comparing each attribute.
|
150
|
+
# @param [Object] Object to be compared
|
151
|
+
def ==(o)
|
152
|
+
return true if self.equal?(o)
|
153
|
+
self.class == o.class &&
|
154
|
+
access_ip == o.access_ip &&
|
155
|
+
account == o.account &&
|
156
|
+
created_at == o.created_at &&
|
157
|
+
name == o.name &&
|
158
|
+
public_id == o.public_id &&
|
159
|
+
status == o.status &&
|
160
|
+
updated_at == o.updated_at
|
161
|
+
end
|
162
|
+
|
163
|
+
# @see the `==` method
|
164
|
+
# @param [Object] Object to be compared
|
165
|
+
def eql?(o)
|
166
|
+
self == o
|
167
|
+
end
|
168
|
+
|
169
|
+
# Calculates hash code according to all attributes.
|
170
|
+
# @return [Fixnum] Hash code
|
171
|
+
def hash
|
172
|
+
[access_ip, account, created_at, name, public_id, status, updated_at].hash
|
173
|
+
end
|
174
|
+
|
175
|
+
# Builds the object from hash
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
+
# @return [Object] Returns the model itself
|
178
|
+
def build_from_hash(attributes)
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
180
|
+
self.class.swagger_types.each_pair do |key, type|
|
181
|
+
if type =~ /\AArray<(.*)>/i
|
182
|
+
# check to ensure the input is an array given that the the attribute
|
183
|
+
# is documented as an array but the input is not
|
184
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
185
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
186
|
+
end
|
187
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
188
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
189
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
190
|
+
end
|
191
|
+
|
192
|
+
self
|
193
|
+
end
|
194
|
+
|
195
|
+
# Deserializes the data based on type
|
196
|
+
# @param string type Data type
|
197
|
+
# @param string value Value to be deserialized
|
198
|
+
# @return [Object] Deserialized data
|
199
|
+
def _deserialize(type, value)
|
200
|
+
case type.to_sym
|
201
|
+
when :DateTime
|
202
|
+
DateTime.parse(value)
|
203
|
+
when :Date
|
204
|
+
Date.parse(value)
|
205
|
+
when :String
|
206
|
+
value.to_s
|
207
|
+
when :Integer
|
208
|
+
value.to_i
|
209
|
+
when :Float
|
210
|
+
value.to_f
|
211
|
+
when :BOOLEAN
|
212
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
213
|
+
true
|
214
|
+
else
|
215
|
+
false
|
216
|
+
end
|
217
|
+
when :Object
|
218
|
+
# generic object (usually a Hash), return directly
|
219
|
+
value
|
220
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
221
|
+
inner_type = Regexp.last_match[:inner_type]
|
222
|
+
value.map { |v| _deserialize(inner_type, v) }
|
223
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
224
|
+
k_type = Regexp.last_match[:k_type]
|
225
|
+
v_type = Regexp.last_match[:v_type]
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each do |k, v|
|
228
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
else # model
|
232
|
+
temp_model = Wire4Client.const_get(type).new
|
233
|
+
temp_model.build_from_hash(value)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the string representation of the object
|
238
|
+
# @return [String] String presentation of the object
|
239
|
+
def to_s
|
240
|
+
to_hash.to_s
|
241
|
+
end
|
242
|
+
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_body
|
246
|
+
to_hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Returns the object in the form of hash
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_hash
|
252
|
+
hash = {}
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
254
|
+
value = self.send(attr)
|
255
|
+
next if value.nil?
|
256
|
+
hash[param] = _to_hash(value)
|
257
|
+
end
|
258
|
+
hash
|
259
|
+
end
|
260
|
+
|
261
|
+
# Outputs non-array value in the form of hash
|
262
|
+
# For object, use to_hash. Otherwise, just return the value
|
263
|
+
# @param [Object] value Any valid value
|
264
|
+
# @return [Hash] Returns the value in the form of hash
|
265
|
+
def _to_hash(value)
|
266
|
+
if value.is_a?(Array)
|
267
|
+
value.compact.map { |v| _to_hash(v) }
|
268
|
+
elsif value.is_a?(Hash)
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
271
|
+
end
|
272
|
+
elsif value.respond_to? :to_hash
|
273
|
+
value.to_hash
|
274
|
+
else
|
275
|
+
value
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
279
|
+
end
|
@@ -0,0 +1,254 @@
|
|
1
|
+
=begin
|
2
|
+
#Wire4RestAPI
|
3
|
+
|
4
|
+
#Referencia de la API de Wire4
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.10
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Wire4Client
|
16
|
+
# Información para registrar un punto de venta asociado una empresa
|
17
|
+
class SalesPointRequest
|
18
|
+
# IP desde donde se recibiran las peticiones de este punto de venta
|
19
|
+
attr_accessor :access_ip
|
20
|
+
|
21
|
+
# Número de cuenta CLABE donde se realizará el deposito del cobro CoDi
|
22
|
+
attr_accessor :account
|
23
|
+
|
24
|
+
# Nombre del punto de venta
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
# URL para envíar notificaciones CoDi al punto de venta
|
28
|
+
attr_accessor :notifications_url
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'access_ip' => :'access_ip',
|
34
|
+
:'account' => :'account',
|
35
|
+
:'name' => :'name',
|
36
|
+
:'notifications_url' => :'notifications_url'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.swagger_types
|
42
|
+
{
|
43
|
+
:'access_ip' => :'String',
|
44
|
+
:'account' => :'String',
|
45
|
+
:'name' => :'String',
|
46
|
+
:'notifications_url' => :'String'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
return unless attributes.is_a?(Hash)
|
54
|
+
|
55
|
+
# convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
57
|
+
|
58
|
+
if attributes.has_key?(:'access_ip')
|
59
|
+
self.access_ip = attributes[:'access_ip']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.has_key?(:'account')
|
63
|
+
self.account = attributes[:'account']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.has_key?(:'name')
|
67
|
+
self.name = attributes[:'name']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.has_key?(:'notifications_url')
|
71
|
+
self.notifications_url = attributes[:'notifications_url']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if @access_ip.nil?
|
80
|
+
invalid_properties.push('invalid value for "access_ip", access_ip cannot be nil.')
|
81
|
+
end
|
82
|
+
|
83
|
+
if @access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
|
84
|
+
invalid_properties.push('invalid value for "access_ip", must conform to the pattern /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.')
|
85
|
+
end
|
86
|
+
|
87
|
+
if @account.nil?
|
88
|
+
invalid_properties.push('invalid value for "account", account cannot be nil.')
|
89
|
+
end
|
90
|
+
|
91
|
+
if @name.nil?
|
92
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
if @notifications_url.nil?
|
96
|
+
invalid_properties.push('invalid value for "notifications_url", notifications_url cannot be nil.')
|
97
|
+
end
|
98
|
+
|
99
|
+
invalid_properties
|
100
|
+
end
|
101
|
+
|
102
|
+
# Check to see if the all the properties in the model are valid
|
103
|
+
# @return true if the model is valid
|
104
|
+
def valid?
|
105
|
+
return false if @access_ip.nil?
|
106
|
+
return false if @access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
|
107
|
+
return false if @account.nil?
|
108
|
+
return false if @name.nil?
|
109
|
+
return false if @notifications_url.nil?
|
110
|
+
true
|
111
|
+
end
|
112
|
+
|
113
|
+
# Custom attribute writer method with validation
|
114
|
+
# @param [Object] access_ip Value to be assigned
|
115
|
+
def access_ip=(access_ip)
|
116
|
+
if access_ip.nil?
|
117
|
+
fail ArgumentError, 'access_ip cannot be nil'
|
118
|
+
end
|
119
|
+
|
120
|
+
if access_ip !~ Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)
|
121
|
+
fail ArgumentError, 'invalid value for "access_ip", must conform to the pattern /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.'
|
122
|
+
end
|
123
|
+
|
124
|
+
@access_ip = access_ip
|
125
|
+
end
|
126
|
+
|
127
|
+
# Checks equality by comparing each attribute.
|
128
|
+
# @param [Object] Object to be compared
|
129
|
+
def ==(o)
|
130
|
+
return true if self.equal?(o)
|
131
|
+
self.class == o.class &&
|
132
|
+
access_ip == o.access_ip &&
|
133
|
+
account == o.account &&
|
134
|
+
name == o.name &&
|
135
|
+
notifications_url == o.notifications_url
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(o)
|
141
|
+
self == o
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Fixnum] Hash code
|
146
|
+
def hash
|
147
|
+
[access_ip, account, name, notifications_url].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def build_from_hash(attributes)
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
155
|
+
self.class.swagger_types.each_pair do |key, type|
|
156
|
+
if type =~ /\AArray<(.*)>/i
|
157
|
+
# check to ensure the input is an array given that the the attribute
|
158
|
+
# is documented as an array but the input is not
|
159
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
160
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
161
|
+
end
|
162
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
163
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
164
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
165
|
+
end
|
166
|
+
|
167
|
+
self
|
168
|
+
end
|
169
|
+
|
170
|
+
# Deserializes the data based on type
|
171
|
+
# @param string type Data type
|
172
|
+
# @param string value Value to be deserialized
|
173
|
+
# @return [Object] Deserialized data
|
174
|
+
def _deserialize(type, value)
|
175
|
+
case type.to_sym
|
176
|
+
when :DateTime
|
177
|
+
DateTime.parse(value)
|
178
|
+
when :Date
|
179
|
+
Date.parse(value)
|
180
|
+
when :String
|
181
|
+
value.to_s
|
182
|
+
when :Integer
|
183
|
+
value.to_i
|
184
|
+
when :Float
|
185
|
+
value.to_f
|
186
|
+
when :BOOLEAN
|
187
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
188
|
+
true
|
189
|
+
else
|
190
|
+
false
|
191
|
+
end
|
192
|
+
when :Object
|
193
|
+
# generic object (usually a Hash), return directly
|
194
|
+
value
|
195
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
196
|
+
inner_type = Regexp.last_match[:inner_type]
|
197
|
+
value.map { |v| _deserialize(inner_type, v) }
|
198
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
199
|
+
k_type = Regexp.last_match[:k_type]
|
200
|
+
v_type = Regexp.last_match[:v_type]
|
201
|
+
{}.tap do |hash|
|
202
|
+
value.each do |k, v|
|
203
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
else # model
|
207
|
+
temp_model = Wire4Client.const_get(type).new
|
208
|
+
temp_model.build_from_hash(value)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the string representation of the object
|
213
|
+
# @return [String] String presentation of the object
|
214
|
+
def to_s
|
215
|
+
to_hash.to_s
|
216
|
+
end
|
217
|
+
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
220
|
+
def to_body
|
221
|
+
to_hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the object in the form of hash
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_hash
|
227
|
+
hash = {}
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
229
|
+
value = self.send(attr)
|
230
|
+
next if value.nil?
|
231
|
+
hash[param] = _to_hash(value)
|
232
|
+
end
|
233
|
+
hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Outputs non-array value in the form of hash
|
237
|
+
# For object, use to_hash. Otherwise, just return the value
|
238
|
+
# @param [Object] value Any valid value
|
239
|
+
# @return [Hash] Returns the value in the form of hash
|
240
|
+
def _to_hash(value)
|
241
|
+
if value.is_a?(Array)
|
242
|
+
value.compact.map { |v| _to_hash(v) }
|
243
|
+
elsif value.is_a?(Hash)
|
244
|
+
{}.tap do |hash|
|
245
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
246
|
+
end
|
247
|
+
elsif value.respond_to? :to_hash
|
248
|
+
value.to_hash
|
249
|
+
else
|
250
|
+
value
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|