Class: Pier::ExtratoResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/pier-sdk-ruby/models/extrato_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ExtratoResponse

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
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
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
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
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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 205

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  
  if attributes[:'cartao']
    
    
    self.cartao = attributes[:'cartao']
    
  
  end

  
  if attributes[:'chip']
    
    
    self.chip = attributes[:'chip']
    
  
  end

  
  if attributes[:'cidadeUFPais']
    
    
    self.cidade_uf_pais = attributes[:'cidadeUFPais']
    
  
  end

  
  if attributes[:'codigoAutorizacao']
    
    
    self.codigo_autorizacao = attributes[:'codigoAutorizacao']
    
  
  end

  
  if attributes[:'codigoMoeda']
    
    
    self.codigo_moeda = attributes[:'codigoMoeda']
    
  
  end

  
  if attributes[:'codigoMoedaDestino']
    
    
    self.codigo_moeda_destino = attributes[:'codigoMoedaDestino']
    
  
  end

  
  if attributes[:'cotacaoDolar']
    
    
    self.cotacao_dolar = attributes[:'cotacaoDolar']
    
  
  end

  
  if attributes[:'credito']
    
    
    self.credito = attributes[:'credito']
    
  
  end

  
  if attributes[:'dataCompra']
    
    
    self.data_compra = attributes[:'dataCompra']
    
  
  end

  
  if attributes[:'dataCotacaoDolar']
    
    
    self.data_cotacao_dolar = attributes[:'dataCotacaoDolar']
    
  
  end

  
  if attributes[:'dataEntradaCompra']
    
    
    self.data_entrada_compra = attributes[:'dataEntradaCompra']
    
  
  end

  
  if attributes[:'dataTransacaoUTC']
    
    
    self.data_transacao_utc = attributes[:'dataTransacaoUTC']
    
  
  end

  
  if attributes[:'debito']
    
    
    self.debito = attributes[:'debito']
    
  
  end

  
  if attributes[:'descricaoModoEntrada']
    
    
    self.descricao_modo_entrada = attributes[:'descricaoModoEntrada']
    
  
  end

  
  if attributes[:'descricaoTransacao']
    
    
    self.descricao_transacao = attributes[:'descricaoTransacao']
    
  
  end

  
  if attributes[:'encargosFinanceiros']
    
    
    self.encargos_financeiros = attributes[:'encargosFinanceiros']
    
  
  end

  
  if attributes[:'historico']
    
    
    self.historico = attributes[:'historico']
    
  
  end

  
  if attributes[:'idEventoExterno']
    
    
    self.id_evento_externo = attributes[:'idEventoExterno']
    
  
  end

  
  if attributes[:'idTipoTransacao']
    
    
    self.id_tipo_transacao = attributes[:'idTipoTransacao']
    
  
  end

  
  if attributes[:'idTransacao']
    
    
    self.id_transacao = attributes[:'idTransacao']
    
  
  end

  
  if attributes[:'mcc']
    
    
    self.mcc = attributes[:'mcc']
    
  
  end

  
  if attributes[:'nomeEstabVisa']
    
    
    self.nome_estab_visa = attributes[:'nomeEstabVisa']
    
  
  end

  
  if attributes[:'nomePlastico']
    
    
    self.nome_plastico = attributes[:'nomePlastico']
    
  
  end

  
  if attributes[:'numeroEstabelecimento']
    
    
    self.numero_estabelecimento = attributes[:'numeroEstabelecimento']
    
  
  end

  
  if attributes[:'origem']
    
    
    self.origem = attributes[:'origem']
    
  
  end

  
  if attributes[:'taxaEmbarque']
    
    
    self.taxa_embarque = attributes[:'taxaEmbarque']
    
  
  end

  
  if attributes[:'tipoEvento']
    
    
    self.tipo_evento = attributes[:'tipoEvento']
    
  
  end

  
  if attributes[:'valorDolar']
    
    
    self.valor_dolar = attributes[:'valorDolar']
    
  
  end

  
end

Instance Attribute Details

#cartaoObject

Returns the value of attribute cartao.



21
22
23
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 21

def cartao
  @cartao
end

#chipObject

Returns the value of attribute chip.



23
24
25
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 23

def chip
  @chip
end

#cidade_uf_paisObject

Returns the value of attribute cidade_uf_pais.



25
26
27
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 25

def cidade_uf_pais
  @cidade_uf_pais
