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,236 @@
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 DesbloquearCartaoResponse
21
+ attr_accessor :codigo_retorno
22
+
23
+ attr_accessor :descricao_retorno
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'codigo_retorno' => :'codigoRetorno',
30
+
31
+ :'descricao_retorno' => :'descricaoRetorno'
32
+
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+
40
+ :'codigo_retorno' => :'Integer',
41
+
42
+ :'descricao_retorno' => :'String'
43
+
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
+
55
+
56
+ if attributes[:'codigoRetorno']
57
+
58
+
59
+ self.codigo_retorno = attributes[:'codigoRetorno']
60
+
61
+
62
+ end
63
+
64
+
65
+ if attributes[:'descricaoRetorno']
66
+
67
+
68
+ self.descricao_retorno = attributes[:'descricaoRetorno']
69
+
70
+
71
+ end
72
+
73
+
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properies with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+
81
+
82
+ return 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
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ end
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ codigo_retorno == o.codigo_retorno &&
116
+ descricao_retorno == o.descricao_retorno
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Fixnum] Hash code
127
+ def hash
128
+ [codigo_retorno, descricao_retorno].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.swagger_types.each_pair do |key, type|
137
+ if type =~ /^Array<(.*)>/i
138
+ # check to ensure the input is an array given that the the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
142
+ end
143
+ elsif !attributes[self.class.attribute_map[key]].nil?
144
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :DateTime
158
+ DateTime.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :BOOLEAN
168
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ temp_model = Pier.const_get(type).new
189
+ temp_model.build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ next if value.nil?
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map{ |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+ end
@@ -0,0 +1,211 @@
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 ExtraInfo
21
+ attr_accessor :id_emissor
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+
27
+ :'id_emissor' => :'idEmissor'
28
+
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+
36
+ :'id_emissor' => :'Integer'
37
+
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+
50
+ if attributes[:'idEmissor']
51
+
52
+
53
+ self.id_emissor = attributes[:'idEmissor']
54
+
55
+
56
+ end
57
+
58
+
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properies with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+
66
+
67
+ return invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+
74
+
75
+
76
+
77
+
78
+ end
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ id_emissor == o.id_emissor
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Fixnum] Hash code
102
+ def hash
103
+ [id_emissor].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /^Array<(.*)>/i
113
+ # check to ensure the input is an array given that the the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :BOOLEAN
143
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ temp_model = Pier.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map{ |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+
210
+ end
211
+ end
@@ -0,0 +1,886 @@
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 ExtratoResponse
21
+ attr_accessor :cartao
22
+
23
+ attr_accessor :chip
24
+
25
+ attr_accessor :cidade_uf_pais
26
+
27
+ attr_accessor :codigo_autorizacao
28
+
29
+ attr_accessor :codigo_moeda
30
+
31
+ attr_accessor :codigo_moeda_destino
32
+
33
+ attr_accessor :cotacao_dolar
34
+
35
+ attr_accessor :credito
36
+
37
+ attr_accessor :data_compra
38
+
39
+ attr_accessor :data_cotacao_dolar
40
+
41
+ attr_accessor :data_entrada_compra
42
+
43
+ attr_accessor :data_transacao_utc
44
+
45
+ attr_accessor :debito
46
+
47
+ attr_accessor :descricao_modo_entrada
48
+
49
+ attr_accessor :descricao_transacao
50
+
51
+ attr_accessor :encargos_financeiros
52
+
53
+ attr_accessor :historico
54
+
55
+ attr_accessor :id_evento_externo
56
+
57
+ attr_accessor :id_tipo_transacao
58
+
59
+ attr_accessor :id_transacao
60
+
61
+ attr_accessor :mcc
62
+
63
+ attr_accessor :nome_estab_visa
64
+
65
+ attr_accessor :nome_plastico
66
+
67
+ attr_accessor :numero_estabelecimento
68
+
69
+ attr_accessor :origem
70
+
71
+ attr_accessor :taxa_embarque
72
+
73
+ attr_accessor :tipo_evento
74
+
75
+ attr_accessor :valor_dolar
76
+
77
+ # Attribute mapping from ruby-style variable name to JSON key.
78
+ def self.attribute_map
79
+ {
80
+
81
+ :'cartao' => :'cartao',
82
+
83
+ :'chip' => :'chip',
84
+
85
+ :'cidade_uf_pais' => :'cidadeUFPais',
86
+
87
+ :'codigo_autorizacao' => :'codigoAutorizacao',
88
+
89
+ :'codigo_moeda' => :'codigoMoeda',
90
+
91
+ :'codigo_moeda_destino' => :'codigoMoedaDestino',
92
+
93
+ :'cotacao_dolar' => :'cotacaoDolar',
94
+
95
+ :'credito' => :'credito',
96
+
97
+ :'data_compra' => :'dataCompra',
98
+
99
+ :'data_cotacao_dolar' => :'dataCotacaoDolar',
100
+
101
+ :'data_entrada_compra' => :'dataEntradaCompra',
102
+
103
+ :'data_transacao_utc' => :'dataTransacaoUTC',
104
+
105
+ :'debito' => :'debito',
106
+
107
+ :'descricao_modo_entrada' => :'descricaoModoEntrada',
108
+
109
+ :'descricao_transacao' => :'descricaoTransacao',
110
+
111
+ :'encargos_financeiros' => :'encargosFinanceiros',
112
+
113
+ :'historico' => :'historico',
114
+
115
+ :'id_evento_externo' => :'idEventoExterno',
116
+
117
+ :'id_tipo_transacao' => :'idTipoTransacao',
118
+
119
+ :'id_transacao' => :'idTransacao',
120
+
121
+ :'mcc' => :'mcc',
122
+
123
+ :'nome_estab_visa' => :'nomeEstabVisa',
124
+
125
+ :'nome_plastico' => :'nomePlastico',
126
+
127
+ :'numero_estabelecimento' => :'numeroEstabelecimento',
128
+
129
+ :'origem' => :'origem',
130
+
131
+ :'taxa_embarque' => :'taxaEmbarque',
132
+
133
+ :'tipo_evento' => :'tipoEvento',
134
+
135
+ :'valor_dolar' => :'valorDolar'
136
+
137
+ }
138
+ end
139
+
140
+ # Attribute type mapping.
141
+ def self.swagger_types
142
+ {
143
+
144
+ :'cartao' => :'String',
145
+
146
+ :'chip' => :'String',
147
+
148
+ :'cidade_uf_pais' => :'String',
149
+
150
+ :'codigo_autorizacao' => :'String',
151
+
152
+ :'codigo_moeda' => :'String',
153
+
154
+ :'codigo_moeda_destino' => :'String',
155
+
156
+ :'cotacao_dolar' => :'Float',
157
+
158
+ :'credito' => :'Float',
159
+
160
+ :'data_compra' => :'String',
161
+
162
+ :'data_cotacao_dolar' => :'DateTime',
163
+
164
+ :'data_entrada_compra' => :'String',
165
+
166
+ :'data_transacao_utc' => :'String',
167
+
168
+ :'debito' => :'Float',
169
+
170
+ :'descricao_modo_entrada' => :'String',
171
+
172
+ :'descricao_transacao' => :'String',
173
+
174
+ :'encargos_financeiros' => :'Float',
175
+
176
+ :'historico' => :'String',
177
+
178
+ :'id_evento_externo' => :'Integer',
179
+
180
+ :'id_tipo_transacao' => :'Integer',
181
+
182
+ :'id_transacao' => :'Integer',
183
+
184
+ :'mcc' => :'Integer',
185
+
186
+ :'nome_estab_visa' => :'String',
187
+
188
+ :'nome_plastico' => :'String',
189
+
190
+ :'numero_estabelecimento' => :'Integer',
191
+
192
+ :'origem' => :'String',
193
+
194
+ :'taxa_embarque' => :'Float',
195
+
196
+ :'tipo_evento' => :'String',
197
+
198
+ :'valor_dolar' => :'Float'
199
+
200
+ }
201
+ end
202
+
203
+ # Initializes the object
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ def initialize(attributes = {})
206
+ return unless attributes.is_a?(Hash)
207
+
208
+ # convert string to symbol for hash key
209
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
210
+
211
+
212
+ if attributes[:'cartao']
213
+
214
+
215
+ self.cartao = attributes[:'cartao']
216
+
217
+
218
+ end
219
+
220
+
221
+ if attributes[:'chip']
222
+
223
+
224
+ self.chip = attributes[:'chip']
225
+
226
+
227
+ end
228
+
229
+
230
+ if attributes[:'cidadeUFPais']
231
+
232
+
233
+ self.cidade_uf_pais = attributes[:'cidadeUFPais']
234
+
235
+
236
+ end
237
+
238
+
239
+ if attributes[:'codigoAutorizacao']
240
+
241
+
242
+ self.codigo_autorizacao = attributes[:'codigoAutorizacao']
243
+
244
+
245
+ end
246
+
247
+
248
+ if attributes[:'codigoMoeda']
249
+
250
+
251
+ self.codigo_moeda = attributes[:'codigoMoeda']
252
+
253
+
254
+ end
255
+
256
+
257
+ if attributes[:'codigoMoedaDestino']
258
+
259
+
260
+ self.codigo_moeda_destino = attributes[:'codigoMoedaDestino']
261
+
262
+
263
+ end
264
+
265
+
266
+ if attributes[:'cotacaoDolar']
267
+
268
+
269
+ self.cotacao_dolar = attributes[:'cotacaoDolar']
270
+
271
+
272
+ end
273
+
274
+
275
+ if attributes[:'credito']
276
+
277
+
278
+ self.credito = attributes[:'credito']
279
+
280
+
281
+ end
282
+
283
+
284
+ if attributes[:'dataCompra']
285
+
286
+
287
+ self.data_compra = attributes[:'dataCompra']
288
+
289
+
290
+ end
291
+
292
+
293
+ if attributes[:'dataCotacaoDolar']
294
+
295
+
296
+ self.data_cotacao_dolar = attributes[:'dataCotacaoDolar']
297
+
298
+
299
+ end
300
+
301
+
302
+ if attributes[:'dataEntradaCompra']
303
+
304
+
305
+ self.data_entrada_compra = attributes[:'dataEntradaCompra']
306
+
307
+
308
+ end
309
+
310
+
311
+ if attributes[:'dataTransacaoUTC']
312
+
313
+
314
+ self.data_transacao_utc = attributes[:'dataTransacaoUTC']
315
+
316
+
317
+ end
318
+
319
+
320
+ if attributes[:'debito']
321
+
322
+
323
+ self.debito = attributes[:'debito']
324
+
325
+
326
+ end
327
+
328
+
329
+ if attributes[:'descricaoModoEntrada']
330
+
331
+
332
+ self.descricao_modo_entrada = attributes[:'descricaoModoEntrada']
333
+
334
+
335
+ end
336
+
337
+
338
+ if attributes[:'descricaoTransacao']
339
+
340
+
341
+ self.descricao_transacao = attributes[:'descricaoTransacao']
342
+
343
+
344
+ end
345
+
346
+
347
+ if attributes[:'encargosFinanceiros']
348
+
349
+
350
+ self.encargos_financeiros = attributes[:'encargosFinanceiros']
351
+
352
+
353
+ end
354
+
355
+
356
+ if attributes[:'historico']
357
+
358
+
359
+ self.historico = attributes[:'historico']
360
+
361
+
362
+ end
363
+
364
+
365
+ if attributes[:'idEventoExterno']
366
+
367
+
368
+ self.id_evento_externo = attributes[:'idEventoExterno']
369
+
370
+
371
+ end
372
+
373
+
374
+ if attributes[:'idTipoTransacao']
375
+
376
+
377
+ self.id_tipo_transacao = attributes[:'idTipoTransacao']
378
+
379
+
380
+ end
381
+
382
+
383
+ if attributes[:'idTransacao']
384
+
385
+
386
+ self.id_transacao = attributes[:'idTransacao']
387
+
388
+
389
+ end
390
+
391
+
392
+ if attributes[:'mcc']
393
+
394
+
395
+ self.mcc = attributes[:'mcc']
396
+
397
+
398
+ end
399
+
400
+
401
+ if attributes[:'nomeEstabVisa']
402
+
403
+
404
+ self.nome_estab_visa = attributes[:'nomeEstabVisa']
405
+
406
+
407
+ end
408
+
409
+
410
+ if attributes[:'nomePlastico']
411
+
412
+
413
+ self.nome_plastico = attributes[:'nomePlastico']
414
+
415
+
416
+ end
417
+
418
+
419
+ if attributes[:'numeroEstabelecimento']
420
+
421
+
422
+ self.numero_estabelecimento = attributes[:'numeroEstabelecimento']
423
+
424
+
425
+ end
426
+
427
+
428
+ if attributes[:'origem']
429
+
430
+
431
+ self.origem = attributes[:'origem']
432
+
433
+
434
+ end
435
+
436
+
437
+ if attributes[:'taxaEmbarque']
438
+
439
+
440
+ self.taxa_embarque = attributes[:'taxaEmbarque']
441
+
442
+
443
+ end
444
+
445
+
446
+ if attributes[:'tipoEvento']
447
+
448
+
449
+ self.tipo_evento = attributes[:'tipoEvento']
450
+
451
+
452
+ end
453
+
454
+
455
+ if attributes[:'valorDolar']
456
+
457
+
458
+ self.valor_dolar = attributes[:'valorDolar']
459
+
460
+
461
+ end
462
+
463
+
464
+ end
465
+
466
+ # Show invalid properties with the reasons. Usually used together with valid?
467
+ # @return Array for valid properies with the reasons
468
+ def list_invalid_properties
469
+ invalid_properties = Array.new
470
+
471
+
472
+ return invalid_properties
473
+ end
474
+
475
+ # Check to see if the all the properties in the model are valid
476
+ # @return true if the model is valid
477
+ def valid?
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+
530
+
531
+
532
+
533
+
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+ end
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+
726
+
727
+
728
+
729
+
730
+
731
+
732
+
733
+
734
+ # Checks equality by comparing each attribute.
735
+ # @param [Object] Object to be compared
736
+ def ==(o)
737
+ return true if self.equal?(o)
738
+ self.class == o.class &&
739
+ cartao == o.cartao &&
740
+ chip == o.chip &&
741
+ cidade_uf_pais == o.cidade_uf_pais &&
742
+ codigo_autorizacao == o.codigo_autorizacao &&
743
+ codigo_moeda == o.codigo_moeda &&
744
+ codigo_moeda_destino == o.codigo_moeda_destino &&
745
+ cotacao_dolar == o.cotacao_dolar &&
746
+ credito == o.credito &&
747
+ data_compra == o.data_compra &&
748
+ data_cotacao_dolar == o.data_cotacao_dolar &&
749
+ data_entrada_compra == o.data_entrada_compra &&
750
+ data_transacao_utc == o.data_transacao_utc &&
751
+ debito == o.debito &&
752
+ descricao_modo_entrada == o.descricao_modo_entrada &&
753
+ descricao_transacao == o.descricao_transacao &&
754
+ encargos_financeiros == o.encargos_financeiros &&
755
+ historico == o.historico &&
756
+ id_evento_externo == o.id_evento_externo &&
757
+ id_tipo_transacao == o.id_tipo_transacao &&
758
+ id_transacao == o.id_transacao &&
759
+ mcc == o.mcc &&
760
+ nome_estab_visa == o.nome_estab_visa &&
761
+ nome_plastico == o.nome_plastico &&
762
+ numero_estabelecimento == o.numero_estabelecimento &&
763
+ origem == o.origem &&
764
+ taxa_embarque == o.taxa_embarque &&
765
+ tipo_evento == o.tipo_evento &&
766
+ valor_dolar == o.valor_dolar
767
+ end
768
+
769
+ # @see the `==` method
770
+ # @param [Object] Object to be compared
771
+ def eql?(o)
772
+ self == o
773
+ end
774
+
775
+ # Calculates hash code according to all attributes.
776
+ # @return [Fixnum] Hash code
777
+ def hash
778
+ [cartao, chip, cidade_uf_pais, codigo_autorizacao, codigo_moeda, codigo_moeda_destino, cotacao_dolar, credito, data_compra, data_cotacao_dolar, data_entrada_compra, data_transacao_utc, debito, descricao_modo_entrada, descricao_transacao, encargos_financeiros, historico, id_evento_externo, id_tipo_transacao, id_transacao, mcc, nome_estab_visa, nome_plastico, numero_estabelecimento, origem, taxa_embarque, tipo_evento, valor_dolar].hash
779
+ end
780
+
781
+ # Builds the object from hash
782
+ # @param [Hash] attributes Model attributes in the form of hash
783
+ # @return [Object] Returns the model itself
784
+ def build_from_hash(attributes)
785
+ return nil unless attributes.is_a?(Hash)
786
+ self.class.swagger_types.each_pair do |key, type|
787
+ if type =~ /^Array<(.*)>/i
788
+ # check to ensure the input is an array given that the the attribute
789
+ # is documented as an array but the input is not
790
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
791
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
792
+ end
793
+ elsif !attributes[self.class.attribute_map[key]].nil?
794
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
795
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
796
+ end
797
+
798
+ self
799
+ end
800
+
801
+ # Deserializes the data based on type
802
+ # @param string type Data type
803
+ # @param string value Value to be deserialized
804
+ # @return [Object] Deserialized data
805
+ def _deserialize(type, value)
806
+ case type.to_sym
807
+ when :DateTime
808
+ DateTime.parse(value)
809
+ when :Date
810
+ Date.parse(value)
811
+ when :String
812
+ value.to_s
813
+ when :Integer
814
+ value.to_i
815
+ when :Float
816
+ value.to_f
817
+ when :BOOLEAN
818
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
819
+ true
820
+ else
821
+ false
822
+ end
823
+ when :Object
824
+ # generic object (usually a Hash), return directly
825
+ value
826
+ when /\AArray<(?<inner_type>.+)>\z/
827
+ inner_type = Regexp.last_match[:inner_type]
828
+ value.map { |v| _deserialize(inner_type, v) }
829
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
830
+ k_type = Regexp.last_match[:k_type]
831
+ v_type = Regexp.last_match[:v_type]
832
+ {}.tap do |hash|
833
+ value.each do |k, v|
834
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
835
+ end
836
+ end
837
+ else # model
838
+ temp_model = Pier.const_get(type).new
839
+ temp_model.build_from_hash(value)
840
+ end
841
+ end
842
+
843
+ # Returns the string representation of the object
844
+ # @return [String] String presentation of the object
845
+ def to_s
846
+ to_hash.to_s
847
+ end
848
+
849
+ # to_body is an alias to to_hash (backward compatibility)
850
+ # @return [Hash] Returns the object in the form of hash
851
+ def to_body
852
+ to_hash
853
+ end
854
+
855
+ # Returns the object in the form of hash
856
+ # @return [Hash] Returns the object in the form of hash
857
+ def to_hash
858
+ hash = {}
859
+ self.class.attribute_map.each_pair do |attr, param|
860
+ value = self.send(attr)
861
+ next if value.nil?
862
+ hash[param] = _to_hash(value)
863
+ end
864
+ hash
865
+ end
866
+
867
+ # Outputs non-array value in the form of hash
868
+ # For object, use to_hash. Otherwise, just return the value
869
+ # @param [Object] value Any valid value
870
+ # @return [Hash] Returns the value in the form of hash
871
+ def _to_hash(value)
872
+ if value.is_a?(Array)
873
+ value.compact.map{ |v| _to_hash(v) }
874
+ elsif value.is_a?(Hash)
875
+ {}.tap do |hash|
876
+ value.each { |k, v| hash[k] = _to_hash(v) }
877
+ end
878
+ elsif value.respond_to? :to_hash
879
+ value.to_hash
880
+ else
881
+ value
882
+ end
883
+ end
884
+
885
+ end
886
+ end