bb_payments 0.1.1

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 (140) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +82 -0
  4. data/README.md +391 -0
  5. data/Rakefile +8 -0
  6. data/bb_payments.gemspec +30 -0
  7. data/docs/BankSlipsApi.md +178 -0
  8. data/docs/BarcodeCollectionFormsIDResponseObject.md +6 -0
  9. data/docs/BarcodeCollectionFormsIDResponseObjectListaGuiaCodigoBarra.md +10 -0
  10. data/docs/BarcodeCollectionFormsIDResponseObjectListaOcorrencia.md +9 -0
  11. data/docs/BarcodeCollectionFormsRequestObject.md +12 -0
  12. data/docs/BarcodecollectionformsCollectionFormDetailsList.md +12 -0
  13. data/docs/BatchtransfersPaymentsList.md +22 -0
  14. data/docs/BatchtransferscancelPaymentIds.md +7 -0
  15. data/docs/Body.md +13 -0
  16. data/docs/CancelApi.md +63 -0
  17. data/docs/CollectionFormsApi.md +184 -0
  18. data/docs/Error.md +7 -0
  19. data/docs/ErrorErrors.md +8 -0
  20. data/docs/ErrorOAuthUnauthorized.md +10 -0
  21. data/docs/ErrorOAuthUnauthorizedAttributes.md +7 -0
  22. data/docs/InlineResponse200.md +13 -0
  23. data/docs/InlineResponse2001.md +29 -0
  24. data/docs/InlineResponse2001OcurrencesList.md +9 -0
  25. data/docs/InlineResponse2002.md +12 -0
  26. data/docs/InlineResponse2002PaymentsList.md +26 -0
  27. data/docs/InlineResponse2003.md +26 -0
  28. data/docs/InlineResponse2003ListaBoleto.md +24 -0
  29. data/docs/InlineResponse2003ListaDevolucao.md +9 -0
  30. data/docs/InlineResponse200PaymentsList.md +15 -0
  31. data/docs/InlineResponse201.md +13 -0
  32. data/docs/InlineResponse2011.md +13 -0
  33. data/docs/InlineResponse2011PaymentsList.md +16 -0
  34. data/docs/InlineResponse201PaymentsList.md +26 -0
  35. data/docs/InlineResponse400.md +7 -0
  36. data/docs/InlineResponse401.md +10 -0
  37. data/docs/ReturnedsApi.md +78 -0
  38. data/docs/RootTypeForBankSlipList.md +29 -0
  39. data/docs/RootTypeForBankSlipsBatchPayment.md +12 -0
  40. data/docs/RootTypeForBankSlipsBatchPaymentResponseObject.md +12 -0
  41. data/docs/RootTypeForBatchTransferGETResponseObject.md +9 -0
  42. data/docs/RootTypeForBatchTransferPaymentsListGET.md +21 -0
  43. data/docs/RootTypeForBatchTransfersCancelPaymentsListObject.md +10 -0
  44. data/docs/RootTypeForBatchTransfersCancelRequestObject.md +12 -0
  45. data/docs/RootTypeForBatchTransfersCancelResponseObject.md +7 -0
  46. data/docs/RootTypeForReturnedPaymentsDetails.md +33 -0
  47. data/docs/RootTypeForReturnedPaymentsResponseObject.md +10 -0
  48. data/docs/RootTypeForSlipsDetailsObject.md +23 -0
  49. data/docs/TransfersApi.md +309 -0
  50. data/lib/bb_payments/api/base.rb +10 -0
  51. data/lib/bb_payments/api/base_api.rb +63 -0
  52. data/lib/bb_payments/api/batch_payments_api.rb +50 -0
  53. data/lib/bb_payments/api/payments.rb +114 -0
  54. data/lib/bb_payments/api/transfers.rb +33 -0
  55. data/lib/bb_payments/api/transfers_pix.rb +52 -0
  56. data/lib/bb_payments/api_client.rb +414 -0
  57. data/lib/bb_payments/api_error.rb +57 -0
  58. data/lib/bb_payments/configuration.rb +246 -0
  59. data/lib/bb_payments/models/base_model.rb +177 -0
  60. data/lib/bb_payments/models/batch_pix_body.rb +30 -0
  61. data/lib/bb_payments/models/batch_pix_response.rb +69 -0
  62. data/lib/bb_payments/models/batch_transfers_body.rb +30 -0
  63. data/lib/bb_payments/models/batch_transfers_response.rb +64 -0
  64. data/lib/bb_payments/models/batchtransfers_payments_list.rb +362 -0
  65. data/lib/bb_payments/models/batchtransferscancel_payment_ids.rb +212 -0
  66. data/lib/bb_payments/models/body.rb +274 -0
  67. data/lib/bb_payments/models/error.rb +210 -0
  68. data/lib/bb_payments/models/error_errors.rb +227 -0
  69. data/lib/bb_payments/models/error_o_auth_unauthorized.rb +257 -0
  70. data/lib/bb_payments/models/error_o_auth_unauthorized_attributes.rb +213 -0
  71. data/lib/bb_payments/models/find_batch_payment.rb +93 -0
  72. data/lib/bb_payments/models/find_batch_response.rb +71 -0
  73. data/lib/bb_payments/models/inline_response_200.rb +270 -0
  74. data/lib/bb_payments/models/inline_response_200_1.rb +430 -0
  75. data/lib/bb_payments/models/inline_response_200_1_ocurrences_list.rb +227 -0
  76. data/lib/bb_payments/models/inline_response_200_2.rb +260 -0
  77. data/lib/bb_payments/models/inline_response_200_2_payments_list.rb +399 -0
  78. data/lib/bb_payments/models/inline_response_200_3.rb +487 -0
  79. data/lib/bb_payments/models/inline_response_200_3_lista_boleto.rb +377 -0
  80. data/lib/bb_payments/models/inline_response_200_3_lista_devolucao.rb +227 -0
  81. data/lib/bb_payments/models/inline_response_200_payments_list.rb +289 -0
  82. data/lib/bb_payments/models/inline_response_201.rb +270 -0
  83. data/lib/bb_payments/models/inline_response_201_1.rb +270 -0
  84. data/lib/bb_payments/models/inline_response_201_1_payments_list.rb +299 -0
  85. data/lib/bb_payments/models/inline_response_201_payments_list.rb +399 -0
  86. data/lib/bb_payments/models/inline_response_400.rb +210 -0
  87. data/lib/bb_payments/models/inline_response_401.rb +257 -0
  88. data/lib/bb_payments/models/root_type_for_bank_slip_list.rb +430 -0
  89. data/lib/bb_payments/models/root_type_for_bank_slips_batch_payment.rb +270 -0
  90. data/lib/bb_payments/models/root_type_for_bank_slips_batch_payment_response_object.rb +260 -0
  91. data/lib/bb_payments/models/root_type_for_batch_transfer_get_response_object.rb +230 -0
  92. data/lib/bb_payments/models/root_type_for_batch_transfer_payments_list_get.rb +348 -0
  93. data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_payments_list_object.rb +238 -0
  94. data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_request_object.rb +275 -0
  95. data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_response_object.rb +210 -0
  96. data/lib/bb_payments/models/root_type_for_returned_payments_details.rb +468 -0
  97. data/lib/bb_payments/models/root_type_for_returned_payments_response_object.rb +240 -0
  98. data/lib/bb_payments/models/root_type_for_slips_details_object.rb +408 -0
  99. data/lib/bb_payments/models/transfer_base.rb +128 -0
  100. data/lib/bb_payments/models/transfer_pix.rb +34 -0
  101. data/lib/bb_payments/models/transfer_pix_base.rb +146 -0
  102. data/lib/bb_payments/version.rb +3 -0
  103. data/lib/bb_payments.rb +85 -0
  104. data/spec/api/batch_payments_api_spec.rb +113 -0
  105. data/spec/api_client_spec.rb +225 -0
  106. data/spec/base_object_spec.rb +109 -0
  107. data/spec/configuration_spec.rb +41 -0
  108. data/spec/models/body_spec.rb +76 -0
  109. data/spec/models/error_errors_spec.rb +46 -0
  110. data/spec/models/error_o_auth_unauthorized_attributes_spec.rb +40 -0
  111. data/spec/models/error_o_auth_unauthorized_spec.rb +58 -0
  112. data/spec/models/error_spec.rb +40 -0
  113. data/spec/models/inline_response_200_1_ocurrences_list_spec.rb +52 -0
  114. data/spec/models/inline_response_200_1_spec.rb +172 -0
  115. data/spec/models/inline_response_200_2_payments_list_spec.rb +154 -0
  116. data/spec/models/inline_response_200_2_spec.rb +70 -0
  117. data/spec/models/inline_response_200_3_lista_boleto_spec.rb +142 -0
  118. data/spec/models/inline_response_200_3_lista_devolucao_spec.rb +52 -0
  119. data/spec/models/inline_response_200_3_spec.rb +154 -0
  120. data/spec/models/inline_response_200_payments_list_spec.rb +88 -0
  121. data/spec/models/inline_response_200_spec.rb +76 -0
  122. data/spec/models/inline_response_201_1_payments_list_spec.rb +94 -0
  123. data/spec/models/inline_response_201_1_spec.rb +76 -0
  124. data/spec/models/inline_response_201_payments_list_spec.rb +154 -0
  125. data/spec/models/inline_response_201_spec.rb +76 -0
  126. data/spec/models/inline_response_400_spec.rb +40 -0
  127. data/spec/models/inline_response_401_spec.rb +58 -0
  128. data/spec/models/root_type_for_bank_slip_list_spec.rb +172 -0
  129. data/spec/models/root_type_for_bank_slips_batch_payment_response_object_spec.rb +70 -0
  130. data/spec/models/root_type_for_bank_slips_batch_payment_spec.rb +70 -0
  131. data/spec/models/root_type_for_batch_transfer_get_response_object_spec.rb +52 -0
  132. data/spec/models/root_type_for_batch_transfer_payments_list_get_spec.rb +124 -0
  133. data/spec/models/root_type_for_batch_transfers_cancel_payments_list_object_spec.rb +58 -0
  134. data/spec/models/root_type_for_batch_transfers_cancel_request_object_spec.rb +70 -0
  135. data/spec/models/root_type_for_batch_transfers_cancel_response_object_spec.rb +40 -0
  136. data/spec/models/root_type_for_returned_payments_details_spec.rb +196 -0
  137. data/spec/models/root_type_for_returned_payments_response_object_spec.rb +58 -0
  138. data/spec/models/root_type_for_slips_details_object_spec.rb +136 -0
  139. data/spec/spec_helper.rb +110 -0
  140. metadata +292 -0