end

#codigo_autorizacaoObject

Returns the value of attribute codigo_autorizacao.



27
28
29
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 27

def codigo_autorizacao
  @codigo_autorizacao
end

#codigo_moedaObject

Returns the value of attribute codigo_moeda.



29
30
31
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 29

def codigo_moeda
  @codigo_moeda
end

#codigo_moeda_destinoObject

Returns the value of attribute codigo_moeda_destino.



31
32
33
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 31

def codigo_moeda_destino
  @codigo_moeda_destino
end

#cotacao_dolarObject

Returns the value of attribute cotacao_dolar.



33
34
35
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 33

def cotacao_dolar
  @cotacao_dolar
end

#creditoObject

Returns the value of attribute credito.



35
36
37
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 35

def credito
  @credito
end

#data_compraObject

Returns the value of attribute data_compra.



37
38
39
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 37

def data_compra
  @data_compra
end

#data_cotacao_dolarObject

Returns the value of attribute data_cotacao_dolar.



39
40
41
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 39

def data_cotacao_dolar
  @data_cotacao_dolar
end

#data_entrada_compraObject

Returns the value of attribute data_entrada_compra.



41
42
43
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 41

def data_entrada_compra
  @data_entrada_compra
end

#data_transacao_utcObject

Returns the value of attribute data_transacao_utc.



43
44
45
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 43

def data_transacao_utc
  @data_transacao_utc
end

#debitoObject

Returns the value of attribute debito.



45
46
47
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 45

def debito
  @debito
end

#descricao_modo_entradaObject

Returns the value of attribute descricao_modo_entrada.



47
48
49
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 47

def descricao_modo_entrada
  @descricao_modo_entrada
end

#descricao_transacaoObject

Returns the value of attribute descricao_transacao.



49
50
51
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 49

def descricao_transacao
  @descricao_transacao
end

#encargos_financeirosObject

Returns the value of attribute encargos_financeiros.



51
52
53
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 51

def encargos_financeiros
  @encargos_financeiros
end

#historicoObject

Returns the value of attribute historico.



53
54
55
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 53

def historico
  @historico
end

#id_evento_externoObject

Returns the value of attribute id_evento_externo.



55
56
57
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 55

def id_evento_externo
  @id_evento_externo
end

#id_tipo_transacaoObject

Returns the value of attribute id_tipo_transacao.



57
58
59
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 57

def id_tipo_transacao
  @id_tipo_transacao
end

#id_transacaoObject

Returns the value of attribute id_transacao.



59
60
61
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 59

def id_transacao
  @id_transacao
end

#mccObject

Returns the value of attribute mcc.



61
62
63
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 61

def mcc
  @mcc
end

#nome_estab_visaObject

Returns the value of attribute nome_estab_visa.



63
64
65
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 63

def nome_estab_visa
  @nome_estab_visa
end

#nome_plasticoObject

Returns the value of attribute nome_plastico.



65
66
67
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 65

def nome_plastico
  @nome_plastico
end

#numero_estabelecimentoObject

Returns the value of attribute numero_estabelecimento.



67
68
69
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 67

def numero_estabelecimento
  @numero_estabelecimento
end

#origemObject

Returns the value of attribute origem.



69
70
71
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 69

def origem
  @origem
end

#taxa_embarqueObject

Returns the value of attribute taxa_embarque.



71
72
73
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 71

def taxa_embarque
  @taxa_embarque
end

#tipo_eventoObject

Returns the value of attribute tipo_evento.



73
74
75
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 73

def tipo_evento
  @tipo_evento
end

#valor_dolarObject

Returns the value of attribute valor_dolar.



75
76
77
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 75

def valor_dolar
  @valor_dolar
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 78

