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,263 @@
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 ConsultarCartaoResponse
21
+ attr_accessor :cartoes
22
+
23
+ attr_accessor :codigo_retorno
24
+
25
+ attr_accessor :descricao_retorno
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+
31
+ :'cartoes' => :'cartoes',
32
+
33
+ :'codigo_retorno' => :'codigoRetorno',
34
+
35
+ :'descricao_retorno' => :'descricaoRetorno'
36
+
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+
44
+ :'cartoes' => :'Array<CartaoResponse>',
45
+
46
+ :'codigo_retorno' => :'Integer',
47
+
48
+ :'descricao_retorno' => :'String'
49
+
50
+ }
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
60
+
61
+
62
+ if attributes[:'cartoes']
63
+
64
+ if (value = attributes[:'cartoes']).is_a?(Array)
65
+ self.cartoes = value
66
+ end
67
+
68
+
69
+
70
+ end
71
+
72
+
73
+ if attributes[:'codigoRetorno']
74
+
75
+
76
+ self.codigo_retorno = attributes[:'codigoRetorno']
77
+
78
+
79
+ end
80
+
81
+
82
+ if attributes[:'descricaoRetorno']
83
+
84
+
85
+ self.descricao_retorno = attributes[:'descricaoRetorno']
86
+
87
+
88
+ end
89
+
90
+
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properies with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+
98
+
99
+ return 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
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ end
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ cartoes == o.cartoes &&
142
+ codigo_retorno == o.codigo_retorno &&
143
+ descricao_retorno == o.descricao_retorno
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Fixnum] Hash code
154
+ def hash
155
+ [cartoes, codigo_retorno, descricao_retorno].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ self.class.swagger_types.each_pair do |key, type|
164
+ if type =~ /^Array<(.*)>/i
165
+ # check to ensure the input is an array given that the the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :DateTime
185
+ DateTime.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :BOOLEAN
195
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ temp_model = Pier.const_get(type).new
216
+ temp_model.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ next if value.nil?
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map{ |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+ end
@@ -0,0 +1,461 @@
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 ConsultarContaCartaoResponse
21
+ attr_accessor :data_validade
22
+
23
+ attr_accessor :descricao_estagio
24
+
25
+ attr_accessor :descricao_status
26
+
27
+ attr_accessor :estagio
28
+
29
+ attr_accessor :flag_cancelamento
30
+
31
+ attr_accessor :id_cartao
32
+
33
+ attr_accessor :numero_cartao
34
+
35
+ attr_accessor :portador
36
+
37
+ attr_accessor :portador_id
38
+
39
+ attr_accessor :status
40
+
41
+ attr_accessor :status_data
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+
47
+ :'data_validade' => :'dataValidade',
48
+
49
+ :'descricao_estagio' => :'descricaoEstagio',
50
+
51
+ :'descricao_status' => :'descricaoStatus',
52
+
53
+ :'estagio' => :'estagio',
54
+
55
+ :'flag_cancelamento' => :'flagCancelamento',
56
+
57
+ :'id_cartao' => :'idCartao',
58
+
59
+ :'numero_cartao' => :'numeroCartao',
60
+
61
+ :'portador' => :'portador',
62
+
63
+ :'portador_id' => :'portadorId',
64
+
65
+ :'status' => :'status',
66
+
67
+ :'status_data' => :'statusData'
68
+
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+
76
+ :'data_validade' => :'String',
77
+
78
+ :'descricao_estagio' => :'String',
79
+
80
+ :'descricao_status' => :'String',
81
+
82
+ :'estagio' => :'Integer',
83
+
84
+ :'flag_cancelamento' => :'BOOLEAN',
85
+
86
+ :'id_cartao' => :'Integer',
87
+
88
+ :'numero_cartao' => :'String',
89
+
90
+ :'portador' => :'String',
91
+
92
+ :'portador_id' => :'Integer',
93
+
94
+ :'status' => :'Integer',
95
+
96
+ :'status_data' => :'DateTime'
97
+
98
+ }
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ return unless attributes.is_a?(Hash)
105
+
106
+ # convert string to symbol for hash key
107
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
108
+
109
+
110
+ if attributes[:'dataValidade']
111
+
112
+
113
+ self.data_validade = attributes[:'dataValidade']
114
+
115
+
116
+ end
117
+
118
+
119
+ if attributes[:'descricaoEstagio']
120
+
121
+
122
+ self.descricao_estagio = attributes[:'descricaoEstagio']
123
+
124
+
125
+ end
126
+
127
+
128
+ if attributes[:'descricaoStatus']
129
+
130
+
131
+ self.descricao_status = attributes[:'descricaoStatus']
132
+
133
+
134
+ end
135
+
136
+
137
+ if attributes[:'estagio']
138
+
139
+
140
+ self.estagio = attributes[:'estagio']
141
+
142
+
143
+ end
144
+
145
+
146
+ if attributes[:'flagCancelamento']
147
+
148
+
149
+ self.flag_cancelamento = attributes[:'flagCancelamento']
150
+
151
+
152
+ end
153
+
154
+
155
+ if attributes[:'idCartao']
156
+
157
+
158
+ self.id_cartao = attributes[:'idCartao']
159
+
160
+
161
+ end
162
+
163
+
164
+ if attributes[:'numeroCartao']
165
+
166
+
167
+ self.numero_cartao = attributes[:'numeroCartao']
168
+
169
+
170
+ end
171
+
172
+
173
+ if attributes[:'portador']
174
+
175
+
176
+ self.portador = attributes[:'portador']
177
+
178
+
179
+ end
180
+
181
+
182
+ if attributes[:'portadorId']
183
+
184
+
185
+ self.portador_id = attributes[:'portadorId']
186
+
187
+
188
+ end
189
+
190
+
191
+ if attributes[:'status']
192
+
193
+
194
+ self.status = attributes[:'status']
195
+
196
+
197
+ end
198
+
199
+
200
+ if attributes[:'statusData']
201
+
202
+
203
+ self.status_data = attributes[:'statusData']
204
+
205
+
206
+ end
207
+
208
+
209
+ end
210
+
211
+ # Show invalid properties with the reasons. Usually used together with valid?
212
+ # @return Array for valid properies with the reasons
213
+ def list_invalid_properties
214
+ invalid_properties = Array.new
215
+
216
+
217
+ return invalid_properties
218
+ end
219
+
220
+ # Check to see if the all the properties in the model are valid
221
+ # @return true if the model is valid
222
+ def valid?
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+ end
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
+
326
+ # Checks equality by comparing each attribute.
327
+ # @param [Object] Object to be compared
328
+ def ==(o)
329
+ return true if self.equal?(o)
330
+ self.class == o.class &&
331
+ data_validade == o.data_validade &&
332
+ descricao_estagio == o.descricao_estagio &&
333
+ descricao_status == o.descricao_status &&
334
+ estagio == o.estagio &&
335
+ flag_cancelamento == o.flag_cancelamento &&
336
+ id_cartao == o.id_cartao &&
337
+ numero_cartao == o.numero_cartao &&
338
+ portador == o.portador &&
339
+ portador_id == o.portador_id &&
340
+ status == o.status &&
341
+ status_data == o.status_data
342
+ end
343
+
344
+ # @see the `==` method
345
+ # @param [Object] Object to be compared
346
+ def eql?(o)
347
+ self == o
348
+ end
349
+
350
+ # Calculates hash code according to all attributes.
351
+ # @return [Fixnum] Hash code
352
+ def hash
353
+ [data_validade, descricao_estagio, descricao_status, estagio, flag_cancelamento, id_cartao, numero_cartao, portador, portador_id, status, status_data].hash
354
+ end
355
+
356
+ # Builds the object from hash
357
+ # @param [Hash] attributes Model attributes in the form of hash
358
+ # @return [Object] Returns the model itself
359
+ def build_from_hash(attributes)
360
+ return nil unless attributes.is_a?(Hash)
361
+ self.class.swagger_types.each_pair do |key, type|
362
+ if type =~ /^Array<(.*)>/i
363
+ # check to ensure the input is an array given that the the attribute
364
+ # is documented as an array but the input is not
365
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
366
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
367
+ end
368
+ elsif !attributes[self.class.attribute_map[key]].nil?
369
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
370
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
371
+ end
372
+
373
+ self
374
+ end
375
+
376
+ # Deserializes the data based on type
377
+ # @param string type Data type
378
+ # @param string value Value to be deserialized
379
+ # @return [Object] Deserialized data
380
+ def _deserialize(type, value)
381
+ case type.to_sym
382
+ when :DateTime
383
+ DateTime.parse(value)
384
+ when :Date
385
+ Date.parse(value)
386
+ when :String
387
+ value.to_s
388
+ when :Integer
389
+ value.to_i
390
+ when :Float
391
+ value.to_f
392
+ when :BOOLEAN
393
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
394
+ true
395
+ else
396
+ false
397
+ end
398
+ when :Object
399
+ # generic object (usually a Hash), return directly
400
+ value
401
+ when /\AArray<(?<inner_type>.+)>\z/
402
+ inner_type = Regexp.last_match[:inner_type]
403
+ value.map { |v| _deserialize(inner_type, v) }
404
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
405
+ k_type = Regexp.last_match[:k_type]
406
+ v_type = Regexp.last_match[:v_type]
407
+ {}.tap do |hash|
408
+ value.each do |k, v|
409
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
410
+ end
411
+ end
412
+ else # model
413
+ temp_model = Pier.const_get(type).new
414
+ temp_model.build_from_hash(value)
415
+ end
416
+ end
417
+
418
+ # Returns the string representation of the object
419
+ # @return [String] String presentation of the object
420
+ def to_s
421
+ to_hash.to_s
422
+ end
423
+
424
+ # to_body is an alias to to_hash (backward compatibility)
425
+ # @return [Hash] Returns the object in the form of hash
426
+ def to_body
427
+ to_hash
428
+ end
429
+
430
+ # Returns the object in the form of hash
431
+ # @return [Hash] Returns the object in the form of hash
432
+ def to_hash
433
+ hash = {}
434
+ self.class.attribute_map.each_pair do |attr, param|
435
+ value = self.send(attr)
436
+ next if value.nil?
437
+ hash[param] = _to_hash(value)
438
+ end
439
+ hash
440
+ end
441
+
442
+ # Outputs non-array value in the form of hash
443
+ # For object, use to_hash. Otherwise, just return the value
444
+ # @param [Object] value Any valid value
445
+ # @return [Hash] Returns the value in the form of hash
446
+ def _to_hash(value)
447
+ if value.is_a?(Array)
448
+ value.compact.map{ |v| _to_hash(v) }
449
+ elsif value.is_a?(Hash)
450
+ {}.tap do |hash|
451
+ value.each { |k, v| hash[k] = _to_hash(v) }
452
+ end
453
+ elsif value.respond_to? :to_hash
454
+ value.to_hash
455
+ else
456
+ value
457
+ end
458
+ end
459
+
460
+ end
461
+ end