@@ -0,0 +1,260 @@
1
+ =begin
2
+ #Payments-VPN
3
+
4
+ #Esta API fornece os serviços de pagamento do Banco do Brasil.
5
+
6
+ OpenAPI spec version: 3.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.24
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module BancoBrasilPayments
15
+ # Representação dos campos de resposta de uma solicitação de verificação no recurso de transferência em lote.
16
+ class InlineResponse2002
17
+ # pt-BR: Código do estado da requisição a ser pesquisada: 1 - Requisição com todos os lançamentos com dados consistentes; 2 - Requisição com ao menos um dos lançamentos com dados inconsistentes; 3 - Requisição com todos os lançamentos com dados inconsistentes; 4 - Requisição pendente de ação pelo Conveniado - falta autorizar o pagamento; 5 - Requisição em processamento pelo Banco; 6 - Requisição Processada; 7 - Requisição Rejeitada As situações 1 e 2 são transitórias e não requerem qualquer ação do Cliente Conveniado. A situação 3 sempre será migrada para situação 7. A situação 4 Significa que, ao menos um lançamento, depende de açao do Cliente Conveniado, seja liberando ou cancelando os pagamentos. As situações 5, 6 e 7 não requerem qualquer ação do Cliente Conveniado. A situação 5 significa que, ao menos um lançamento, está agendado. As situações 6 e 7 são definitivas não havendo alteração posterior da situação da requisição.
18
+ attr_accessor :status_description
19
+
20
+ # Quantidade de pagamentos pretendidos a serem processados em lote.
21
+ attr_accessor :payments_quantity
22
+
23
+ # Valor total de todos os pagamentos pretendidos a serem processados em lote (formato 0.00)
24
+ attr_accessor :payments_amount
25
+
26
+ # Quantidade de pagamentos pretendidos válidos a serem processados em lote.
27
+ attr_accessor :valid_payments_quantity
28
+
29
+ # Valor total de todos os pagamentos pretendidos válidos a serem processados em lote (formato 0.00)
30
+ attr_accessor :valid_payments_amount
31
+
32
+ # Lista parcial de pagamentos a serem processados em lote.
33
+ attr_accessor :payments_list
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'status_description' => :'statusDescription',
39
+ :'payments_quantity' => :'paymentsQuantity',
40
+ :'payments_amount' => :'paymentsAmount',
41
+ :'valid_payments_quantity' => :'validPaymentsQuantity',
42
+ :'valid_payments_amount' => :'validPaymentsAmount',
43
+ :'payments_list' => :'paymentsList'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'status_description' => :'Object',
51
+ :'payments_quantity' => :'Object',
52
+ :'payments_amount' => :'Object',
53
+ :'valid_payments_quantity' => :'Object',
54
+ :'valid_payments_amount' => :'Object',
55
+ :'payments_list' => :'Object'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::InlineResponse2002` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::InlineResponse2002`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'status_description')
81
+ self.status_description = attributes[:'status_description']
82
+ end
83
+
84
+ if attributes.key?(:'payments_quantity')
85
+ self.payments_quantity = attributes[:'payments_quantity']
86
+ end
87
+
88
+ if attributes.key?(:'payments_amount')
89
+ self.payments_amount = attributes[:'payments_amount']
90
+ end
91
+
92
+ if attributes.key?(:'valid_payments_quantity')
93
+ self.valid_payments_quantity = attributes[:'valid_payments_quantity']
94
+ end
95
+
96
+ if attributes.key?(:'valid_payments_amount')
97
+ self.valid_payments_amount = attributes[:'valid_payments_amount']
98
+ end
99
+
100
+ if attributes.key?(:'payments_list')
101
+ if (value = attributes[:'payments_list']).is_a?(Array)
102
+ self.payments_list = value
103
+ end
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ status_description == o.status_description &&
126
+ payments_quantity == o.payments_quantity &&
127
+ payments_amount == o.payments_amount &&
128
+ valid_payments_quantity == o.valid_payments_quantity &&
129
+ valid_payments_amount == o.valid_payments_amount &&
130
+ payments_list == o.payments_list
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [status_description, payments_quantity, payments_amount, valid_payments_quantity, valid_payments_amount, payments_list].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
167
+ self.send("#{key}=", nil)
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :DateTime
181
+ DateTime.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ BancoBrasilPayments.const_get(type).build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end end
260
+ end
@@ -0,0 +1,399 @@
1
+ =begin
2
+ #Payments-VPN
3
+
4
+ #Esta API fornece os serviços de pagamento do Banco do Brasil.
5
+
6
+ OpenAPI spec version: 3.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.24
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module BancoBrasilPayments
15
+ class InlineResponse2002PaymentsList
16
+ # Número identificador do pagamento ao Beneficiário (número do protocolo).
17
+ attr_accessor :payment_id
18
+
19
+ # Código ISPB que representa a instituição financeira. Por exemplo, 1 - Banco do Brasil, 104 - Caixa Econômica Federal.
20
+ attr_accessor :clearinghouse_code
21
+
22
+ # Código identificador do Sistema de Pagamentos Brasileiro para crédito. Por exemplo, 0 - Banco do Brasil e 360305 - Caixa Econômica Federal. Se campo clearinghouseCode for informado, este campo será ignorado.
23
+ attr_accessor :ispb_code
24
+
25
+ # Agência para crédito.
26
+ attr_accessor :credit_branch_office
27
+
28
+ # Conta Corrente para crédito. Este campo estará vazio caso creditPaymentAccount estiver preenchido
29
+ attr_accessor :credit_current_account
30
+
31
+ # Dígito verificador da conta para crédito. Este campo estará vazio caso creditPaymentAccount estiver preenchido
32
+ attr_accessor :check_digits_credit_current_account
33
+
34
+ # CPF do beneficiário no pagamento.
35
+ attr_accessor :individual_taxpayer_registration
36
+
37
+ # CNPJ do beneficiário no pagamento.
38
+ attr_accessor :corporate_taxpayer_registration
39
+
40
+ # Data do pagamento (formato ddmmaaaa). Solicitações de pagamentos para dias não úteis ou após o horário limite de processamento serão pagas no próximo dia útil, com exceção de transferências entre contas do Banco do Brasil
41
+ attr_accessor :payment_date
42
+
43
+ # Valor do pagamento em reais (formato 0.00)
44
+ attr_accessor :payment_value
45
+
46
+ # Número do documento informado pelo pagador para débito.
47
+ attr_accessor :debit_document
48
+
49
+ # Número do documento informado pelo pagador para crédito.
50
+ attr_accessor :credit_document
51
+
52
+ # Modalidade que representa o modo como o crédito pago, sendo: 1 - Crédito em conta corrente, 3 - Crédito / Ordem de Pagamento ou Transferência Bancária (DOC / TED), 5 - Crédito em conta poupança, 71 – Depósito Judicial no BB.
53
+ attr_accessor :credit_type
54
+
55
+ # Código da finalidade das ordens de pagamento. A lista de códigos pode ser obtida junto a FEBRABAN (Federação Brasileira de Bancos). Por exemplo, 1 - Crédito em Conta Corrent, 11 - Crédito/Ordem de Pagamento em Conta Poupança, 12 - Crédito/Ordem de pagamento de Depósitos Judiciais.
56
+ attr_accessor :credit_order_purpose_code
57
+
58
+ # Código da finalidade da transferência de acordo com o BACEN (Banco Central).
59
+ attr_accessor :wire_transfer_purpose_code
60
+
61
+ # Código identificador do depósito judicial.
62
+ attr_accessor :deposit_in_court_identifier
63
+
64
+ # Identifica a consistência do pagamento, por exemplo: \"S\" significa que o pagamento pretendido é consistente; \"N\" significa que o pagamento pretendido é inconsistente e há pelo menos um erro. Se valor igual a \"N\", os possíveis erros serão mostrados no array errorCodes.
65
+ attr_accessor :consistent_payment_indicator
66
+
67
+ # Lista de códigos de erros, descrito a seguir: 1 - Agência de crédito está zerada. Informe o nº da Agência de Crédito. 2 - Conta de crédito informada não é numérica. Informe apenas números. 3 - Dígito da conta de crédito não informado. Informe o DV da conta de crédito. 4 - CPF informado não é numérico. Informe apenas números. 5 - CNPJ informado não é numérico. Informe apenas números. 6 - Data do pagamento não informada. Informe a data do pagamento. 7 - Data do pagamento inválida. Verifique o dado informado. 8 - Valor do pagamento informado não é númerico. Informe apenas números. 9 - Valor do pagamento está zerado. Informe o valor do pagamento. 10 - Ambos os campos Número Compensação e Número ISPB não foram informados. Informe um dos campos. 11 - Ambos os campos Número Compensação e Número ISPB foram informados. Informe apenas um dos campos. 12 - Ambos os campos Finalidade DOC e Finalidade TED não foram informados. Informe um dos campos. 13 - Ambos os campos Finalidade DOC e Finalidade TED foram informados. Informe apenas um dos campos. 14 - Número de depósito judicial não informado. Informe o número do depósito judicial. 15 - Digito da conta de crédito inválido. Verifique o dado informado. 16 - Ambos os campos CPF e CNPJ foram informados. Informe apenas um dos campos. Caso informado os 2 campos, nas consultas será exibido apenas os dados do CPF. 17 - Ambos os campos CPF e CNPJ não foram informados. Informe um dos campos. 18 - Dígito do CPF inválido. Verifique o dado informado. 19 - Dígito do CNPJ inválido. Verifique o dado informado. 20 - Agência e conta de crédito estão iguais às de débito. Opção não permitida. 21 - Número Compensação inválido. Verifique o dado informado. 22 - Número ISPB diferente de zeros. Não informe o nº ISPB. 23 - Conta de crédito não informada. Informe o número da conta de crédito. 24 - CPF não informado. Informe o nº do CPF. 25 - CNPJ foi informado. Não informe CNPJ. 26 - Conta de crédito foi informada. Não informe Conta de crédito. 27 - Dígito da conta de crédito foi informado. Não informe dígito da conta de crédito. 28 - Finalidade do DOC foi informada. Não informe finalidade do DOC. 29 - Finalidade da TED foi informada. Não informe finalidade da TED. 30 - Número Depósito Judicial informado. Não informe finalidade Depósito Judicial. 31 - Número do documento de crédito informado não é numérico. Informe apenas números. 32 - Número do documento de débito não é numérico. Informe apenas números. 33 - CPF não encontrado na base da receita federal. Verifique o dado informado. 34 - CNPJ não encontrado na base da receita federal. Verifique o dado informado. 35 - Conta poupança não permitido para \"Pagamento ao Fornecedor\". Para creditar em conta poupança utilize o recurso para efetivação de \"Pagamentos Diversos\". 36 - Código COMPE deve ser igual a 1 37 - Código ISPB deve ser igual a 0 38 - Código de barras não é numérico. Informe apenas números. 39 - Código de barras igual a zeros. Informe apenas números. 40 - Número de inscrição do pagador não é numérico. Informe apenas números. 41 - Número de inscrição do beneficiário não é numérico. Informe apenas números. 42 - Número de inscrição do avalista não é numérico. Informe apenas números. 43 - Digito do CPF para o pagador inválido. Verifique o dado informado. 44 - Digito do CPF para o beneficiário inválido. Verifique o dado informado. 45 - Digito do CPF para o avalista inválido. Verifique o dado informado. 46 - Digito do CNPJ para o pagador inválido. Verifique o dado informado. 47 - Digito do CNPJ para o beneficiário inválido. Verifique o dado informado. 48 - Digito do CNPJ para o avalista inválido.Verifique o dado informado. 49 - Data do vencimento inválida. Verifique o dado informado. 50 - Valor nominal não é numérico. Informe apenas números. 51 - Valor de desconto não é numérico. Informe apenas números; 52 - Valor de mora não é numérico. Informe apenas números. 53 - Data do pagamento deve ser maior ou igual ao dia atual. 54 - Número do documento de débito não informado. Informe o nº do doc de débito. 55 - Data do vencimento não informada. Informe a data de vencimento. 56 - Nome do beneficiário não informado. Informe o nome do beneficiário. 57 - Número de inscrição do beneficiário não informado. Informe o CPF ou o CNPJ do beneficiário. 58 - Conta pagamento foi informada. Não informe conta pagamento. 59 - Ambos os campos conta de crédito e conta pagamento foram informados. Informe apenas um dos campos. 99 - Consultar o Banco para detalhar o erro 200 - Insuficiência de Fundos - Débito Não Efetuado 201 - Crédito ou Débito Cancelado pelo Pagador 202 - Débito Autorizado pela Agência - Efetuado 203 - Controle Inválido. Verificar campos 01, 02 e 03 do header ou segmento A, B, C, J, J52, N, O ou W do Arquivo CNAB240. 204 - Tipo de Operação Inválido. Verificar campo 04.1 do header de lote. Valor default = \"C\" 205 - Tipo de Serviço Inválido. Utilize 20 para Pagamento a Fornecedores, 30 Pagamento de Salários ou 98 Pagamentos Diversos no header de Lote, campo 05.1, do CNAB240 206 - Forma de Lançamento Inválida. Para crédito em Poupança utilize Pagamentos Diversos. Para crédito em Conta Pagamento utilize Pagamentos Diversos ou Pagamento a Fornecedores. Para Pagamento de salário a conta de crédito deve ser do BB. 207 - Tipo/Número de Inscrição Inválido. CPF ou CNPJ inválido. Verifique dados informados. 208 - Código de Convênio Inválido. Verifique dados informados. 209 - Agência/Conta Corrente/DV Inválido. Verifique dados informados. 210 - Nº Seqüencial do Registro no Lote Inválido. Verifique dado informado. 211 - Código de Segmento de Detalhe Inválido. Verifique dado informado. 212 - Lançamento inconsistente, rejeitado na prévia. Corrigir os dados do lançamento e enviar novo pagamento. 213 - Nº Compe do Banco para crédito Inválido. Verifique dado informado. 214 - Nº do ISPB Banco, Instituição de Pagamento para crédito Inválido. Verifique dado informado. 215 - Agência Mantenedora da Conta Corrente do Favorecido Inválida. Verifique dado informado. 216 - Conta Corrente/DV/Conta de Pagamento do Favorecido Inválido. Verifique dado informado. 217 - Nome do Favorecido não Informado. Informe o nome do favorecido. 218 - Data Lançamento Inválido. Verifique dado informado. 219 - Tipo/Quantidade da Moeda Inválido. Verifique dado informado. 220 - Valor do Lançamento Inválido. Verifique dado informado. 221 - Aviso ao Favorecido - Identificação Inválida. 222 - Tipo/Número de Inscrição do Favorecido Inválido. CPF ou CNPJ do favorecido inválido. Arquivo: Verifique o campo 07.3B - registro detalhe do segmento B. 223 - Logradouro do Favorecido não Informado. Informe o logradouro do favorecido. 224 - Nº do Local do Favorecido não Informado. Informe o nº do local do favorecido. 225 - Cidade do Favorecido não Informada. Informe a cidade do favorecido. 226 - CEP/Complemento do Favorecido Inválido. Verifique dado informado. 227 - Sigla do Estado do Favorecido Inválida. Verifique dado informado. 228 - Nº do Banco para crédito Inválido. Verifique dado informado. 229 - Código/Nome da Agência Depositária não Informado. Informe o dado solicitado. 230 - Seu Número Inválido. Verifique dado informado. 231 - Nosso Número Inválido. Verifique dado informado. 232 - Inclusão Efetuada com Sucesso 233 - Alteração Efetuada com Sucesso 234 - Exclusão Efetuada com Sucesso 235 - Agência/Conta Impedida Legalmente 236 - Empresa não pagou salário. Conta de crédito só aceita pagamento de salário 237 - Falecimento do mutuário. 238 - Empresa não enviou remessa do mutuário 239 - Empresa não enviou remessa no vencimento 240 - Valor da parcela inválida. Verifique dado informado. 241 - Identificação do contrato inválida. Verifique dado informado. 242 - Operação de Consignação Incluída com Sucesso 243 - Operação de Consignação Alterada com Sucesso 244 - Operação de Consignação Excluída com Sucesso 245 - Operação de Consignação Liquidada com Sucesso 246 - Reativação Efetuada com Sucesso 247 - Suspensão Efetuada com Sucesso 248 - Código de Barras - Código do Banco Inválido. 249 - Código de Barras - Código da Moeda Inválido 250 - Código de Barras - Dígito Verificador Geral Inválido 251 - Código de Barras - Valor do Título Inválido 252 - Código de Barras - Campo Livre Inválido 253 - Valor do Documento Inválido. Verifique dado informado. 254 - Valor do Abatimento Inválido. Verifique dado informado. 255 - Valor do Desconto Inválido. Verifique dado informado. 256 - Valor de Mora Inválido. Verifique dado informado. 257 - Valor da Multa Inválido. Verifique dado informado. 258 - Valor do IR Inválido. Verifique dado informado. 259 - Valor do ISS Inválido. Verifique dado informado. 260 - Valor do IOF Inválido. Verifique dado informado. 261 - Valor de Outras Deduções Inválido. Verifique dado informado. 262 - Valor de Outros Acréscimos Inválido. Verifique dado informado. 263 - Valor do INSS Inválido. Verifique dado informado. 264 - Lote Não Aceito. Reenvie os documentos. 265 - Inscrição da Empresa Inválida para o Contrato 266 - Convênio com a Empresa Inexistente/Inválido para o Contrato 267 - Agência/Conta Corrente da Empresa Inexistente/Inválido para o Contrato. Verifique dado informado. 268 - Tipo de Serviço Inválido para o Contrato. Para contrato de Pagamentos, utilize 20 para Pagamento a Fornecedores, 30 Pagamento de Salários ou 98 Pagamentos Diversos no header de Lote, campo 05.1, do CNAB240 269 - Conta Corrente da Empresa com Saldo Insuficiente. 270 - Lote de Serviço Fora de Seqüência 271 - Lote de Serviço Inválido 272 - Arquivo não aceito 273 - Tipo de Registro Inválido 274 - Código Remessa / Retorno Inválido 275 - Versão de layout inválida 276 - Mutuário não identificado 277 - Tipo do beneficio não permite empréstimo 278 - Beneficio cessado/suspenso 279 - Beneficio possui representante legal 280 - Beneficio é do tipo PA (Pensão alimentícia) 281 - Quantidade de contratos permitida excedida 282 - Beneficio não pertence ao Banco informado 283 - Início do desconto informado já ultrapassado 284 - Número da parcela inválida. Verifique dado informado. 285 - Quantidade de parcela inválida. Verifique dado informado. 286 - Margem consignável excedida para o mutuário dentro do prazo do contrato. Verifique suas margens disponíveis. 287 - Empréstimo já cadastrado 288 - Empréstimo inexistente 289 - Empréstimo já encerrado 290 - Arquivo sem trailer 291 - Mutuário sem crédito na competência 292 - Não descontado – outros motivos 293 - Retorno de Crédito não pago 294 - Cancelamento de empréstimo retroativo 295 - Outros Motivos de Glosa 296 - Margem consignável excedida para o mutuário acima do prazo do contrato 297 - Mutuário desligado do empregador. Pagamento não permitido. 298 - Mutuário afastado por licença. Pagamento não permitido. 299 - Primeiro nome do mutuário diferente do primeiro nome do movimento do censo ou diferente da base de Titular do Benefício. Verificar necessidade de ajustes. 300 - Benefício suspenso/cessado pela APS ou Sisobi 301 - Benefício suspenso por dependência de cálculo 302 - Benefício suspenso/cessado pela inspetoria/auditoria 303 - Benefício bloqueado para empréstimo pelo beneficiário 304 - Benefício bloqueado para empréstimo por TBM 305 - Benefício está em fase de concessão de PA ou desdobramento. 306 - Benefício cessado por óbito. 307 - Benefício cessado por fraude. 308 - Benefício cessado por concessão de outro benefício. 309 - Benefício cessado: estatutário transferido para órgão de origem. 310 - Empréstimo suspenso pela APS. 311 - Empréstimo cancelado pelo banco. 312 - Crédito transformado em PAB. 313 - Término da consignação foi alterado. 314 - Fim do empréstimo ocorreu durante período de suspensão ou concessão. 315 - Empréstimo suspenso pelo banco. 316 - Não averbação de contrato – quantidade de parcelas/competências informadas ultrapassou a data limite da extinção de cota do dependente titular de benefícios 317 - Lote Não Aceito - Totais do Lote com Diferença 318 - Título Não Encontrado 319 - Identificador Registro Opcional Inválido. Verifique dado informado. 320 - Código Padrão Inválido. Verifique dado informado. 321 - Código de Ocorrência Inválido. Verifique dado informado. 322 - Complemento de Ocorrência Inválido. Verifique dado informado. 323 - Alegação já Informada 324 - Agência / Conta do Favorecido Substituída. . Verifique dado informado. 325 - Divergência entre o primeiro e último nome do beneficiário versus primeiro e último nome na Receita Federal. Verificar com beneficiário necessidade de ajustes. 326 - Confirmação de Antecipação de Valor 327 - Antecipação parcial de valor 328 - Boleto bloqueado na base. Não passível de pagamento. 329 - Sistema em contingência – Boleto valor maior que referência. Consulte o beneficiário ou tente efetuar o pagamento mais tarde. 330 - Sistema em contingência – Boleto vencido. Consulte o beneficiário ou tente efetuar o pagamento mais tarde. 331 - Sistema em contingência – Boleto indexado. Consulte o beneficiário ou tente efetuar o pagamento mais tarde. 332 - Beneficiário divergente. Verifique dado informado. 333 - Limite de pagamentos parciais do boleto excedido. Consulte o Beneficiário do boleto. 334 - Boleto já liquidado. Não passível de pagamento. 999 - Consultar o Banco para detalhar o erro.
68
+ attr_accessor :error_codes
69
+
70
+ # Conta Pagamento para crédito. Este campo estará vazio caso creditCurrentAccount e checkDigitsCreditCurrentAccount estiverem preenchidos
71
+ attr_accessor :credit_payment_account
72
+
73
+ # Campo de uso livre pelo Cliente para Descrição ou Identificação do Pagamento.
74
+ attr_accessor :payment_description
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'payment_id' => :'paymentId',
80
+ :'clearinghouse_code' => :'clearinghouseCode',
81
+ :'ispb_code' => :'ispbCode',
82
+ :'credit_branch_office' => :'creditBranchOffice',
83
+ :'credit_current_account' => :'creditCurrentAccount',
84
+ :'check_digits_credit_current_account' => :'checkDigitsCreditCurrentAccount',
85
+ :'individual_taxpayer_registration' => :'individualTaxpayerRegistration',
86
+ :'corporate_taxpayer_registration' => :'corporateTaxpayerRegistration',
87
+ :'payment_date' => :'paymentDate',
88
+ :'payment_value' => :'paymentValue',
89
+ :'debit_document' => :'debitDocument',
90
+ :'credit_document' => :'creditDocument',
91
+ :'credit_type' => :'creditType',
92
+ :'credit_order_purpose_code' => :'creditOrderPurposeCode',
93
+ :'wire_transfer_purpose_code' => :'wireTransferPurposeCode',
94
+ :'deposit_in_court_identifier' => :'depositInCourtIdentifier',
95
+ :'consistent_payment_indicator' => :'consistentPaymentIndicator',
96
+ :'error_codes' => :'errorCodes',
97
+ :'credit_payment_account' => :'creditPaymentAccount',
98
+ :'payment_description' => :'paymentDescription'
99
+ }
100
+ end
101
+
102
+ # Attribute type mapping.
103
+ def self.openapi_types
104
+ {
105
+ :'payment_id' => :'Object',
106
+ :'clearinghouse_code' => :'Object',
107
+ :'ispb_code' => :'Object',
108
+ :'credit_branch_office' => :'Object',
109
+ :'credit_current_account' => :'Object',
110
+ :'check_digits_credit_current_account' => :'Object',
111
+ :'individual_taxpayer_registration' => :'Object',
112
+ :'corporate_taxpayer_registration' => :'Object',
113
+ :'payment_date' => :'Object',
114
+ :'payment_value' => :'Object',
115
+ :'debit_document' => :'Object',
116
+ :'credit_document' => :'Object',
117
+ :'credit_type' => :'Object',
118
+ :'credit_order_purpose_code' => :'Object',
119
+ :'wire_transfer_purpose_code' => :'Object',
120
+ :'deposit_in_court_identifier' => :'Object',
121
+ :'consistent_payment_indicator' => :'Object',
122
+ :'error_codes' => :'Object',
123
+ :'credit_payment_account' => :'Object',
124
+ :'payment_description' => :'Object'
125
+ }
126
+ end
127
+
128
+ # List of attributes with nullable: true
129
+ def self.openapi_nullable
130
+ Set.new([
131
+ ])
132
+ end
133
+
134
+ # Initializes the object
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ def initialize(attributes = {})
137
+ if (!attributes.is_a?(Hash))
138
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::InlineResponse2002PaymentsList` initialize method"
139
+ end
140
+
141
+ # check to see if the attribute exists and convert string to symbol for hash key
142
+ attributes = attributes.each_with_object({}) { |(k, v), h|
143
+ if (!self.class.attribute_map.key?(k.to_sym))
144
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::InlineResponse2002PaymentsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
145
+ end
146
+ h[k.to_sym] = v
147
+ }
148
+
149
+ if attributes.key?(:'payment_id')
150
+ self.payment_id = attributes[:'payment_id']
151
+ end
152
+
153
+ if attributes.key?(:'clearinghouse_code')
154
+ self.clearinghouse_code = attributes[:'clearinghouse_code']
155
+ end
156
+
157
+ if attributes.key?(:'ispb_code')
158
+ self.ispb_code = attributes[:'ispb_code']
159
+ end
160
+
161
+ if attributes.key?(:'credit_branch_office')
162
+ self.credit_branch_office = attributes[:'credit_branch_office']
163
+ end
164
+
165
+ if attributes.key?(:'credit_current_account')
166
+ self.credit_current_account = attributes[:'credit_current_account']
167
+ end
168
+
169
+ if attributes.key?(:'check_digits_credit_current_account')
170
+ self.check_digits_credit_current_account = attributes[:'check_digits_credit_current_account']
171
+ end
172
+
173
+ if attributes.key?(:'individual_taxpayer_registration')
174
+ self.individual_taxpayer_registration = attributes[:'individual_taxpayer_registration']
175
+ end
176
+
177
+ if attributes.key?(:'corporate_taxpayer_registration')
178
+ self.corporate_taxpayer_registration = attributes[:'corporate_taxpayer_registration']
179
+ end
180
+
181
+ if attributes.key?(:'payment_date')
182
+ self.payment_date = attributes[:'payment_date']
183
+ end
184
+
185
+ if attributes.key?(:'payment_value')
186
+ self.payment_value = attributes[:'payment_value']
187
+ end
188
+
189
+ if attributes.key?(:'debit_document')
190
+ self.debit_document = attributes[:'debit_document']
191
+ end
192
+
193
+ if attributes.key?(:'credit_document')
194
+ self.credit_document = attributes[:'credit_document']
195
+ end
196
+
197
+ if attributes.key?(:'credit_type')
198
+ self.credit_type = attributes[:'credit_type']
199
+ end
200
+
201
+ if attributes.key?(:'credit_order_purpose_code')
202
+ self.credit_order_purpose_code = attributes[:'credit_order_purpose_code']
203
+ end
204
+
205
+ if attributes.key?(:'wire_transfer_purpose_code')
206
+ self.wire_transfer_purpose_code = attributes[:'wire_transfer_purpose_code']
207
+ end
208
+
209
+ if attributes.key?(:'deposit_in_court_identifier')
210
+ self.deposit_in_court_identifier = attributes[:'deposit_in_court_identifier']
211
+ end
212
+
213
+ if attributes.key?(:'consistent_payment_indicator')
214
+ self.consistent_payment_indicator = attributes[:'consistent_payment_indicator']
215
+ end
216
+
217
+ if attributes.key?(:'error_codes')
218
+ if (value = attributes[:'error_codes']).is_a?(Array)
219
+ self.error_codes = value
220
+ end
221
+ end
222
+
223
+ if attributes.key?(:'credit_payment_account')
224
+ self.credit_payment_account = attributes[:'credit_payment_account']
225
+ end
226
+
227
+ if attributes.key?(:'payment_description')
228
+ self.payment_description = attributes[:'payment_description']
229
+ end
230
+ end
231
+
232
+ # Show invalid properties with the reasons. Usually used together with valid?
233
+ # @return Array for valid properties with the reasons
234
+ def list_invalid_properties
235
+ invalid_properties = Array.new
236
+ invalid_properties
237
+ end
238
+
239
+ # Check to see if the all the properties in the model are valid
240
+ # @return true if the model is valid
241
+ def valid?
242
+ true
243
+ end
244
+
245
+ # Checks equality by comparing each attribute.
246
+ # @param [Object] Object to be compared
247
+ def ==(o)
248
+ return true if self.equal?(o)
249
+ self.class == o.class &&
250
+ payment_id == o.payment_id &&
251
+ clearinghouse_code == o.clearinghouse_code &&
252
+ ispb_code == o.ispb_code &&
253
+ credit_branch_office == o.credit_branch_office &&
254
+ credit_current_account == o.credit_current_account &&
255
+ check_digits_credit_current_account == o.check_digits_credit_current_account &&
256
+ individual_taxpayer_registration == o.individual_taxpayer_registration &&
257
+ corporate_taxpayer_registration == o.corporate_taxpayer_registration &&
258
+ payment_date == o.payment_date &&
259
+ payment_value == o.payment_value &&
260
+ debit_document == o.debit_document &&
261
+ credit_document == o.credit_document &&
262
+ credit_type == o.credit_type &&
263
+ credit_order_purpose_code == o.credit_order_purpose_code &&
264
+ wire_transfer_purpose_code == o.wire_transfer_purpose_code &&
265
+ deposit_in_court_identifier == o.deposit_in_court_identifier &&
266
+ consistent_payment_indicator == o.consistent_payment_indicator &&
267
+ error_codes == o.error_codes &&
268
+ credit_payment_account == o.credit_payment_account &&
269
+ payment_description == o.payment_description
270
+ end
271
+
272
+ # @see the `==` method
273
+ # @param [Object] Object to be compared
274
+ def eql?(o)
275
+ self == o
276
+ end
277
+
278
+ # Calculates hash code according to all attributes.
279
+ # @return [Integer] Hash code
280
+ def hash
281
+ [payment_id, clearinghouse_code, ispb_code, credit_branch_office, credit_current_account, check_digits_credit_current_account, individual_taxpayer_registration, corporate_taxpayer_registration, payment_date, payment_value, debit_document, credit_document, credit_type, credit_order_purpose_code, wire_transfer_purpose_code, deposit_in_court_identifier, consistent_payment_indicator, error_codes, credit_payment_account, payment_description].hash
282
+ end
283
+
284
+ # Builds the object from hash
285
+ # @param [Hash] attributes Model attributes in the form of hash
286
+ # @return [Object] Returns the model itself
287
+ def self.build_from_hash(attributes)
288
+ new.build_from_hash(attributes)
289
+ end
290
+
291
+ # Builds the object from hash
292
+ # @param [Hash] attributes Model attributes in the form of hash
293
+ # @return [Object] Returns the model itself
294
+ def build_from_hash(attributes)
295
+ return nil unless attributes.is_a?(Hash)
296
+ self.class.openapi_types.each_pair do |key, type|
297
+ if type =~ /\AArray<(.*)>/i
298
+ # check to ensure the input is an array given that the attribute
299
+ # is documented as an array but the input is not
300
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
301
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
302
+ end
303
+ elsif !attributes[self.class.attribute_map[key]].nil?
304
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
305
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
306
+ self.send("#{key}=", nil)
307
+ end
308
+ end
309
+
310
+ self
311
+ end
312
+
313
+ # Deserializes the data based on type
314
+ # @param string type Data type
315
+ # @param string value Value to be deserialized
316
+ # @return [Object] Deserialized data
317
+ def _deserialize(type, value)
318
+ case type.to_sym
319
+ when :DateTime
320
+ DateTime.parse(value)
321
+ when :Date
322
+ Date.parse(value)
323
+ when :String
324
+ value.to_s
325
+ when :Integer
326
+ value.to_i
327
+ when :Float
328
+ value.to_f
329
+ when :Boolean
330
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
331
+ true
332
+ else
333
+ false
334
+ end
335
+ when :Object
336
+ # generic object (usually a Hash), return directly
337
+ value
338
+ when /\AArray<(?<inner_type>.+)>\z/
339
+ inner_type = Regexp.last_match[:inner_type]
340
+ value.map { |v| _deserialize(inner_type, v) }
341
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
342
+ k_type = Regexp.last_match[:k_type]
343
+ v_type = Regexp.last_match[:v_type]
344
+ {}.tap do |hash|
345
+ value.each do |k, v|
346
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
347
+ end
348
+ end
349
+ else # model
350
+ BancoBrasilPayments.const_get(type).build_from_hash(value)
351
+ end
352
+ end
353
+
354
+ # Returns the string representation of the object
355
+ # @return [String] String presentation of the object
356
+ def to_s
357
+ to_hash.to_s
358
+ end
359
+
360
+ # to_body is an alias to to_hash (backward compatibility)
361
+ # @return [Hash] Returns the object in the form of hash
362
+ def to_body
363
+ to_hash
364
+ end
365
+
366
+ # Returns the object in the form of hash
367
+ # @return [Hash] Returns the object in the form of hash
368
+ def to_hash
369
+ hash = {}
370
+ self.class.attribute_map.each_pair do |attr, param|
371
+ value = self.send(attr)
372
+ if value.nil?
373
+ is_nullable = self.class.openapi_nullable.include?(attr)
374
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
375
+ end
376
+
377
+ hash[param] = _to_hash(value)
378
+ end
379
+ hash
380
+ end
381
+
382
+ # Outputs non-array value in the form of hash
383
+ # For object, use to_hash. Otherwise, just return the value
384
+ # @param [Object] value Any valid value
385
+ # @return [Hash] Returns the value in the form of hash
386
+ def _to_hash(value)
387
+ if value.is_a?(Array)
388
+ value.compact.map { |v| _to_hash(v) }
389
+ elsif value.is_a?(Hash)
390
+ {}.tap do |hash|
391
+ value.each { |k, v| hash[k] = _to_hash(v) }
392
+ end
393
+ elsif value.respond_to? :to_hash
394
+ value.to_hash
395
+ else
396
+ value
397
+ end
398
+ end end
399
+ end