def self.attribute_map
  {
    
    :'cartao' => :'cartao',
    
    :'chip' => :'chip',
    
    :'cidade_uf_pais' => :'cidadeUFPais',
    
    :'codigo_autorizacao' => :'codigoAutorizacao',
    
    :'codigo_moeda' => :'codigoMoeda',
    
    :'codigo_moeda_destino' => :'codigoMoedaDestino',
    
    :'cotacao_dolar' => :'cotacaoDolar',
    
    :'credito' => :'credito',
    
    :'data_compra' => :'dataCompra',
    
    :'data_cotacao_dolar' => :'dataCotacaoDolar',
    
    :'data_entrada_compra' => :'dataEntradaCompra',
    
    :'data_transacao_utc' => :'dataTransacaoUTC',
    
    :'debito' => :'debito',
    
    :'descricao_modo_entrada' => :'descricaoModoEntrada',
    
    :'descricao_transacao' => :'descricaoTransacao',
    
    :'encargos_financeiros' => :'encargosFinanceiros',
    
    :'historico' => :'historico',
    
    :'id_evento_externo' => :'idEventoExterno',
    
    :'id_tipo_transacao' => :'idTipoTransacao',
    
    :'id_transacao' => :'idTransacao',
    
    :'mcc' => :'mcc',
    
    :'nome_estab_visa' => :'nomeEstabVisa',
    
    :'nome_plastico' => :'nomePlastico',
    
    :'numero_estabelecimento' => :'numeroEstabelecimento',
    
    :'origem' => :'origem',
    
    :'taxa_embarque' => :'taxaEmbarque',
    
    :'tipo_evento' => :'tipoEvento',
    
    :'valor_dolar' => :'valorDolar'
    
  }
end

.swagger_typesObject

Attribute type mapping.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 141

def self.swagger_types
  {
    
    :'cartao' => :'String',
    
    :'chip' => :'String',
    
    :'cidade_uf_pais' => :'String',
    
    :'codigo_autorizacao' => :'String',
    
    :'codigo_moeda' => :'String',
    
    :'codigo_moeda_destino' => :'String',
    
    :'cotacao_dolar' => :'Float',
    
    :'credito' => :'Float',
    
    :'data_compra' => :'String',
    
    :'data_cotacao_dolar' => :'DateTime',
    
    :'data_entrada_compra' => :'String',
    
    :'data_transacao_utc' => :'String',
    
    :'debito' => :'Float',
    
    :'descricao_modo_entrada' => :'String',
    
    :'descricao_transacao' => :'String',
    
    :'encargos_financeiros' => :'Float',
    
    :'historico' => :'String',
    
    :'id_evento_externo' => :'Integer',
    
    :'id_tipo_transacao' => :'Integer',
    
    :'id_transacao' => :'Integer',
    
    :'mcc' => :'Integer',
    
    :'nome_estab_visa' => :'String',
    
    :'nome_plastico' => :'String',
    
    :'numero_estabelecimento' => :'Integer',
    
    :'origem' => :'String',
    
    :'taxa_embarque' => :'Float',
    
    :'tipo_evento' => :'String',
    
    :'valor_dolar' => :'Float'
    
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 736

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cartao == o.cartao &&
      chip == o.chip &&
      cidade_uf_pais == o.cidade_uf_pais &&
      codigo_autorizacao == o.codigo_autorizacao &&
      codigo_moeda == o.codigo_moeda &&
      codigo_moeda_destino == o.codigo_moeda_destino &&
      cotacao_dolar == o.cotacao_dolar &&
      credito == o.credito &&
      data_compra == o.data_compra &&
      data_cotacao_dolar == o.data_cotacao_dolar &&
      data_entrada_compra == o.data_entrada_compra &&
      data_transacao_utc == o.data_transacao_utc &&
      debito == o.debito &&
      descricao_modo_entrada == o.descricao_modo_entrada &&
      descricao_transacao == o.descricao_transacao &&
      encargos_financeiros == o.encargos_financeiros &&
      historico == o.historico &&
      id_evento_externo == o.id_evento_externo &&
      id_tipo_transacao == o.id_tipo_transacao &&
      id_transacao == o.id_transacao &&
      mcc == o.mcc &&
      nome_estab_visa == o.nome_estab_visa &&
      nome_plastico == o.nome_plastico &&
      numero_estabelecimento == o.numero_estabelecimento &&
      origem == o.origem &&
      taxa_embarque == o.taxa_embarque &&
      tipo_evento == o.tipo_evento &&
      valor_dolar == o.valor_dolar
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 805

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /^(true|t|yes|y|1)$/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = Pier.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 871

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 784

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


771
772
773
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 771

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



777
778
779
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 777

def hash
  [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
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



468
469
470
471
472
473
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 468

def list_invalid_properties
  invalid_properties = Array.new
  
  
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



851
852
853
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 851

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



857
858
859
860
861
862
863
864
865
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 857

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



845
846
847
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 845

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



477
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
# File 'lib/pier-sdk-ruby/models/extrato_response.rb', line 477

def valid?
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
end