pier-sdk-ruby 1.0.0

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.
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,586 @@
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 ConsultarSaldoLimitesResponse
21
+ attr_accessor :cod_retorno
22
+
23
+ attr_accessor :codigo_retorno
24
+
25
+ attr_accessor :descricao_retorno
26
+
27
+ attr_accessor :disponib_compra_nac
28
+
29
+ attr_accessor :disponib_global_credito
30
+
31
+ attr_accessor :disponib_parcelado_nac
32
+
33
+ attr_accessor :disponib_parcelas_nac
34
+
35
+ attr_accessor :disponib_saque_nac_global
36
+
37
+ attr_accessor :limite_compra_nac
38
+
39
+ attr_accessor :limite_global_credito
40
+
41
+ attr_accessor :limite_parcelado_nac
42
+
43
+ attr_accessor :limite_parcelas_nac
44
+
45
+ attr_accessor :limite_saque_nac_global
46
+
47
+ attr_accessor :limite_saque_nac_periodo
48
+
49
+ attr_accessor :renda_comprovada
50
+
51
+ attr_accessor :solicitacao_pendente
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+
57
+ :'cod_retorno' => :'codRetorno',
58
+
59
+ :'codigo_retorno' => :'codigoRetorno',
60
+
61
+ :'descricao_retorno' => :'descricaoRetorno',
62
+
63
+ :'disponib_compra_nac' => :'disponibCompraNac',
64
+
65
+ :'disponib_global_credito' => :'disponibGlobalCredito',
66
+
67
+ :'disponib_parcelado_nac' => :'disponibParceladoNac',
68
+
69
+ :'disponib_parcelas_nac' => :'disponibParcelasNac',
70
+
71
+ :'disponib_saque_nac_global' => :'disponibSaqueNacGlobal',
72
+
73
+ :'limite_compra_nac' => :'limiteCompraNac',
74
+
75
+ :'limite_global_credito' => :'limiteGlobalCredito',
76
+
77
+ :'limite_parcelado_nac' => :'limiteParceladoNac',
78
+
79
+ :'limite_parcelas_nac' => :'limiteParcelasNac',
80
+
81
+ :'limite_saque_nac_global' => :'limiteSaqueNacGlobal',
82
+
83
+ :'limite_saque_nac_periodo' => :'limiteSaqueNacPeriodo',
84
+
85
+ :'renda_comprovada' => :'rendaComprovada',
86
+
87
+ :'solicitacao_pendente' => :'solicitacaoPendente'
88
+
89
+ }
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.swagger_types
94
+ {
95
+
96
+ :'cod_retorno' => :'Integer',
97
+
98
+ :'codigo_retorno' => :'Integer',
99
+
100
+ :'descricao_retorno' => :'String',
101
+
102
+ :'disponib_compra_nac' => :'Float',
103
+
104
+ :'disponib_global_credito' => :'Float',
105
+
106
+ :'disponib_parcelado_nac' => :'Float',
107
+
108
+ :'disponib_parcelas_nac' => :'Float',
109
+
110
+ :'disponib_saque_nac_global' => :'Float',
111
+
112
+ :'limite_compra_nac' => :'Float',
113
+
114
+ :'limite_global_credito' => :'Float',
115
+
116
+ :'limite_parcelado_nac' => :'Float',
117
+
118
+ :'limite_parcelas_nac' => :'Float',
119
+
120
+ :'limite_saque_nac_global' => :'Float',
121
+
122
+ :'limite_saque_nac_periodo' => :'Float',
123
+
124
+ :'renda_comprovada' => :'Float',
125
+
126
+ :'solicitacao_pendente' => :'BOOLEAN'
127
+
128
+ }
129
+ end
130
+
131
+ # Initializes the object
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ def initialize(attributes = {})
134
+ return unless attributes.is_a?(Hash)
135
+
136
+ # convert string to symbol for hash key
137
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
138
+
139
+
140
+ if attributes[:'codRetorno']
141
+
142
+
143
+ self.cod_retorno = attributes[:'codRetorno']
144
+
145
+
146
+ end
147
+
148
+
149
+ if attributes[:'codigoRetorno']
150
+
151
+
152
+ self.codigo_retorno = attributes[:'codigoRetorno']
153
+
154
+
155
+ end
156
+
157
+
158
+ if attributes[:'descricaoRetorno']
159
+
160
+
161
+ self.descricao_retorno = attributes[:'descricaoRetorno']
162
+
163
+
164
+ end
165
+
166
+
167
+ if attributes[:'disponibCompraNac']
168
+
169
+
170
+ self.disponib_compra_nac = attributes[:'disponibCompraNac']
171
+
172
+
173
+ end
174
+
175
+
176
+ if attributes[:'disponibGlobalCredito']
177
+
178
+
179
+ self.disponib_global_credito = attributes[:'disponibGlobalCredito']
180
+
181
+
182
+ end
183
+
184
+
185
+ if attributes[:'disponibParceladoNac']
186
+
187
+
188
+ self.disponib_parcelado_nac = attributes[:'disponibParceladoNac']
189
+
190
+
191
+ end
192
+
193
+
194
+ if attributes[:'disponibParcelasNac']
195
+
196
+
197
+ self.disponib_parcelas_nac = attributes[:'disponibParcelasNac']
198
+
199
+
200
+ end
201
+
202
+
203
+ if attributes[:'disponibSaqueNacGlobal']
204
+
205
+
206
+ self.disponib_saque_nac_global = attributes[:'disponibSaqueNacGlobal']
207
+
208
+
209
+ end
210
+
211
+
212
+ if attributes[:'limiteCompraNac']
213
+
214
+
215
+ self.limite_compra_nac = attributes[:'limiteCompraNac']
216
+
217
+
218
+ end
219
+
220
+
221
+ if attributes[:'limiteGlobalCredito']
222
+
223
+
224
+ self.limite_global_credito = attributes[:'limiteGlobalCredito']
225
+
226
+
227
+ end
228
+
229
+
230
+ if attributes[:'limiteParceladoNac']
231
+
232
+
233
+ self.limite_parcelado_nac = attributes[:'limiteParceladoNac']
234
+
235
+
236
+ end
237
+
238
+
239
+ if attributes[:'limiteParcelasNac']
240
+
241
+
242
+ self.limite_parcelas_nac = attributes[:'limiteParcelasNac']
243
+
244
+
245
+ end
246
+
247
+
248
+ if attributes[:'limiteSaqueNacGlobal']
249
+
250
+
251
+ self.limite_saque_nac_global = attributes[:'limiteSaqueNacGlobal']
252
+
253
+
254
+ end
255
+
256
+
257
+ if attributes[:'limiteSaqueNacPeriodo']
258
+
259
+
260
+ self.limite_saque_nac_periodo = attributes[:'limiteSaqueNacPeriodo']
261
+
262
+
263
+ end
264
+
265
+
266
+ if attributes[:'rendaComprovada']
267
+
268
+
269
+ self.renda_comprovada = attributes[:'rendaComprovada']
270
+
271
+
272
+ end
273
+
274
+
275
+ if attributes[:'solicitacaoPendente']
276
+
277
+
278
+ self.solicitacao_pendente = attributes[:'solicitacaoPendente']
279
+
280
+
281
+ end
282
+
283
+
284
+ end
285
+
286
+ # Show invalid properties with the reasons. Usually used together with valid?
287
+ # @return Array for valid properies with the reasons
288
+ def list_invalid_properties
289
+ invalid_properties = Array.new
290
+
291
+
292
+ return invalid_properties
293
+ end
294
+
295
+ # Check to see if the all the properties in the model are valid
296
+ # @return true if the model is valid
297
+ def valid?
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
+
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
+ end
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
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+ # Checks equality by comparing each attribute.
447
+ # @param [Object] Object to be compared
448
+ def ==(o)
449
+ return true if self.equal?(o)
450
+ self.class == o.class &&
451
+ cod_retorno == o.cod_retorno &&
452
+ codigo_retorno == o.codigo_retorno &&
453
+ descricao_retorno == o.descricao_retorno &&
454
+ disponib_compra_nac == o.disponib_compra_nac &&
455
+ disponib_global_credito == o.disponib_global_credito &&
456
+ disponib_parcelado_nac == o.disponib_parcelado_nac &&
457
+ disponib_parcelas_nac == o.disponib_parcelas_nac &&
458
+ disponib_saque_nac_global == o.disponib_saque_nac_global &&
459
+ limite_compra_nac == o.limite_compra_nac &&
460
+ limite_global_credito == o.limite_global_credito &&
461
+ limite_parcelado_nac == o.limite_parcelado_nac &&
462
+ limite_parcelas_nac == o.limite_parcelas_nac &&
463
+ limite_saque_nac_global == o.limite_saque_nac_global &&
464
+ limite_saque_nac_periodo == o.limite_saque_nac_periodo &&
465
+ renda_comprovada == o.renda_comprovada &&
466
+ solicitacao_pendente == o.solicitacao_pendente
467
+ end
468
+
469
+ # @see the `==` method
470
+ # @param [Object] Object to be compared
471
+ def eql?(o)
472
+ self == o
473
+ end
474
+
475
+ # Calculates hash code according to all attributes.
476
+ # @return [Fixnum] Hash code
477
+ def hash
478
+ [cod_retorno, codigo_retorno, descricao_retorno, disponib_compra_nac, disponib_global_credito, disponib_parcelado_nac, disponib_parcelas_nac, disponib_saque_nac_global, limite_compra_nac, limite_global_credito, limite_parcelado_nac, limite_parcelas_nac, limite_saque_nac_global, limite_saque_nac_periodo, renda_comprovada, solicitacao_pendente].hash
479
+ end
480
+
481
+ # Builds the object from hash
482
+ # @param [Hash] attributes Model attributes in the form of hash
483
+ # @return [Object] Returns the model itself
484
+ def build_from_hash(attributes)
485
+ return nil unless attributes.is_a?(Hash)
486
+ self.class.swagger_types.each_pair do |key, type|
487
+ if type =~ /^Array<(.*)>/i
488
+ # check to ensure the input is an array given that the the attribute
489
+ # is documented as an array but the input is not
490
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
491
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
492
+ end
493
+ elsif !attributes[self.class.attribute_map[key]].nil?
494
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
495
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
496
+ end
497
+
498
+ self
499
+ end
500
+
501
+ # Deserializes the data based on type
502
+ # @param string type Data type
503
+ # @param string value Value to be deserialized
504
+ # @return [Object] Deserialized data
505
+ def _deserialize(type, value)
506
+ case type.to_sym
507
+ when :DateTime
508
+ DateTime.parse(value)
509
+ when :Date
510
+ Date.parse(value)
511
+ when :String
512
+ value.to_s
513
+ when :Integer
514
+ value.to_i
515
+ when :Float
516
+ value.to_f
517
+ when :BOOLEAN
518
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
519
+ true
520
+ else
521
+ false
522
+ end
523
+ when :Object
524
+ # generic object (usually a Hash), return directly
525
+ value
526
+ when /\AArray<(?<inner_type>.+)>\z/
527
+ inner_type = Regexp.last_match[:inner_type]
528
+ value.map { |v| _deserialize(inner_type, v) }
529
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
530
+ k_type = Regexp.last_match[:k_type]
531
+ v_type = Regexp.last_match[:v_type]
532
+ {}.tap do |hash|
533
+ value.each do |k, v|
534
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
535
+ end
536
+ end
537
+ else # model
538
+ temp_model = Pier.const_get(type).new
539
+ temp_model.build_from_hash(value)
540
+ end
541
+ end
542
+
543
+ # Returns the string representation of the object
544
+ # @return [String] String presentation of the object
545
+ def to_s
546
+ to_hash.to_s
547
+ end
548
+
549
+ # to_body is an alias to to_hash (backward compatibility)
550
+ # @return [Hash] Returns the object in the form of hash
551
+ def to_body
552
+ to_hash
553
+ end
554
+
555
+ # Returns the object in the form of hash
556
+ # @return [Hash] Returns the object in the form of hash
557
+ def to_hash
558
+ hash = {}
559
+ self.class.attribute_map.each_pair do |attr, param|
560
+ value = self.send(attr)
561
+ next if value.nil?
562
+ hash[param] = _to_hash(value)
563
+ end
564
+ hash
565
+ end
566
+
567
+ # Outputs non-array value in the form of hash
568
+ # For object, use to_hash. Otherwise, just return the value
569
+ # @param [Object] value Any valid value
570
+ # @return [Hash] Returns the value in the form of hash
571
+ def _to_hash(value)
572
+ if value.is_a?(Array)
573
+ value.compact.map{ |v| _to_hash(v) }
574
+ elsif value.is_a?(Hash)
575
+ {}.tap do |hash|
576
+ value.each { |k, v| hash[k] = _to_hash(v) }
577
+ end
578
+ elsif value.respond_to? :to_hash
579
+ value.to_hash
580
+ else
581
+ value
582
+ end
583
+ end
584
+
585
+ end
586
+ end