bb_payments 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +82 -0
- data/README.md +391 -0
- data/Rakefile +8 -0
- data/bb_payments.gemspec +30 -0
- data/docs/BankSlipsApi.md +178 -0
- data/docs/BarcodeCollectionFormsIDResponseObject.md +6 -0
- data/docs/BarcodeCollectionFormsIDResponseObjectListaGuiaCodigoBarra.md +10 -0
- data/docs/BarcodeCollectionFormsIDResponseObjectListaOcorrencia.md +9 -0
- data/docs/BarcodeCollectionFormsRequestObject.md +12 -0
- data/docs/BarcodecollectionformsCollectionFormDetailsList.md +12 -0
- data/docs/BatchtransfersPaymentsList.md +22 -0
- data/docs/BatchtransferscancelPaymentIds.md +7 -0
- data/docs/Body.md +13 -0
- data/docs/CancelApi.md +63 -0
- data/docs/CollectionFormsApi.md +184 -0
- data/docs/Error.md +7 -0
- data/docs/ErrorErrors.md +8 -0
- data/docs/ErrorOAuthUnauthorized.md +10 -0
- data/docs/ErrorOAuthUnauthorizedAttributes.md +7 -0
- data/docs/InlineResponse200.md +13 -0
- data/docs/InlineResponse2001.md +29 -0
- data/docs/InlineResponse2001OcurrencesList.md +9 -0
- data/docs/InlineResponse2002.md +12 -0
- data/docs/InlineResponse2002PaymentsList.md +26 -0
- data/docs/InlineResponse2003.md +26 -0
- data/docs/InlineResponse2003ListaBoleto.md +24 -0
- data/docs/InlineResponse2003ListaDevolucao.md +9 -0
- data/docs/InlineResponse200PaymentsList.md +15 -0
- data/docs/InlineResponse201.md +13 -0
- data/docs/InlineResponse2011.md +13 -0
- data/docs/InlineResponse2011PaymentsList.md +16 -0
- data/docs/InlineResponse201PaymentsList.md +26 -0
- data/docs/InlineResponse400.md +7 -0
- data/docs/InlineResponse401.md +10 -0
- data/docs/ReturnedsApi.md +78 -0
- data/docs/RootTypeForBankSlipList.md +29 -0
- data/docs/RootTypeForBankSlipsBatchPayment.md +12 -0
- data/docs/RootTypeForBankSlipsBatchPaymentResponseObject.md +12 -0
- data/docs/RootTypeForBatchTransferGETResponseObject.md +9 -0
- data/docs/RootTypeForBatchTransferPaymentsListGET.md +21 -0
- data/docs/RootTypeForBatchTransfersCancelPaymentsListObject.md +10 -0
- data/docs/RootTypeForBatchTransfersCancelRequestObject.md +12 -0
- data/docs/RootTypeForBatchTransfersCancelResponseObject.md +7 -0
- data/docs/RootTypeForReturnedPaymentsDetails.md +33 -0
- data/docs/RootTypeForReturnedPaymentsResponseObject.md +10 -0
- data/docs/RootTypeForSlipsDetailsObject.md +23 -0
- data/docs/TransfersApi.md +309 -0
- data/lib/bb_payments/api/base.rb +10 -0
- data/lib/bb_payments/api/base_api.rb +63 -0
- data/lib/bb_payments/api/batch_payments_api.rb +50 -0
- data/lib/bb_payments/api/payments.rb +114 -0
- data/lib/bb_payments/api/transfers.rb +33 -0
- data/lib/bb_payments/api/transfers_pix.rb +52 -0
- data/lib/bb_payments/api_client.rb +414 -0
- data/lib/bb_payments/api_error.rb +57 -0
- data/lib/bb_payments/configuration.rb +246 -0
- data/lib/bb_payments/models/base_model.rb +177 -0
- data/lib/bb_payments/models/batch_pix_body.rb +30 -0
- data/lib/bb_payments/models/batch_pix_response.rb +69 -0
- data/lib/bb_payments/models/batch_transfers_body.rb +30 -0
- data/lib/bb_payments/models/batch_transfers_response.rb +64 -0
- data/lib/bb_payments/models/batchtransfers_payments_list.rb +362 -0
- data/lib/bb_payments/models/batchtransferscancel_payment_ids.rb +212 -0
- data/lib/bb_payments/models/body.rb +274 -0
- data/lib/bb_payments/models/error.rb +210 -0
- data/lib/bb_payments/models/error_errors.rb +227 -0
- data/lib/bb_payments/models/error_o_auth_unauthorized.rb +257 -0
- data/lib/bb_payments/models/error_o_auth_unauthorized_attributes.rb +213 -0
- data/lib/bb_payments/models/find_batch_payment.rb +93 -0
- data/lib/bb_payments/models/find_batch_response.rb +71 -0
- data/lib/bb_payments/models/inline_response_200.rb +270 -0
- data/lib/bb_payments/models/inline_response_200_1.rb +430 -0
- data/lib/bb_payments/models/inline_response_200_1_ocurrences_list.rb +227 -0
- data/lib/bb_payments/models/inline_response_200_2.rb +260 -0
- data/lib/bb_payments/models/inline_response_200_2_payments_list.rb +399 -0
- data/lib/bb_payments/models/inline_response_200_3.rb +487 -0
- data/lib/bb_payments/models/inline_response_200_3_lista_boleto.rb +377 -0
- data/lib/bb_payments/models/inline_response_200_3_lista_devolucao.rb +227 -0
- data/lib/bb_payments/models/inline_response_200_payments_list.rb +289 -0
- data/lib/bb_payments/models/inline_response_201.rb +270 -0
- data/lib/bb_payments/models/inline_response_201_1.rb +270 -0
- data/lib/bb_payments/models/inline_response_201_1_payments_list.rb +299 -0
- data/lib/bb_payments/models/inline_response_201_payments_list.rb +399 -0
- data/lib/bb_payments/models/inline_response_400.rb +210 -0
- data/lib/bb_payments/models/inline_response_401.rb +257 -0
- data/lib/bb_payments/models/root_type_for_bank_slip_list.rb +430 -0
- data/lib/bb_payments/models/root_type_for_bank_slips_batch_payment.rb +270 -0
- data/lib/bb_payments/models/root_type_for_bank_slips_batch_payment_response_object.rb +260 -0
- data/lib/bb_payments/models/root_type_for_batch_transfer_get_response_object.rb +230 -0
- data/lib/bb_payments/models/root_type_for_batch_transfer_payments_list_get.rb +348 -0
- data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_payments_list_object.rb +238 -0
- data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_request_object.rb +275 -0
- data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_response_object.rb +210 -0
- data/lib/bb_payments/models/root_type_for_returned_payments_details.rb +468 -0
- data/lib/bb_payments/models/root_type_for_returned_payments_response_object.rb +240 -0
- data/lib/bb_payments/models/root_type_for_slips_details_object.rb +408 -0
- data/lib/bb_payments/models/transfer_base.rb +128 -0
- data/lib/bb_payments/models/transfer_pix.rb +34 -0
- data/lib/bb_payments/models/transfer_pix_base.rb +146 -0
- data/lib/bb_payments/version.rb +3 -0
- data/lib/bb_payments.rb +85 -0
- data/spec/api/batch_payments_api_spec.rb +113 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/body_spec.rb +76 -0
- data/spec/models/error_errors_spec.rb +46 -0
- data/spec/models/error_o_auth_unauthorized_attributes_spec.rb +40 -0
- data/spec/models/error_o_auth_unauthorized_spec.rb +58 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/inline_response_200_1_ocurrences_list_spec.rb +52 -0
- data/spec/models/inline_response_200_1_spec.rb +172 -0
- data/spec/models/inline_response_200_2_payments_list_spec.rb +154 -0
- data/spec/models/inline_response_200_2_spec.rb +70 -0
- data/spec/models/inline_response_200_3_lista_boleto_spec.rb +142 -0
- data/spec/models/inline_response_200_3_lista_devolucao_spec.rb +52 -0
- data/spec/models/inline_response_200_3_spec.rb +154 -0
- data/spec/models/inline_response_200_payments_list_spec.rb +88 -0
- data/spec/models/inline_response_200_spec.rb +76 -0
- data/spec/models/inline_response_201_1_payments_list_spec.rb +94 -0
- data/spec/models/inline_response_201_1_spec.rb +76 -0
- data/spec/models/inline_response_201_payments_list_spec.rb +154 -0
- data/spec/models/inline_response_201_spec.rb +76 -0
- data/spec/models/inline_response_400_spec.rb +40 -0
- data/spec/models/inline_response_401_spec.rb +58 -0
- data/spec/models/root_type_for_bank_slip_list_spec.rb +172 -0
- data/spec/models/root_type_for_bank_slips_batch_payment_response_object_spec.rb +70 -0
- data/spec/models/root_type_for_bank_slips_batch_payment_spec.rb +70 -0
- data/spec/models/root_type_for_batch_transfer_get_response_object_spec.rb +52 -0
- data/spec/models/root_type_for_batch_transfer_payments_list_get_spec.rb +124 -0
- data/spec/models/root_type_for_batch_transfers_cancel_payments_list_object_spec.rb +58 -0
- data/spec/models/root_type_for_batch_transfers_cancel_request_object_spec.rb +70 -0
- data/spec/models/root_type_for_batch_transfers_cancel_response_object_spec.rb +40 -0
- data/spec/models/root_type_for_returned_payments_details_spec.rb +196 -0
- data/spec/models/root_type_for_returned_payments_response_object_spec.rb +58 -0
- data/spec/models/root_type_for_slips_details_object_spec.rb +136 -0
- data/spec/spec_helper.rb +110 -0
- metadata +292 -0
@@ -0,0 +1,289 @@
|
|
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 InlineResponse200PaymentsList
|
16
|
+
# Payment identifier to the beneficiary (Protocol Number); Número identificador do pagamento ao Beneficiário (número do protocolo).
|
17
|
+
attr_accessor :payment_id
|
18
|
+
|
19
|
+
# 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
|
20
|
+
attr_accessor :payment_date
|
21
|
+
|
22
|
+
# Valor do pagamento em reais (formato 0.00)
|
23
|
+
attr_accessor :payment_value
|
24
|
+
|
25
|
+
# The modality that represents the way the credit was given as follow: 1 - Credit in Current Account, 3 - Credit/Money Order or Wire Transfers (DOC/TED), 5 - Credit in Saving Account, 13 - Settlement of Bar-coded Slip, 21 - Settlement of Non Bar-coded Slip, 30 - Settlement of Bank Paper; - 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 13 - Liquidação de Boleto com Código de Barras, 21 - Liquidação de Boleto sem Código de Barras, 30 - Liquidação de Boleto Bancário;
|
26
|
+
attr_accessor :credit_type
|
27
|
+
|
28
|
+
# Identification of Individual or Corporate Taxpayer Registration with the Federal Revenue Service; CPF ou CNPJ do beneficiário no pagamento
|
29
|
+
attr_accessor :taxpayer_registration
|
30
|
+
|
31
|
+
# Name of the person or corporate that will receive the payment; Nome da pessoa ou empresa beneficiária no pagamento
|
32
|
+
attr_accessor :beneficiary_name
|
33
|
+
|
34
|
+
# Descrição da situação do pagamento: Domínios: - Consistente (pagamento recebido pelo banco, cumprem as regras de preenchimento dos campos mas ainda irá para validação e processamento) - Inconsistente (pagamento não aceito pelo banco por dados de entrada inconsistentes - não cumpre as regras de preenchimento dos campos) - Pago (pagamento efetuado ao favorecido) - Pendente (pagamento validado - pendência de autorização do pagamento por parte do pagador) - Aguardando saldo (débito não efetivado e em verificação de saldo até o horário limite da teimosinha). - Agendado (pagamento autorizado, porém aguardando a data de efetivação do pagamento ou horário de processamento) - Rejeitado (dados do pagamento não passaram na validações físicas e/ou lógicas, precisam ser corrigidos e reenviados. Ex: agência e conta não existem, conta não pertence ao CPF informado) - Cancelado (pagamento cancelado pelo pagador antes da data de efetivação do crédito) - Bloqueado (Débito na conta do pagador não efetivado por ocorrência no convênio, inconsistência de data/float ou falta de saldo) - Devolvido (pagamento efetuado e posteriormente devolvido pelo favorecido ou instituição recebedora. O valor é devolvido para a conta corrente onde ocorreu o débito da requisição)\" - Debitado (pagamento debitado na conta do pagador e pendente de crédito ao favorecido)horário de processamento, PAGO - Pagamento realizado ao Favorecido, REJEITADO - Dados do Favorecido inválidos, o que impede a efetivação do pagamento. Dados precisam ser corrigidos e reenviados, DEVOLVIDO - Pagamento efetuado e posteriormente devolvido pelo Favorecido/Banco destinatário, VENCIDO - Pagamento não efetuado na data indicada, CANCELADO - Pagamento cancelado pelo Pagador antes da data de efetivação do crédito.
|
35
|
+
attr_accessor :payment_status
|
36
|
+
|
37
|
+
# Description of the payment by the covenant partner, without treatment by the Bank; Campo de descrição do pagamento de uso livre pelo Cliente Conveniado - sem tratamento pelo Banco.
|
38
|
+
attr_accessor :payment_description
|
39
|
+
|
40
|
+
# 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.
|
41
|
+
attr_accessor :error_codes_list
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'payment_id' => :'paymentId',
|
47
|
+
:'payment_date' => :'paymentDate',
|
48
|
+
:'payment_value' => :'paymentValue',
|
49
|
+
:'credit_type' => :'creditType',
|
50
|
+
:'taxpayer_registration' => :'taxpayerRegistration',
|
51
|
+
:'beneficiary_name' => :'beneficiaryName',
|
52
|
+
:'payment_status' => :'paymentStatus',
|
53
|
+
:'payment_description' => :'paymentDescription',
|
54
|
+
:'error_codes_list' => :'errorCodesList'
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute type mapping.
|
59
|
+
def self.openapi_types
|
60
|
+
{
|
61
|
+
:'payment_id' => :'Object',
|
62
|
+
:'payment_date' => :'Object',
|
63
|
+
:'payment_value' => :'Object',
|
64
|
+
:'credit_type' => :'Object',
|
65
|
+
:'taxpayer_registration' => :'Object',
|
66
|
+
:'beneficiary_name' => :'Object',
|
67
|
+
:'payment_status' => :'Object',
|
68
|
+
:'payment_description' => :'Object',
|
69
|
+
:'error_codes_list' => :'Object'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# List of attributes with nullable: true
|
74
|
+
def self.openapi_nullable
|
75
|
+
Set.new([
|
76
|
+
])
|
77
|
+
end
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
def initialize(attributes = {})
|
82
|
+
if (!attributes.is_a?(Hash))
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::InlineResponse200PaymentsList` initialize method"
|
84
|
+
end
|
85
|
+
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::InlineResponse200PaymentsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
|
+
end
|
91
|
+
h[k.to_sym] = v
|
92
|
+
}
|
93
|
+
|
94
|
+
if attributes.key?(:'payment_id')
|
95
|
+
self.payment_id = attributes[:'payment_id']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'payment_date')
|
99
|
+
self.payment_date = attributes[:'payment_date']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'payment_value')
|
103
|
+
self.payment_value = attributes[:'payment_value']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'credit_type')
|
107
|
+
self.credit_type = attributes[:'credit_type']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'taxpayer_registration')
|
111
|
+
self.taxpayer_registration = attributes[:'taxpayer_registration']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'beneficiary_name')
|
115
|
+
self.beneficiary_name = attributes[:'beneficiary_name']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'payment_status')
|
119
|
+
self.payment_status = attributes[:'payment_status']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'payment_description')
|
123
|
+
self.payment_description = attributes[:'payment_description']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'error_codes_list')
|
127
|
+
if (value = attributes[:'error_codes_list']).is_a?(Array)
|
128
|
+
self.error_codes_list = value
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
134
|
+
# @return Array for valid properties with the reasons
|
135
|
+
def list_invalid_properties
|
136
|
+
invalid_properties = Array.new
|
137
|
+
invalid_properties
|
138
|
+
end
|
139
|
+
|
140
|
+
# Check to see if the all the properties in the model are valid
|
141
|
+
# @return true if the model is valid
|
142
|
+
def valid?
|
143
|
+
true
|
144
|
+
end
|
145
|
+
|
146
|
+
# Checks equality by comparing each attribute.
|
147
|
+
# @param [Object] Object to be compared
|
148
|
+
def ==(o)
|
149
|
+
return true if self.equal?(o)
|
150
|
+
self.class == o.class &&
|
151
|
+
payment_id == o.payment_id &&
|
152
|
+
payment_date == o.payment_date &&
|
153
|
+
payment_value == o.payment_value &&
|
154
|
+
credit_type == o.credit_type &&
|
155
|
+
taxpayer_registration == o.taxpayer_registration &&
|
156
|
+
beneficiary_name == o.beneficiary_name &&
|
157
|
+
payment_status == o.payment_status &&
|
158
|
+
payment_description == o.payment_description &&
|
159
|
+
error_codes_list == o.error_codes_list
|
160
|
+
end
|
161
|
+
|
162
|
+
# @see the `==` method
|
163
|
+
# @param [Object] Object to be compared
|
164
|
+
def eql?(o)
|
165
|
+
self == o
|
166
|
+
end
|
167
|
+
|
168
|
+
# Calculates hash code according to all attributes.
|
169
|
+
# @return [Integer] Hash code
|
170
|
+
def hash
|
171
|
+
[payment_id, payment_date, payment_value, credit_type, taxpayer_registration, beneficiary_name, payment_status, payment_description, error_codes_list].hash
|
172
|
+
end
|
173
|
+
|
174
|
+
# Builds the object from hash
|
175
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
176
|
+
# @return [Object] Returns the model itself
|
177
|
+
def self.build_from_hash(attributes)
|
178
|
+
new.build_from_hash(attributes)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Builds the object from hash
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
183
|
+
# @return [Object] Returns the model itself
|
184
|
+
def build_from_hash(attributes)
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
186
|
+
self.class.openapi_types.each_pair do |key, type|
|
187
|
+
if type =~ /\AArray<(.*)>/i
|
188
|
+
# check to ensure the input is an array given that the attribute
|
189
|
+
# is documented as an array but the input is not
|
190
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
191
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
192
|
+
end
|
193
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
194
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
195
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
196
|
+
self.send("#{key}=", nil)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
self
|
201
|
+
end
|
202
|
+
|
203
|
+
# Deserializes the data based on type
|
204
|
+
# @param string type Data type
|
205
|
+
# @param string value Value to be deserialized
|
206
|
+
# @return [Object] Deserialized data
|
207
|
+
def _deserialize(type, value)
|
208
|
+
case type.to_sym
|
209
|
+
when :DateTime
|
210
|
+
DateTime.parse(value)
|
211
|
+
when :Date
|
212
|
+
Date.parse(value)
|
213
|
+
when :String
|
214
|
+
value.to_s
|
215
|
+
when :Integer
|
216
|
+
value.to_i
|
217
|
+
when :Float
|
218
|
+
value.to_f
|
219
|
+
when :Boolean
|
220
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
221
|
+
true
|
222
|
+
else
|
223
|
+
false
|
224
|
+
end
|
225
|
+
when :Object
|
226
|
+
# generic object (usually a Hash), return directly
|
227
|
+
value
|
228
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
229
|
+
inner_type = Regexp.last_match[:inner_type]
|
230
|
+
value.map { |v| _deserialize(inner_type, v) }
|
231
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
232
|
+
k_type = Regexp.last_match[:k_type]
|
233
|
+
v_type = Regexp.last_match[:v_type]
|
234
|
+
{}.tap do |hash|
|
235
|
+
value.each do |k, v|
|
236
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
else # model
|
240
|
+
BancoBrasilPayments.const_get(type).build_from_hash(value)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
# Returns the string representation of the object
|
245
|
+
# @return [String] String presentation of the object
|
246
|
+
def to_s
|
247
|
+
to_hash.to_s
|
248
|
+
end
|
249
|
+
|
250
|
+
# to_body is an alias to to_hash (backward compatibility)
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
252
|
+
def to_body
|
253
|
+
to_hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Returns the object in the form of hash
|
257
|
+
# @return [Hash] Returns the object in the form of hash
|
258
|
+
def to_hash
|
259
|
+
hash = {}
|
260
|
+
self.class.attribute_map.each_pair do |attr, param|
|
261
|
+
value = self.send(attr)
|
262
|
+
if value.nil?
|
263
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
264
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
265
|
+
end
|
266
|
+
|
267
|
+
hash[param] = _to_hash(value)
|
268
|
+
end
|
269
|
+
hash
|
270
|
+
end
|
271
|
+
|
272
|
+
# Outputs non-array value in the form of hash
|
273
|
+
# For object, use to_hash. Otherwise, just return the value
|
274
|
+
# @param [Object] value Any valid value
|
275
|
+
# @return [Hash] Returns the value in the form of hash
|
276
|
+
def _to_hash(value)
|
277
|
+
if value.is_a?(Array)
|
278
|
+
value.compact.map { |v| _to_hash(v) }
|
279
|
+
elsif value.is_a?(Hash)
|
280
|
+
{}.tap do |hash|
|
281
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
282
|
+
end
|
283
|
+
elsif value.respond_to? :to_hash
|
284
|
+
value.to_hash
|
285
|
+
else
|
286
|
+
value
|
287
|
+
end
|
288
|
+
end end
|
289
|
+
end
|
@@ -0,0 +1,270 @@
|
|
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 transferência em lote.
|
16
|
+
class InlineResponse201
|
17
|
+
# Identificação da solicitação de pagamento. É um número único, não sequencial, controlado pelo cliente, cujo valor vai de 1 a 999999.
|
18
|
+
attr_accessor :request_identification
|
19
|
+
|
20
|
+
# 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, 8 - Preparando remessa não liberada, 9 - Requisição liberada via API, 10 - Preparando remessa liberada. As situações 1, 2 e 8 são transitórias e não requerem qualquer ação do Cliente Conveniado. situação 3 sempre será migrada para situação 7. A situação 4 Significa que, ao menos um lançamento, depende de ação do Cliente Conveniado, seja liberando ou cancelando os pagamentos. As situações 5, 6, 7, 9 e 10 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.
|
21
|
+
attr_accessor :request_status
|
22
|
+
|
23
|
+
# Quantidade de pagamentos pretendidos a serem processados em lote.
|
24
|
+
attr_accessor :payments_quantity
|
25
|
+
|
26
|
+
# Valor total, em reais, de todos os pagamentos pretendidos a serem processados em lote. Os dois números finais do valor representam o formato decimal. Por exemplo, o valor 10000 significa R$ 100,00.
|
27
|
+
attr_accessor :payments_total_value
|
28
|
+
|
29
|
+
# Quantidade de pagamentos pretendidos válidos a serem processados em lote.
|
30
|
+
attr_accessor :valid_payments_quantity
|
31
|
+
|
32
|
+
# Valor total, em reais, de todos os pagamentos pretendidos válidos a serem processados em lote. Os dois números finais do valor representam o formato decimal. Por exemplo, o valor 10000 significa R$ 100,00.
|
33
|
+
attr_accessor :valid_payments_total_value
|
34
|
+
|
35
|
+
# Lista de pagamentos a serem processados em lote.
|
36
|
+
attr_accessor :payments_list
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'request_identification' => :'requestIdentification',
|
42
|
+
:'request_status' => :'requestStatus',
|
43
|
+
:'payments_quantity' => :'paymentsQuantity',
|
44
|
+
:'payments_total_value' => :'paymentsTotalValue',
|
45
|
+
:'valid_payments_quantity' => :'validPaymentsQuantity',
|
46
|
+
:'valid_payments_total_value' => :'validPaymentsTotalValue',
|
47
|
+
:'payments_list' => :'paymentsList'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute type mapping.
|
52
|
+
def self.openapi_types
|
53
|
+
{
|
54
|
+
:'request_identification' => :'Object',
|
55
|
+
:'request_status' => :'Object',
|
56
|
+
:'payments_quantity' => :'Object',
|
57
|
+
:'payments_total_value' => :'Object',
|
58
|
+
:'valid_payments_quantity' => :'Object',
|
59
|
+
:'valid_payments_total_value' => :'Object',
|
60
|
+
:'payments_list' => :'Object'
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# List of attributes with nullable: true
|
65
|
+
def self.openapi_nullable
|
66
|
+
Set.new([
|
67
|
+
])
|
68
|
+
end
|
69
|
+
|
70
|
+
# Initializes the object
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
72
|
+
def initialize(attributes = {})
|
73
|
+
if (!attributes.is_a?(Hash))
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::InlineResponse201` initialize method"
|
75
|
+
end
|
76
|
+
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
78
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
79
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
80
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::InlineResponse201`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
81
|
+
end
|
82
|
+
h[k.to_sym] = v
|
83
|
+
}
|
84
|
+
|
85
|
+
if attributes.key?(:'request_identification')
|
86
|
+
self.request_identification = attributes[:'request_identification']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'request_status')
|
90
|
+
self.request_status = attributes[:'request_status']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'payments_quantity')
|
94
|
+
self.payments_quantity = attributes[:'payments_quantity']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'payments_total_value')
|
98
|
+
self.payments_total_value = attributes[:'payments_total_value']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'valid_payments_quantity')
|
102
|
+
self.valid_payments_quantity = attributes[:'valid_payments_quantity']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'valid_payments_total_value')
|
106
|
+
self.valid_payments_total_value = attributes[:'valid_payments_total_value']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'payments_list')
|
110
|
+
if (value = attributes[:'payments_list']).is_a?(Array)
|
111
|
+
self.payments_list = value
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
117
|
+
# @return Array for valid properties with the reasons
|
118
|
+
def list_invalid_properties
|
119
|
+
invalid_properties = Array.new
|
120
|
+
invalid_properties
|
121
|
+
end
|
122
|
+
|
123
|
+
# Check to see if the all the properties in the model are valid
|
124
|
+
# @return true if the model is valid
|
125
|
+
def valid?
|
126
|
+
true
|
127
|
+
end
|
128
|
+
|
129
|
+
# Checks equality by comparing each attribute.
|
130
|
+
# @param [Object] Object to be compared
|
131
|
+
def ==(o)
|
132
|
+
return true if self.equal?(o)
|
133
|
+
self.class == o.class &&
|
134
|
+
request_identification == o.request_identification &&
|
135
|
+
request_status == o.request_status &&
|
136
|
+
payments_quantity == o.payments_quantity &&
|
137
|
+
payments_total_value == o.payments_total_value &&
|
138
|
+
valid_payments_quantity == o.valid_payments_quantity &&
|
139
|
+
valid_payments_total_value == o.valid_payments_total_value &&
|
140
|
+
payments_list == o.payments_list
|
141
|
+
end
|
142
|
+
|
143
|
+
# @see the `==` method
|
144
|
+
# @param [Object] Object to be compared
|
145
|
+
def eql?(o)
|
146
|
+
self == o
|
147
|
+
end
|
148
|
+
|
149
|
+
# Calculates hash code according to all attributes.
|
150
|
+
# @return [Integer] Hash code
|
151
|
+
def hash
|
152
|
+
[request_identification, request_status, payments_quantity, payments_total_value, valid_payments_quantity, valid_payments_total_value, payments_list].hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def self.build_from_hash(attributes)
|
159
|
+
new.build_from_hash(attributes)
|
160
|
+
end
|
161
|
+
|
162
|
+
# Builds the object from hash
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
+
# @return [Object] Returns the model itself
|
165
|
+
def build_from_hash(attributes)
|
166
|
+
return nil unless attributes.is_a?(Hash)
|
167
|
+
self.class.openapi_types.each_pair do |key, type|
|
168
|
+
if type =~ /\AArray<(.*)>/i
|
169
|
+
# check to ensure the input is an array given that the attribute
|
170
|
+
# is documented as an array but the input is not
|
171
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
172
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
173
|
+
end
|
174
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
175
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
176
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
177
|
+
self.send("#{key}=", nil)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
self
|
182
|
+
end
|
183
|
+
|
184
|
+
# Deserializes the data based on type
|
185
|
+
# @param string type Data type
|
186
|
+
# @param string value Value to be deserialized
|
187
|
+
# @return [Object] Deserialized data
|
188
|
+
def _deserialize(type, value)
|
189
|
+
case type.to_sym
|
190
|
+
when :DateTime
|
191
|
+
DateTime.parse(value)
|
192
|
+
when :Date
|
193
|
+
Date.parse(value)
|
194
|
+
when :String
|
195
|
+
value.to_s
|
196
|
+
when :Integer
|
197
|
+
value.to_i
|
198
|
+
when :Float
|
199
|
+
value.to_f
|
200
|
+
when :Boolean
|
201
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
202
|
+
true
|
203
|
+
else
|
204
|
+
false
|
205
|
+
end
|
206
|
+
when :Object
|
207
|
+
# generic object (usually a Hash), return directly
|
208
|
+
value
|
209
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
210
|
+
inner_type = Regexp.last_match[:inner_type]
|
211
|
+
value.map { |v| _deserialize(inner_type, v) }
|
212
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
213
|
+
k_type = Regexp.last_match[:k_type]
|
214
|
+
v_type = Regexp.last_match[:v_type]
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each do |k, v|
|
217
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
else # model
|
221
|
+
BancoBrasilPayments.const_get(type).build_from_hash(value)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the string representation of the object
|
226
|
+
# @return [String] String presentation of the object
|
227
|
+
def to_s
|
228
|
+
to_hash.to_s
|
229
|
+
end
|
230
|
+
|
231
|
+
# to_body is an alias to to_hash (backward compatibility)
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_body
|
234
|
+
to_hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the object in the form of hash
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_hash
|
240
|
+
hash = {}
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
242
|
+
value = self.send(attr)
|
243
|
+
if value.nil?
|
244
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
245
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
246
|
+
end
|
247
|
+
|
248
|
+
hash[param] = _to_hash(value)
|
249
|
+
end
|
250
|
+
hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Outputs non-array value in the form of hash
|
254
|
+
# For object, use to_hash. Otherwise, just return the value
|
255
|
+
# @param [Object] value Any valid value
|
256
|
+
# @return [Hash] Returns the value in the form of hash
|
257
|
+
def _to_hash(value)
|
258
|
+
if value.is_a?(Array)
|
259
|
+
value.compact.map { |v| _to_hash(v) }
|
260
|
+
elsif value.is_a?(Hash)
|
261
|
+
{}.tap do |hash|
|
262
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
263
|
+
end
|
264
|
+
elsif value.respond_to? :to_hash
|
265
|
+
value.to_hash
|
266
|
+
else
|
267
|
+
value
|
268
|
+
end
|
269
|
+
end end
|
270
|
+
end
|