pier-sdk-ruby 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/README.md +141 -0
  2. data/docs/AuthToken.md +12 -0
  3. data/docs/BodyAccessToken.md +10 -0
  4. data/docs/CancelarCartaoResponse.md +11 -0
  5. data/docs/CartaoApi.md +252 -0
  6. data/docs/CartaoResponse.md +29 -0
  7. data/docs/ConsultarCartaoResponse.md +10 -0
  8. data/docs/ConsultarContaCartaoResponse.md +18 -0
  9. data/docs/ConsultarContaResponse.md +11 -0
  10. data/docs/ConsultarExtratoContaResponse.md +23 -0
  11. data/docs/ConsultarSaldoLimitesResponse.md +23 -0
  12. data/docs/ContaApi.md +238 -0
  13. data/docs/ContaCartaoResponse.md +21 -0
  14. data/docs/ContaResponse.md +41 -0
  15. data/docs/DesbloquearCartaoResponse.md +9 -0
  16. data/docs/ExtraInfo.md +8 -0
  17. data/docs/ExtratoResponse.md +35 -0
  18. data/docs/PessoaFisicaResponse.md +26 -0
  19. data/docs/SaldoLimiteResponse.md +39 -0
  20. data/docs/TokenApi.md +114 -0
  21. data/git_push.sh +52 -0
  22. data/lib/pier-sdk-ruby.rb +62 -0
  23. data/lib/pier-sdk-ruby/api/cartao_api.rb +355 -0
  24. data/lib/pier-sdk-ruby/api/conta_api.rb +324 -0
  25. data/lib/pier-sdk-ruby/api/token_api.rb +157 -0
  26. data/lib/pier-sdk-ruby/api_client.rb +368 -0
  27. data/lib/pier-sdk-ruby/api_error.rb +40 -0
  28. data/lib/pier-sdk-ruby/configuration.rb +177 -0
  29. data/lib/pier-sdk-ruby/models/auth_token.rb +325 -0
  30. data/lib/pier-sdk-ruby/models/body_access_token.rb +275 -0
  31. data/lib/pier-sdk-ruby/models/cancelar_cartao_response.rb +286 -0
  32. data/lib/pier-sdk-ruby/models/cartao_response.rb +736 -0
  33. data/lib/pier-sdk-ruby/models/consultar_cartao_response.rb +263 -0
  34. data/lib/pier-sdk-ruby/models/consultar_conta_cartao_response.rb +461 -0
  35. data/lib/pier-sdk-ruby/models/consultar_conta_response.rb +288 -0
  36. data/lib/pier-sdk-ruby/models/consultar_extrato_conta_response.rb +588 -0
  37. data/lib/pier-sdk-ruby/models/consultar_saldo_limites_response.rb +586 -0
  38. data/lib/pier-sdk-ruby/models/conta_cartao_response.rb +536 -0
  39. data/lib/pier-sdk-ruby/models/conta_response.rb +1036 -0
  40. data/lib/pier-sdk-ruby/models/desbloquear_cartao_response.rb +236 -0
  41. data/lib/pier-sdk-ruby/models/extra_info.rb +211 -0
  42. data/lib/pier-sdk-ruby/models/extrato_response.rb +886 -0
  43. data/lib/pier-sdk-ruby/models/pessoa_fisica_response.rb +661 -0
  44. data/lib/pier-sdk-ruby/models/saldo_limite_response.rb +986 -0
  45. data/lib/pier-sdk-ruby/version.rb +19 -0
  46. data/pier-sdk-ruby.gemspec +33 -0
  47. data/spec/api/cartao_api_spec.rb +110 -0
  48. data/spec/api/conta_api_spec.rb +107 -0
  49. data/spec/api/token_api_spec.rb +71 -0
  50. data/spec/models/auth_token_spec.rb +90 -0
  51. data/spec/models/body_access_token_spec.rb +70 -0
  52. data/spec/models/cancelar_cartao_response_spec.rb +80 -0
  53. data/spec/models/cartao_response_spec.rb +260 -0
  54. data/spec/models/consultar_cartao_response_spec.rb +70 -0
  55. data/spec/models/consultar_conta_cartao_response_spec.rb +150 -0
  56. data/spec/models/consultar_conta_response_spec.rb +80 -0
  57. data/spec/models/consultar_extrato_conta_response_spec.rb +200 -0
  58. data/spec/models/consultar_saldo_limites_response_spec.rb +200 -0
  59. data/spec/models/conta_cartao_response_spec.rb +180 -0
  60. data/spec/models/conta_response_spec.rb +380 -0
  61. data/spec/models/desbloquear_cartao_response_spec.rb +60 -0
  62. data/spec/models/extra_info_spec.rb +50 -0
  63. data/spec/models/extrato_response_spec.rb +320 -0
  64. data/spec/models/pessoa_fisica_response_spec.rb +230 -0
  65. data/spec/models/saldo_limite_response_spec.rb +360 -0
  66. metadata +310 -0
