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,240 @@
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
+ # Objeto de resposta da consulta a pagamentos devolvidos
16
+ class RootTypeForReturnedPaymentsResponseObject
17
+ # Posição do índice. Cada resposta tem um limite de 300 ocorrências na lista paymentList, iniciada a partir do valor do índice fornecido. Para todas as ocorrências, itere sobre esse recurso usando o valor do campo nextIndex da resposta.
18
+ attr_accessor :index
19
+
20
+ # Lista de detalhes dos pagamentos
21
+ attr_accessor :list_payments
22
+
23
+ # Quantidade total de pagamentos na tabela
24
+ attr_accessor :total_list_quantity
25
+
26
+ # Quantidade total de pagamentos
27
+ attr_accessor :current_list_quantity
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'index' => :'index',
33
+ :'list_payments' => :'listPayments',
34
+ :'total_list_quantity' => :'totalListQuantity',
35
+ :'current_list_quantity' => :'currentListQuantity'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'index' => :'Object',
43
+ :'list_payments' => :'Object',
44
+ :'total_list_quantity' => :'Object',
45
+ :'current_list_quantity' => :'Object'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::RootTypeForReturnedPaymentsResponseObject` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::RootTypeForReturnedPaymentsResponseObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'index')
71
+ self.index = attributes[:'index']
72
+ end
73
+
74
+ if attributes.key?(:'list_payments')
75
+ if (value = attributes[:'list_payments']).is_a?(Array)
76
+ self.list_payments = value
77
+ end
78
+ end
79
+
80
+ if attributes.key?(:'total_list_quantity')
81
+ self.total_list_quantity = attributes[:'total_list_quantity']
82
+ end
83
+
84
+ if attributes.key?(:'current_list_quantity')
85
+ self.current_list_quantity = attributes[:'current_list_quantity']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ index == o.index &&
108
+ list_payments == o.list_payments &&
109
+ total_list_quantity == o.total_list_quantity &&
110
+ current_list_quantity == o.current_list_quantity
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [index, list_payments, total_list_quantity, current_list_quantity].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
147
+ self.send("#{key}=", nil)
148
+ end
149
+ end
150
+
151
+ self
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :DateTime
161
+ DateTime.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ BancoBrasilPayments.const_get(type).build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end end
240
+ end
@@ -0,0 +1,408 @@
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
+ # Objeto de detalhamento de Boletos para o recurso Batch Slips (Pagamento de boletos em lote)
16
+ class RootTypeForSlipsDetailsObject
17
+ # Código identificador do pagamento.
18
+ attr_accessor :slip_id
19
+
20
+ # Data em que deverá ser efetivado o pagamento do boleto (formato: ddmmaaaa). Campo Obrigatório. Agendamentos poderão ser afetuados para até 180 dias
21
+ attr_accessor :payment_date
22
+
23
+ # Valor do pagamento do boleto (formato 0.00). Campo Obrigatório
24
+ attr_accessor :payment_value
25
+
26
+ # Código de barras numérico do boleto. Campo obrigatório
27
+ attr_accessor :numeric_bar_code
28
+
29
+ # Data de vencimento do boleto (formato: ddmmaaaa). Campo Obrigatório
30
+ attr_accessor :due_date
31
+
32
+ # Valor de registro do boleto, sem descontos ou multas (formato 0.00). Campo Obrigatório
33
+ attr_accessor :bank_slip_value
34
+
35
+ # Valor do desconto ou do abatimento do boleto ou do desconto + abatimento (formato 0.00)
36
+ attr_accessor :discount_value
37
+
38
+ # Valor do juros ou de mora ou multa ou juros + mora+ multa, adicionado valor do boleto (formato 0.00)
39
+ attr_accessor :late_payment_value
40
+
41
+ # Número indicado no boleto no campo Nosso Número, no formato STRING, com 20 dígitos. Ex: 31285570000088000
42
+ attr_accessor :our_number
43
+
44
+ # Nº de uso livre pelo cliente conveniado. Equivalente ao Seu Número (Limitado a 20 caracteres).
45
+ attr_accessor :your_number
46
+
47
+ # Identifica o tipo de pessoa, como: 1 - Pessoa física 2 - Pessoa Jurídica.
48
+ attr_accessor :payer_taxpayer_type
49
+
50
+ # CPF ou CNPJ do pagador.
51
+ attr_accessor :payer_taxpayer_registration
52
+
53
+ # Identifica o tipo de pessoa, como: 1 - Pessoa física 2 - Pessoa Jurídica.
54
+ attr_accessor :beneficiary_taxpayer_type
55
+
56
+ # CPF ou CNPJ do beneficiário no pagamento.
57
+ attr_accessor :beneficiary_taxpayer_registration
58
+
59
+ # Identifica o tipo de pessoa, como: 1 - Pessoa física 2 - Pessoa Jurídica.
60
+ attr_accessor :guarantor_taxpayer_type
61
+
62
+ # CPF ou CNPJ do avalista.
63
+ attr_accessor :guarantor_taxpayer_registration
64
+
65
+ # Descrição do pagamento de Boletos. Pode ser preenchido livremente pelo cliente como forma de identificação para o pagamento.
66
+ attr_accessor :client_description
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'slip_id' => :'slipID',
72
+ :'payment_date' => :'paymentDate',
73
+ :'payment_value' => :'paymentValue',
74
+ :'numeric_bar_code' => :'numericBarCode',
75
+ :'due_date' => :'dueDate',
76
+ :'bank_slip_value' => :'bankSlipValue',
77
+ :'discount_value' => :'discountValue',
78
+ :'late_payment_value' => :'latePaymentValue',
79
+ :'our_number' => :'ourNumber',
80
+ :'your_number' => :'yourNumber',
81
+ :'payer_taxpayer_type' => :'payerTaxpayerType',
82
+ :'payer_taxpayer_registration' => :'payerTaxpayerRegistration',
83
+ :'beneficiary_taxpayer_type' => :'beneficiaryTaxpayerType',
84
+ :'beneficiary_taxpayer_registration' => :'beneficiaryTaxpayerRegistration',
85
+ :'guarantor_taxpayer_type' => :'guarantorTaxpayerType',
86
+ :'guarantor_taxpayer_registration' => :'guarantorTaxpayerRegistration',
87
+ :'client_description' => :'clientDescription'
88
+ }
89
+ end
90
+
91
+ # Attribute type mapping.
92
+ def self.openapi_types
93
+ {
94
+ :'slip_id' => :'Object',
95
+ :'payment_date' => :'Object',
96
+ :'payment_value' => :'Object',
97
+ :'numeric_bar_code' => :'Object',
98
+ :'due_date' => :'Object',
99
+ :'bank_slip_value' => :'Object',
100
+ :'discount_value' => :'Object',
101
+ :'late_payment_value' => :'Object',
102
+ :'our_number' => :'Object',
103
+ :'your_number' => :'Object',
104
+ :'payer_taxpayer_type' => :'Object',
105
+ :'payer_taxpayer_registration' => :'Object',
106
+ :'beneficiary_taxpayer_type' => :'Object',
107
+ :'beneficiary_taxpayer_registration' => :'Object',
108
+ :'guarantor_taxpayer_type' => :'Object',
109
+ :'guarantor_taxpayer_registration' => :'Object',
110
+ :'client_description' => :'Object'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ ])
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ if (!attributes.is_a?(Hash))
124
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::RootTypeForSlipsDetailsObject` initialize method"
125
+ end
126
+
127
+ # check to see if the attribute exists and convert string to symbol for hash key
128
+ attributes = attributes.each_with_object({}) { |(k, v), h|
129
+ if (!self.class.attribute_map.key?(k.to_sym))
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::RootTypeForSlipsDetailsObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
+ end
132
+ h[k.to_sym] = v
133
+ }
134
+
135
+ if attributes.key?(:'slip_id')
136
+ self.slip_id = attributes[:'slip_id']
137
+ end
138
+
139
+ if attributes.key?(:'payment_date')
140
+ self.payment_date = attributes[:'payment_date']
141
+ end
142
+
143
+ if attributes.key?(:'payment_value')
144
+ self.payment_value = attributes[:'payment_value']
145
+ end
146
+
147
+ if attributes.key?(:'numeric_bar_code')
148
+ self.numeric_bar_code = attributes[:'numeric_bar_code']
149
+ end
150
+
151
+ if attributes.key?(:'due_date')
152
+ self.due_date = attributes[:'due_date']
153
+ end
154
+
155
+ if attributes.key?(:'bank_slip_value')
156
+ self.bank_slip_value = attributes[:'bank_slip_value']
157
+ end
158
+
159
+ if attributes.key?(:'discount_value')
160
+ self.discount_value = attributes[:'discount_value']
161
+ end
162
+
163
+ if attributes.key?(:'late_payment_value')
164
+ self.late_payment_value = attributes[:'late_payment_value']
165
+ end
166
+
167
+ if attributes.key?(:'our_number')
168
+ self.our_number = attributes[:'our_number']
169
+ end
170
+
171
+ if attributes.key?(:'your_number')
172
+ self.your_number = attributes[:'your_number']
173
+ end
174
+
175
+ if attributes.key?(:'payer_taxpayer_type')
176
+ self.payer_taxpayer_type = attributes[:'payer_taxpayer_type']
177
+ end
178
+
179
+ if attributes.key?(:'payer_taxpayer_registration')
180
+ self.payer_taxpayer_registration = attributes[:'payer_taxpayer_registration']
181
+ end
182
+
183
+ if attributes.key?(:'beneficiary_taxpayer_type')
184
+ self.beneficiary_taxpayer_type = attributes[:'beneficiary_taxpayer_type']
185
+ end
186
+
187
+ if attributes.key?(:'beneficiary_taxpayer_registration')
188
+ self.beneficiary_taxpayer_registration = attributes[:'beneficiary_taxpayer_registration']
189
+ end
190
+
191
+ if attributes.key?(:'guarantor_taxpayer_type')
192
+ self.guarantor_taxpayer_type = attributes[:'guarantor_taxpayer_type']
193
+ end
194
+
195
+ if attributes.key?(:'guarantor_taxpayer_registration')
196
+ self.guarantor_taxpayer_registration = attributes[:'guarantor_taxpayer_registration']
197
+ end
198
+
199
+ if attributes.key?(:'client_description')
200
+ self.client_description = attributes[:'client_description']
201
+ end
202
+ end
203
+
204
+ # Show invalid properties with the reasons. Usually used together with valid?
205
+ # @return Array for valid properties with the reasons
206
+ def list_invalid_properties
207
+ invalid_properties = Array.new
208
+ if @payment_date.nil?
209
+ invalid_properties.push('invalid value for "payment_date", payment_date cannot be nil.')
210
+ end
211
+
212
+ if @payment_value.nil?
213
+ invalid_properties.push('invalid value for "payment_value", payment_value cannot be nil.')
214
+ end
215
+
216
+ if @numeric_bar_code.nil?
217
+ invalid_properties.push('invalid value for "numeric_bar_code", numeric_bar_code cannot be nil.')
218
+ end
219
+
220
+ if @due_date.nil?
221
+ invalid_properties.push('invalid value for "due_date", due_date cannot be nil.')
222
+ end
223
+
224
+ if @bank_slip_value.nil?
225
+ invalid_properties.push('invalid value for "bank_slip_value", bank_slip_value cannot be nil.')
226
+ end
227
+
228
+ if @beneficiary_taxpayer_type.nil?
229
+ invalid_properties.push('invalid value for "beneficiary_taxpayer_type", beneficiary_taxpayer_type cannot be nil.')
230
+ end
231
+
232
+ if @beneficiary_taxpayer_registration.nil?
233
+ invalid_properties.push('invalid value for "beneficiary_taxpayer_registration", beneficiary_taxpayer_registration cannot be nil.')
234
+ end
235
+
236
+ if @client_description.nil?
237
+ invalid_properties.push('invalid value for "client_description", client_description cannot be nil.')
238
+ end
239
+
240
+ invalid_properties
241
+ end
242
+
243
+ # Check to see if the all the properties in the model are valid
244
+ # @return true if the model is valid
245
+ def valid?
246
+ return false if @payment_date.nil?
247
+ return false if @payment_value.nil?
248
+ return false if @numeric_bar_code.nil?
249
+ return false if @due_date.nil?
250
+ return false if @bank_slip_value.nil?
251
+ return false if @beneficiary_taxpayer_type.nil?
252
+ return false if @beneficiary_taxpayer_registration.nil?
253
+ return false if @client_description.nil?
254
+ true
255
+ end
256
+
257
+ # Checks equality by comparing each attribute.
258
+ # @param [Object] Object to be compared
259
+ def ==(o)
260
+ return true if self.equal?(o)
261
+ self.class == o.class &&
262
+ slip_id == o.slip_id &&
263
+ payment_date == o.payment_date &&
264
+ payment_value == o.payment_value &&
265
+ numeric_bar_code == o.numeric_bar_code &&
266
+ due_date == o.due_date &&
267
+ bank_slip_value == o.bank_slip_value &&
268
+ discount_value == o.discount_value &&
269
+ late_payment_value == o.late_payment_value &&
270
+ our_number == o.our_number &&
271
+ your_number == o.your_number &&
272
+ payer_taxpayer_type == o.payer_taxpayer_type &&
273
+ payer_taxpayer_registration == o.payer_taxpayer_registration &&
274
+ beneficiary_taxpayer_type == o.beneficiary_taxpayer_type &&
275
+ beneficiary_taxpayer_registration == o.beneficiary_taxpayer_registration &&
276
+ guarantor_taxpayer_type == o.guarantor_taxpayer_type &&
277
+ guarantor_taxpayer_registration == o.guarantor_taxpayer_registration &&
278
+ client_description == o.client_description
279
+ end
280
+
281
+ # @see the `==` method
282
+ # @param [Object] Object to be compared
283
+ def eql?(o)
284
+ self == o
285
+ end
286
+
287
+ # Calculates hash code according to all attributes.
288
+ # @return [Integer] Hash code
289
+ def hash
290
+ [slip_id, payment_date, payment_value, numeric_bar_code, due_date, bank_slip_value, discount_value, late_payment_value, our_number, your_number, payer_taxpayer_type, payer_taxpayer_registration, beneficiary_taxpayer_type, beneficiary_taxpayer_registration, guarantor_taxpayer_type, guarantor_taxpayer_registration, client_description].hash
291
+ end
292
+
293
+ # Builds the object from hash
294
+ # @param [Hash] attributes Model attributes in the form of hash
295
+ # @return [Object] Returns the model itself
296
+ def self.build_from_hash(attributes)
297
+ new.build_from_hash(attributes)
298
+ end
299
+
300
+ # Builds the object from hash
301
+ # @param [Hash] attributes Model attributes in the form of hash
302
+ # @return [Object] Returns the model itself
303
+ def build_from_hash(attributes)
304
+ return nil unless attributes.is_a?(Hash)
305
+ self.class.openapi_types.each_pair do |key, type|
306
+ if type =~ /\AArray<(.*)>/i
307
+ # check to ensure the input is an array given that the attribute
308
+ # is documented as an array but the input is not
309
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
310
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
311
+ end
312
+ elsif !attributes[self.class.attribute_map[key]].nil?
313
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
314
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
315
+ self.send("#{key}=", nil)
316
+ end
317
+ end
318
+
319
+ self
320
+ end
321
+
322
+ # Deserializes the data based on type
323
+ # @param string type Data type
324
+ # @param string value Value to be deserialized
325
+ # @return [Object] Deserialized data
326
+ def _deserialize(type, value)
327
+ case type.to_sym
328
+ when :DateTime
329
+ DateTime.parse(value)
330
+ when :Date
331
+ Date.parse(value)
332
+ when :String
333
+ value.to_s
334
+ when :Integer
335
+ value.to_i
336
+ when :Float
337
+ value.to_f
338
+ when :Boolean
339
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
340
+ true
341
+ else
342
+ false
343
+ end
344
+ when :Object
345
+ # generic object (usually a Hash), return directly
346
+ value
347
+ when /\AArray<(?<inner_type>.+)>\z/
348
+ inner_type = Regexp.last_match[:inner_type]
349
+ value.map { |v| _deserialize(inner_type, v) }
350
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
351
+ k_type = Regexp.last_match[:k_type]
352
+ v_type = Regexp.last_match[:v_type]
353
+ {}.tap do |hash|
354
+ value.each do |k, v|
355
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
356
+ end
357
+ end
358
+ else # model
359
+ BancoBrasilPayments.const_get(type).build_from_hash(value)
360
+ end
361
+ end
362
+
363
+ # Returns the string representation of the object
364
+ # @return [String] String presentation of the object
365
+ def to_s
366
+ to_hash.to_s
367
+ end
368
+
369
+ # to_body is an alias to to_hash (backward compatibility)
370
+ # @return [Hash] Returns the object in the form of hash
371
+ def to_body
372
+ to_hash
373
+ end
374
+
375
+ # Returns the object in the form of hash
376
+ # @return [Hash] Returns the object in the form of hash
377
+ def to_hash
378
+ hash = {}
379
+ self.class.attribute_map.each_pair do |attr, param|
380
+ value = self.send(attr)
381
+ if value.nil?
382
+ is_nullable = self.class.openapi_nullable.include?(attr)
383
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
384
+ end
385
+
386
+ hash[param] = _to_hash(value)
387
+ end
388
+ hash
389
+ end
390
+
391
+ # Outputs non-array value in the form of hash
392
+ # For object, use to_hash. Otherwise, just return the value
393
+ # @param [Object] value Any valid value
394
+ # @return [Hash] Returns the value in the form of hash
395
+ def _to_hash(value)
396
+ if value.is_a?(Array)
397
+ value.compact.map { |v| _to_hash(v) }
398
+ elsif value.is_a?(Hash)
399
+ {}.tap do |hash|
400
+ value.each { |k, v| hash[k] = _to_hash(v) }
401
+ end
402
+ elsif value.respond_to? :to_hash
403
+ value.to_hash
404
+ else
405
+ value
406
+ end
407
+ end end
408
+ end