bb_payments 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
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,430 @@
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 recuperação de pagamento na transferência em lote.
16
+ class InlineResponse2001
17
+ # 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)
18
+ attr_accessor :payment_status
19
+
20
+ # Identifies the type of payment, such as: 126 - Payment to suppliers, 127 - Payment of salaries, 128 - Other payments; Identifica o tipo de pagamento, como: 126 - Pagamento de fornecedores, 127 - Pagamento de salários, 128 - Pagamentos Diversos.
21
+ attr_accessor :payment_type
22
+
23
+ # 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, 71 – Deposit in Court; - 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.
24
+ attr_accessor :credit_type
25
+
26
+ # Branch office for debit; Agência para débito.
27
+ attr_accessor :debit_branch_office
28
+
29
+ # Current account for debit; Conta Corrente para débito.
30
+ attr_accessor :debit_current_account
31
+
32
+ # Check digits of current account for debit; Dígito verificador da conta para débito.
33
+ attr_accessor :check_digit_debit_current_account
34
+
35
+ # Date of payment (payments request for non-business days will be paid in the next business day, excepting transfers between Banco do Brasil accounts); Data do pagamento (Solicitações de pagamentos para dias não úteis serão pagas no próximo dia útil, com exceção de transferências entre contas do Banco do Brasil).
36
+ attr_accessor :payment_date
37
+
38
+ # Value of payment. The two ending numbers of the value represents the decimal places (cents). For example, value 10000 means 100.00 (One hundred) reais; Valor do pagamento. Os dois números finais do valor representam o valor das casas decimais (centavos). Por exemplo, o valor 10000 significa 100,00 (cem) reais.
39
+ attr_accessor :payment_value
40
+
41
+ # Identification code of the institution for credit at clearinghouse (In Brazil, identified by the acronym COMPE). For example, value 1 for Banco do Brasil and value 104 for Caixa Econômica Federal. If value 0 informed then ispbCode field will be considered; Código ISPB que representa a instituição financeira. Por exemplo, 1 - Banco do Brasil, 104 - Caixa Econômica Federal.
42
+ attr_accessor :clearinghouse_code
43
+
44
+ # Identifier code of the Brazilian Payment Sistem (Identified by the acronym ISPB) for credit. For example, value 0 for Banco do Brasil and value 360305 for Caixa Econômica Federal. Not considered when clearinghouseCode field is informed; 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.
45
+ attr_accessor :ispb_code
46
+
47
+ # Branch office for credit; Agência para crédito.
48
+ attr_accessor :credit_branch_office
49
+
50
+ # Current account for credit; Conta Corrente para crédito.
51
+ attr_accessor :credit_current_account
52
+
53
+ # Check digits of current account for credit; Dígito verificador da conta para crédito.
54
+ attr_accessor :check_digit_credit_current_account
55
+
56
+ # Identifies the type of the taxpayer as: 1 - Individual taxpayer 2 - Corporate taxpayer; - Identifica o tipo de pessoa, como: 1 - Pessoa física 2 - Pessoa Jurídica.
57
+ attr_accessor :taxpayer_type
58
+
59
+ # Identification of Individual or Corporate Taxpayer Registration with the Federal Revenue Service; CPF ou CNPJ do beneficiário no pagamento.
60
+ attr_accessor :taxpayer_registration
61
+
62
+ # Document of debit provided by payer; Número do documento informado pelo pagador para débito.
63
+ attr_accessor :debit_document
64
+
65
+ # Document of credit provided by payer; Número do documento informado pelo pagador para crédito.
66
+ attr_accessor :credit_document
67
+
68
+ # Name of the person or corporate that will receive the payment; Nome da pessoa ou empresa beneficiária no pagamento.
69
+ attr_accessor :beneficiary_name
70
+
71
+ # Authentication Code of the payment if paid already; Código de autenticação do pagamento, caso já tenha sido efetivado.
72
+ attr_accessor :payment_authentication_code
73
+
74
+ # Purpose code informed when concerning to credit/money order. A list of allowed codes is obtained at Brazilian Federation of Banks (Identified by the acronym FEBRABAN). For example: 1 - Credit in Current Account, 11 - Credit/Money Order in Saving Account, 12 - Credit/Money Order in Deposit in Court; - 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 Corrente, 11 - Crédito/Ordem de Pagamento em Conta Poupança, 12 - Crédito/Ordem de pagamento de Depósitos Judiciais.
75
+ attr_accessor :credit_order_purpose_code
76
+
77
+ # Purpose code informed when concerning to wire transfer adopted by Central Bank of Brazil (Identified by the acronym BACEN); Código da finalidade da transferência de acordo com o BACEN (Banco Central).
78
+ attr_accessor :wire_transfer_purpose_code
79
+
80
+ # Identifier of the deposit in court; Código identificador do depósito judicial.
81
+ attr_accessor :deposit_in_court_identifier
82
+
83
+ # Lista de devoluções
84
+ attr_accessor :ocurrences_list
85
+
86
+ # Attribute mapping from ruby-style variable name to JSON key.
87
+ def self.attribute_map
88
+ {
89
+ :'payment_status' => :'paymentStatus',
90
+ :'payment_type' => :'paymentType',
91
+ :'credit_type' => :'creditType',
92
+ :'debit_branch_office' => :'debitBranchOffice',
93
+ :'debit_current_account' => :'debitCurrentAccount',
94
+ :'check_digit_debit_current_account' => :'checkDigitDebitCurrentAccount',
95
+ :'payment_date' => :'paymentDate',
96
+ :'payment_value' => :'paymentValue',
97
+ :'clearinghouse_code' => :'clearinghouseCode',
98
+ :'ispb_code' => :'ispbCode',
99
+ :'credit_branch_office' => :'creditBranchOffice',
100
+ :'credit_current_account' => :'creditCurrentAccount',
101
+ :'check_digit_credit_current_account' => :'checkDigitCreditCurrentAccount',
102
+ :'taxpayer_type' => :'taxpayerType',
103
+ :'taxpayer_registration' => :'taxpayerRegistration',
104
+ :'debit_document' => :'debitDocument',
105
+ :'credit_document' => :'creditDocument',
106
+ :'beneficiary_name' => :'beneficiaryName',
107
+ :'payment_authentication_code' => :'paymentAuthenticationCode',
108
+ :'credit_order_purpose_code' => :'creditOrderPurposeCode',
109
+ :'wire_transfer_purpose_code' => :'wireTransferPurposeCode',
110
+ :'deposit_in_court_identifier' => :'depositInCourtIdentifier',
111
+ :'ocurrences_list' => :'ocurrencesList'
112
+ }
113
+ end
114
+
115
+ # Attribute type mapping.
116
+ def self.openapi_types
117
+ {
118
+ :'payment_status' => :'Object',
119
+ :'payment_type' => :'Object',
120
+ :'credit_type' => :'Object',
121
+ :'debit_branch_office' => :'Object',
122
+ :'debit_current_account' => :'Object',
123
+ :'check_digit_debit_current_account' => :'Object',
124
+ :'payment_date' => :'Object',
125
+ :'payment_value' => :'Object',
126
+ :'clearinghouse_code' => :'Object',
127
+ :'ispb_code' => :'Object',
128
+ :'credit_branch_office' => :'Object',
129
+ :'credit_current_account' => :'Object',
130
+ :'check_digit_credit_current_account' => :'Object',
131
+ :'taxpayer_type' => :'Object',
132
+ :'taxpayer_registration' => :'Object',
133
+ :'debit_document' => :'Object',
134
+ :'credit_document' => :'Object',
135
+ :'beneficiary_name' => :'Object',
136
+ :'payment_authentication_code' => :'Object',
137
+ :'credit_order_purpose_code' => :'Object',
138
+ :'wire_transfer_purpose_code' => :'Object',
139
+ :'deposit_in_court_identifier' => :'Object',
140
+ :'ocurrences_list' => :'Object'
141
+ }
142
+ end
143
+
144
+ # List of attributes with nullable: true
145
+ def self.openapi_nullable
146
+ Set.new([
147
+ ])
148
+ end
149
+
150
+ # Initializes the object
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ def initialize(attributes = {})
153
+ if (!attributes.is_a?(Hash))
154
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::InlineResponse2001` initialize method"
155
+ end
156
+
157
+ # check to see if the attribute exists and convert string to symbol for hash key
158
+ attributes = attributes.each_with_object({}) { |(k, v), h|
159
+ if (!self.class.attribute_map.key?(k.to_sym))
160
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::InlineResponse2001`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
161
+ end
162
+ h[k.to_sym] = v
163
+ }
164
+
165
+ if attributes.key?(:'payment_status')
166
+ self.payment_status = attributes[:'payment_status']
167
+ end
168
+
169
+ if attributes.key?(:'payment_type')
170
+ self.payment_type = attributes[:'payment_type']
171
+ end
172
+
173
+ if attributes.key?(:'credit_type')
174
+ self.credit_type = attributes[:'credit_type']
175
+ end
176
+
177
+ if attributes.key?(:'debit_branch_office')
178
+ self.debit_branch_office = attributes[:'debit_branch_office']
179
+ end
180
+
181
+ if attributes.key?(:'debit_current_account')
182
+ self.debit_current_account = attributes[:'debit_current_account']
183
+ end
184
+
185
+ if attributes.key?(:'check_digit_debit_current_account')
186
+ self.check_digit_debit_current_account = attributes[:'check_digit_debit_current_account']
187
+ end
188
+
189
+ if attributes.key?(:'payment_date')
190
+ self.payment_date = attributes[:'payment_date']
191
+ end
192
+
193
+ if attributes.key?(:'payment_value')
194
+ self.payment_value = attributes[:'payment_value']
195
+ end
196
+
197
+ if attributes.key?(:'clearinghouse_code')
198
+ self.clearinghouse_code = attributes[:'clearinghouse_code']
199
+ end
200
+
201
+ if attributes.key?(:'ispb_code')
202
+ self.ispb_code = attributes[:'ispb_code']
203
+ end
204
+
205
+ if attributes.key?(:'credit_branch_office')
206
+ self.credit_branch_office = attributes[:'credit_branch_office']
207
+ end
208
+
209
+ if attributes.key?(:'credit_current_account')
210
+ self.credit_current_account = attributes[:'credit_current_account']
211
+ end
212
+
213
+ if attributes.key?(:'check_digit_credit_current_account')
214
+ self.check_digit_credit_current_account = attributes[:'check_digit_credit_current_account']
215
+ end
216
+
217
+ if attributes.key?(:'taxpayer_type')
218
+ self.taxpayer_type = attributes[:'taxpayer_type']
219
+ end
220
+
221
+ if attributes.key?(:'taxpayer_registration')
222
+ self.taxpayer_registration = attributes[:'taxpayer_registration']
223
+ end
224
+
225
+ if attributes.key?(:'debit_document')
226
+ self.debit_document = attributes[:'debit_document']
227
+ end
228
+
229
+ if attributes.key?(:'credit_document')
230
+ self.credit_document = attributes[:'credit_document']
231
+ end
232
+
233
+ if attributes.key?(:'beneficiary_name')
234
+ self.beneficiary_name = attributes[:'beneficiary_name']
235
+ end
236
+
237
+ if attributes.key?(:'payment_authentication_code')
238
+ self.payment_authentication_code = attributes[:'payment_authentication_code']
239
+ end
240
+
241
+ if attributes.key?(:'credit_order_purpose_code')
242
+ self.credit_order_purpose_code = attributes[:'credit_order_purpose_code']
243
+ end
244
+
245
+ if attributes.key?(:'wire_transfer_purpose_code')
246
+ self.wire_transfer_purpose_code = attributes[:'wire_transfer_purpose_code']
247
+ end
248
+
249
+ if attributes.key?(:'deposit_in_court_identifier')
250
+ self.deposit_in_court_identifier = attributes[:'deposit_in_court_identifier']
251
+ end
252
+
253
+ if attributes.key?(:'ocurrences_list')
254
+ if (value = attributes[:'ocurrences_list']).is_a?(Array)
255
+ self.ocurrences_list = value
256
+ end
257
+ end
258
+ end
259
+
260
+ # Show invalid properties with the reasons. Usually used together with valid?
261
+ # @return Array for valid properties with the reasons
262
+ def list_invalid_properties
263
+ invalid_properties = Array.new
264
+ invalid_properties
265
+ end
266
+
267
+ # Check to see if the all the properties in the model are valid
268
+ # @return true if the model is valid
269
+ def valid?
270
+ true
271
+ end
272
+
273
+ # Checks equality by comparing each attribute.
274
+ # @param [Object] Object to be compared
275
+ def ==(o)
276
+ return true if self.equal?(o)
277
+ self.class == o.class &&
278
+ payment_status == o.payment_status &&
279
+ payment_type == o.payment_type &&
280
+ credit_type == o.credit_type &&
281
+ debit_branch_office == o.debit_branch_office &&
282
+ debit_current_account == o.debit_current_account &&
283
+ check_digit_debit_current_account == o.check_digit_debit_current_account &&
284
+ payment_date == o.payment_date &&
285
+ payment_value == o.payment_value &&
286
+ clearinghouse_code == o.clearinghouse_code &&
287
+ ispb_code == o.ispb_code &&
288
+ credit_branch_office == o.credit_branch_office &&
289
+ credit_current_account == o.credit_current_account &&
290
+ check_digit_credit_current_account == o.check_digit_credit_current_account &&
291
+ taxpayer_type == o.taxpayer_type &&
292
+ taxpayer_registration == o.taxpayer_registration &&
293
+ debit_document == o.debit_document &&
294
+ credit_document == o.credit_document &&
295
+ beneficiary_name == o.beneficiary_name &&
296
+ payment_authentication_code == o.payment_authentication_code &&
297
+ credit_order_purpose_code == o.credit_order_purpose_code &&
298
+ wire_transfer_purpose_code == o.wire_transfer_purpose_code &&
299
+ deposit_in_court_identifier == o.deposit_in_court_identifier &&
300
+ ocurrences_list == o.ocurrences_list
301
+ end
302
+
303
+ # @see the `==` method
304
+ # @param [Object] Object to be compared
305
+ def eql?(o)
306
+ self == o
307
+ end
308
+
309
+ # Calculates hash code according to all attributes.
310
+ # @return [Integer] Hash code
311
+ def hash
312
+ [payment_status, payment_type, credit_type, debit_branch_office, debit_current_account, check_digit_debit_current_account, payment_date, payment_value, clearinghouse_code, ispb_code, credit_branch_office, credit_current_account, check_digit_credit_current_account, taxpayer_type, taxpayer_registration, debit_document, credit_document, beneficiary_name, payment_authentication_code, credit_order_purpose_code, wire_transfer_purpose_code, deposit_in_court_identifier, ocurrences_list].hash
313
+ end
314
+
315
+ # Builds the object from hash
316
+ # @param [Hash] attributes Model attributes in the form of hash
317
+ # @return [Object] Returns the model itself
318
+ def self.build_from_hash(attributes)
319
+ new.build_from_hash(attributes)
320
+ end
321
+
322
+ # Builds the object from hash
323
+ # @param [Hash] attributes Model attributes in the form of hash
324
+ # @return [Object] Returns the model itself
325
+ def build_from_hash(attributes)
326
+ return nil unless attributes.is_a?(Hash)
327
+ self.class.openapi_types.each_pair do |key, type|
328
+ if type =~ /\AArray<(.*)>/i
329
+ # check to ensure the input is an array given that the attribute
330
+ # is documented as an array but the input is not
331
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
332
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
333
+ end
334
+ elsif !attributes[self.class.attribute_map[key]].nil?
335
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
336
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
337
+ self.send("#{key}=", nil)
338
+ end
339
+ end
340
+
341
+ self
342
+ end
343
+
344
+ # Deserializes the data based on type
345
+ # @param string type Data type
346
+ # @param string value Value to be deserialized
347
+ # @return [Object] Deserialized data
348
+ def _deserialize(type, value)
349
+ case type.to_sym
350
+ when :DateTime
351
+ DateTime.parse(value)
352
+ when :Date
353
+ Date.parse(value)
354
+ when :String
355
+ value.to_s
356
+ when :Integer
357
+ value.to_i
358
+ when :Float
359
+ value.to_f
360
+ when :Boolean
361
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
362
+ true
363
+ else
364
+ false
365
+ end
366
+ when :Object
367
+ # generic object (usually a Hash), return directly
368
+ value
369
+ when /\AArray<(?<inner_type>.+)>\z/
370
+ inner_type = Regexp.last_match[:inner_type]
371
+ value.map { |v| _deserialize(inner_type, v) }
372
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
373
+ k_type = Regexp.last_match[:k_type]
374
+ v_type = Regexp.last_match[:v_type]
375
+ {}.tap do |hash|
376
+ value.each do |k, v|
377
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
378
+ end
379
+ end
380
+ else # model
381
+ BancoBrasilPayments.const_get(type).build_from_hash(value)
382
+ end
383
+ end
384
+
385
+ # Returns the string representation of the object
386
+ # @return [String] String presentation of the object
387
+ def to_s
388
+ to_hash.to_s
389
+ end
390
+
391
+ # to_body is an alias to to_hash (backward compatibility)
392
+ # @return [Hash] Returns the object in the form of hash
393
+ def to_body
394
+ to_hash
395
+ end
396
+
397
+ # Returns the object in the form of hash
398
+ # @return [Hash] Returns the object in the form of hash
399
+ def to_hash
400
+ hash = {}
401
+ self.class.attribute_map.each_pair do |attr, param|
402
+ value = self.send(attr)
403
+ if value.nil?
404
+ is_nullable = self.class.openapi_nullable.include?(attr)
405
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
406
+ end
407
+
408
+ hash[param] = _to_hash(value)
409
+ end
410
+ hash
411
+ end
412
+
413
+ # Outputs non-array value in the form of hash
414
+ # For object, use to_hash. Otherwise, just return the value
415
+ # @param [Object] value Any valid value
416
+ # @return [Hash] Returns the value in the form of hash
417
+ def _to_hash(value)
418
+ if value.is_a?(Array)
419
+ value.compact.map { |v| _to_hash(v) }
420
+ elsif value.is_a?(Hash)
421
+ {}.tap do |hash|
422
+ value.each { |k, v| hash[k] = _to_hash(v) }
423
+ end
424
+ elsif value.respond_to? :to_hash
425
+ value.to_hash
426
+ else
427
+ value
428
+ end
429
+ end end
430
+ end
@@ -0,0 +1,227 @@
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 InlineResponse2001OcurrencesList
16
+ # Código da ocorrência de erro OU Código do motivo da devolução do pagamento. Caso haja devolução, este campo é preenchido com o codigo do motivo da devolução.
17
+ attr_accessor :returned_code
18
+
19
+ # Data da devolução
20
+ attr_accessor :returned_date
21
+
22
+ # Valor da devolução.
23
+ attr_accessor :returned_value
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'returned_code' => :'returnedCode',
29
+ :'returned_date' => :'returnedDate',
30
+ :'returned_value' => :'returnedValue'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'returned_code' => :'Object',
38
+ :'returned_date' => :'Object',
39
+ :'returned_value' => :'Object'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::InlineResponse2001OcurrencesList` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::InlineResponse2001OcurrencesList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'returned_code')
65
+ self.returned_code = attributes[:'returned_code']
66
+ end
67
+
68
+ if attributes.key?(:'returned_date')
69
+ self.returned_date = attributes[:'returned_date']
70
+ end
71
+
72
+ if attributes.key?(:'returned_value')
73
+ self.returned_value = attributes[:'returned_value']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ returned_code == o.returned_code &&
96
+ returned_date == o.returned_date &&
97
+ returned_value == o.returned_value
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [returned_code, returned_date, returned_value].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ new.build_from_hash(attributes)
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ BancoBrasilPayments.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end end
227
+ end