@@ -0,0 +1,536 @@
1
+ =begin
2
+ CaaS - Conductor as a Service
3
+
4
+ Gest\u00C3\u00A3o de pagamento eletr\u00C3\u00B4nicos como servi\u00C3\u00A7o
5
+
6
+ OpenAPI spec version: 0.0.1
7
+ Contact: contato@conductor.com.br
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: Apache 2.0
11
+ http://www.apache.org/licenses/LICENSE-2.0.html
12
+
13
+ Terms of Service: http://dev.conductor.com.br/terms/
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module Pier
20
+ class ContaCartaoResponse
21
+ attr_accessor :cnpj_loja
22
+
23
+ attr_accessor :cpf
24
+
25
+ attr_accessor :data_cadastro_conta
26
+
27
+ attr_accessor :data_emissao_identidade
28
+
29
+ attr_accessor :data_nascimento
30
+
31
+ attr_accessor :ddd_celular
32
+
33
+ attr_accessor :id_conta
34
+
35
+ attr_accessor :nome
36
+
37
+ attr_accessor :numero_celular
38
+
39
+ attr_accessor :numero_identidade
40
+
41
+ attr_accessor :orgao_identidade
42
+
43
+ attr_accessor :possui_compra_aprovada
44
+
45
+ attr_accessor :status_conta
46
+
47
+ attr_accessor :uf_identidade
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+
53
+ :'cnpj_loja' => :'cnpjLoja',
54
+
55
+ :'cpf' => :'cpf',
56
+
57
+ :'data_cadastro_conta' => :'dataCadastroConta',
58
+
59
+ :'data_emissao_identidade' => :'dataEmissaoIdentidade',
60
+
61
+ :'data_nascimento' => :'dataNascimento',
62
+
63
+ :'ddd_celular' => :'dddCelular',
64
+
65
+ :'id_conta' => :'idConta',
66
+
67
+ :'nome' => :'nome',
68
+
69
+ :'numero_celular' => :'numeroCelular',
70
+
71
+ :'numero_identidade' => :'numeroIdentidade',
72
+
73
+ :'orgao_identidade' => :'orgaoIdentidade',
74
+
75
+ :'possui_compra_aprovada' => :'possuiCompraAprovada',
76
+
77
+ :'status_conta' => :'statusConta',
78
+
79
+ :'uf_identidade' => :'ufIdentidade'
80
+
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.swagger_types
86
+ {
87
+
88
+ :'cnpj_loja' => :'String',
89
+
90
+ :'cpf' => :'String',
91
+
92
+ :'data_cadastro_conta' => :'String',
93
+
94
+ :'data_emissao_identidade' => :'String',
95
+
96
+ :'data_nascimento' => :'String',
97
+
98
+ :'ddd_celular' => :'String',
99
+
100
+ :'id_conta' => :'Integer',
101
+
102
+ :'nome' => :'String',
103
+
104
+ :'numero_celular' => :'String',
105
+
106
+ :'numero_identidade' => :'String',
107
+
108
+ :'orgao_identidade' => :'String',
109
+
110
+ :'possui_compra_aprovada' => :'String',
111
+
112
+ :'status_conta' => :'Integer',
113
+
114
+ :'uf_identidade' => :'String'
115
+
116
+ }
117
+ end
118
+
119
+ # Initializes the object
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ def initialize(attributes = {})
122
+ return unless attributes.is_a?(Hash)
123
+
124
+ # convert string to symbol for hash key
125
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
126
+
127
+
128
+ if attributes[:'cnpjLoja']
129
+
130
+
131
+ self.cnpj_loja = attributes[:'cnpjLoja']
132
+
133
+
134
+ end
135
+
136
+
137
+ if attributes[:'cpf']
138
+
139
+
140
+ self.cpf = attributes[:'cpf']
141
+
142
+
143
+ end
144
+
145
+
146
+ if attributes[:'dataCadastroConta']
147
+
148
+
149
+ self.data_cadastro_conta = attributes[:'dataCadastroConta']
150
+
151
+
152
+ end
153
+
154
+
155
+ if attributes[:'dataEmissaoIdentidade']
156
+
157
+
158
+ self.data_emissao_identidade = attributes[:'dataEmissaoIdentidade']
159
+
160
+
161
+ end
162
+
163
+
164
+ if attributes[:'dataNascimento']
165
+
166
+
167
+ self.data_nascimento = attributes[:'dataNascimento']
168
+
169
+
170
+ end
171
+
172
+
173
+ if attributes[:'dddCelular']
174
+
175
+
176
+ self.ddd_celular = attributes[:'dddCelular']
177
+
178
+
179
+ end
180
+
181
+
182
+ if attributes[:'idConta']
183
+
184
+
185
+ self.id_conta = attributes[:'idConta']
186
+
187
+
188
+ end
189
+
190
+
191
+ if attributes[:'nome']
192
+
193
+
194
+ self.nome = attributes[:'nome']
195
+
196
+
197
+ end
198
+
199
+
200
+ if attributes[:'numeroCelular']
201
+
202
+
203
+ self.numero_celular = attributes[:'numeroCelular']
204
+
205
+
206
+ end
207
+
208
+
209
+ if attributes[:'numeroIdentidade']
210
+
211
+
212
+ self.numero_identidade = attributes[:'numeroIdentidade']
213
+
214
+
215
+ end
216
+
217
+
218
+ if attributes[:'orgaoIdentidade']
219
+
220
+
221
+ self.orgao_identidade = attributes[:'orgaoIdentidade']
222
+
223
+
224
+ end
225
+
226
+
227
+ if attributes[:'possuiCompraAprovada']
228
+
229
+
230
+ self.possui_compra_aprovada = attributes[:'possuiCompraAprovada']
231
+
232
+
233
+ end
234
+
235
+
236
+ if attributes[:'statusConta']
237
+
238
+
239
+ self.status_conta = attributes[:'statusConta']
240
+
241
+
242
+ end
243
+
244
+
245
+ if attributes[:'ufIdentidade']
246
+
247
+
248
+ self.uf_identidade = attributes[:'ufIdentidade']
249
+
250
+
251
+ end
252
+
253
+
254
+ end
255
+
256
+ # Show invalid properties with the reasons. Usually used together with valid?
257
+ # @return Array for valid properies with the reasons
258
+ def list_invalid_properties
259
+ invalid_properties = Array.new
260
+
261
+
262
+ return invalid_properties
263
+ end
264
+
265
+ # Check to see if the all the properties in the model are valid
266
+ # @return true if the model is valid
267
+ def valid?
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+ end
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+ # Checks equality by comparing each attribute.
399
+ # @param [Object] Object to be compared
400
+ def ==(o)
401
+ return true if self.equal?(o)
402
+ self.class == o.class &&
403
+ cnpj_loja == o.cnpj_loja &&
404
+ cpf == o.cpf &&
405
+ data_cadastro_conta == o.data_cadastro_conta &&
406
+ data_emissao_identidade == o.data_emissao_identidade &&
407
+ data_nascimento == o.data_nascimento &&
408
+ ddd_celular == o.ddd_celular &&
409
+ id_conta == o.id_conta &&
410
+ nome == o.nome &&
411
+ numero_celular == o.numero_celular &&
412
+ numero_identidade == o.numero_identidade &&
413
+ orgao_identidade == o.orgao_identidade &&
414
+ possui_compra_aprovada == o.possui_compra_aprovada &&
415
+ status_conta == o.status_conta &&
416
+ uf_identidade == o.uf_identidade
417
+ end
418
+
419
+ # @see the `==` method
420
+ # @param [Object] Object to be compared
421
+ def eql?(o)
422
+ self == o
423
+ end
424
+
425
+ # Calculates hash code according to all attributes.
426
+ # @return [Fixnum] Hash code
427
+ def hash
428
+ [cnpj_loja, cpf, data_cadastro_conta, data_emissao_identidade, data_nascimento, ddd_celular, id_conta, nome, numero_celular, numero_identidade, orgao_identidade, possui_compra_aprovada, status_conta, uf_identidade].hash
429
+ end
430
+
431
+ # Builds the object from hash
432
+ # @param [Hash] attributes Model attributes in the form of hash
433
+ # @return [Object] Returns the model itself
434
+ def build_from_hash(attributes)
435
+ return nil unless attributes.is_a?(Hash)
436
+ self.class.swagger_types.each_pair do |key, type|
437
+ if type =~ /^Array<(.*)>/i
438
+ # check to ensure the input is an array given that the the attribute
439
+ # is documented as an array but the input is not
440
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
441
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
442
+ end
443
+ elsif !attributes[self.class.attribute_map[key]].nil?
444
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
445
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
446
+ end
447
+
448
+ self
449
+ end
450
+
451
+ # Deserializes the data based on type
452
+ # @param string type Data type
453
+ # @param string value Value to be deserialized
454
+ # @return [Object] Deserialized data
455
+ def _deserialize(type, value)
456
+ case type.to_sym
457
+ when :DateTime
458
+ DateTime.parse(value)
459
+ when :Date
460
+ Date.parse(value)
461
+ when :String
462
+ value.to_s
463
+ when :Integer
464
+ value.to_i
465
+ when :Float
466
+ value.to_f
467
+ when :BOOLEAN
468
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
469
+ true
470
+ else
471
+ false
472
+ end
473
+ when :Object
474
+ # generic object (usually a Hash), return directly
475
+ value
476
+ when /\AArray<(?<inner_type>.+)>\z/
477
+ inner_type = Regexp.last_match[:inner_type]
478
+ value.map { |v| _deserialize(inner_type, v) }
479
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
480
+ k_type = Regexp.last_match[:k_type]
481
+ v_type = Regexp.last_match[:v_type]
482
+ {}.tap do |hash|
483
+ value.each do |k, v|
484
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
485
+ end
486
+ end
487
+ else # model
488
+ temp_model = Pier.const_get(type).new
489
+ temp_model.build_from_hash(value)
490
+ end
491
+ end
492
+
493
+ # Returns the string representation of the object
494
+ # @return [String] String presentation of the object
495
+ def to_s
496
+ to_hash.to_s
497
+ end
498
+
499
+ # to_body is an alias to to_hash (backward compatibility)
500
+ # @return [Hash] Returns the object in the form of hash
501
+ def to_body
502
+ to_hash
503
+ end
504
+
505
+ # Returns the object in the form of hash
506
+ # @return [Hash] Returns the object in the form of hash
507
+ def to_hash
508
+ hash = {}
509
+ self.class.attribute_map.each_pair do |attr, param|
510
+ value = self.send(attr)
511
+ next if value.nil?
512
+ hash[param] = _to_hash(value)
513
+ end
514
+ hash
515
+ end
516
+
517
+ # Outputs non-array value in the form of hash
518
+ # For object, use to_hash. Otherwise, just return the value
519
+ # @param [Object] value Any valid value
520
+ # @return [Hash] Returns the value in the form of hash
521
+ def _to_hash(value)
522
+ if value.is_a?(Array)
523
+ value.compact.map{ |v| _to_hash(v) }
524
+ elsif value.is_a?(Hash)
525
+ {}.tap do |hash|
526
+ value.each { |k, v| hash[k] = _to_hash(v) }
527
+ end
528
+ elsif value.respond_to? :to_hash
529
+ value.to_hash
530
+ else
531
+ value
532
+ end
533
+ end
534
+
535
+ end
536
+ end