payzu-pix 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +231 -0
  4. data/Rakefile +10 -0
  5. data/docs/AccountApi.md +141 -0
  6. data/docs/ApiErrorDetailsInner.md +20 -0
  7. data/docs/BankStatement.md +42 -0
  8. data/docs/BankStatementListResponse.md +20 -0
  9. data/docs/BankStatementListResponsePagination.md +22 -0
  10. data/docs/CallbackDetail.md +34 -0
  11. data/docs/CallbackListResponse.md +20 -0
  12. data/docs/CallbackListResponsePagination.md +22 -0
  13. data/docs/CallbackSecretResponse.md +20 -0
  14. data/docs/CallbacksApi.md +587 -0
  15. data/docs/Defense.md +30 -0
  16. data/docs/DefenseFilesInner.md +24 -0
  17. data/docs/DefenseHistoryEntry.md +28 -0
  18. data/docs/DefenseHistoryEntryFilesInner.md +22 -0
  19. data/docs/DepositPending.md +62 -0
  20. data/docs/DepositPendingListResponse.md +24 -0
  21. data/docs/DictConsultResponse.md +30 -0
  22. data/docs/DownloadUserReport200Response.md +20 -0
  23. data/docs/EnqueuedCallback.md +18 -0
  24. data/docs/EnqueuedCallbackEnqueued.md +22 -0
  25. data/docs/EnqueuedCallbackItem.md +22 -0
  26. data/docs/ErrorResponse.md +32 -0
  27. data/docs/GetUser200Response.md +46 -0
  28. data/docs/GetUser200ResponseDailyWithdrawLimit.md +24 -0
  29. data/docs/GetUser200ResponseServiceFee.md +28 -0
  30. data/docs/GetUserBalance200Response.md +20 -0
  31. data/docs/GetUserTransactionById200Response.md +94 -0
  32. data/docs/GetUserTransactionById200ResponseAllOfCallbackLogInner.md +26 -0
  33. data/docs/GetUserTransactionById200ResponseAllOfInfractionInner.md +24 -0
  34. data/docs/GetUserTransactions200Response.md +22 -0
  35. data/docs/InfractionDetail.md +40 -0
  36. data/docs/InfractionDetailTransaction.md +30 -0
  37. data/docs/InfractionListResponse.md +20 -0
  38. data/docs/InfractionListResponsePagination.md +24 -0
  39. data/docs/InfractionsApi.md +413 -0
  40. data/docs/InternalTransferApi.md +153 -0
  41. data/docs/KeysAndDICTApi.md +217 -0
  42. data/docs/ListUserReports200Response.md +22 -0
  43. data/docs/PixKeyInfo.md +36 -0
  44. data/docs/PixOperationsApi.md +299 -0
  45. data/docs/PostInternalTransferRequest.md +30 -0
  46. data/docs/PostPixQrcodeReadRequest.md +18 -0
  47. data/docs/PostPixRequest.md +32 -0
  48. data/docs/PostUserReportRequest.md +24 -0
  49. data/docs/PostWithdrawQrcodeRequest.md +28 -0
  50. data/docs/PostWithdrawRequest.md +30 -0
  51. data/docs/ProofResponse.md +18 -0
  52. data/docs/QRCodeReadResponse.md +38 -0
  53. data/docs/Refund.md +34 -0
  54. data/docs/RefundRequest.md +22 -0
  55. data/docs/RefundsApi.md +79 -0
  56. data/docs/ReportJob.md +30 -0
  57. data/docs/ReportJobAccepted.md +30 -0
  58. data/docs/ReportJobDetail.md +30 -0
  59. data/docs/ReportsApi.md +881 -0
  60. data/docs/ResendUserCallbackSingle200Response.md +18 -0
  61. data/docs/ResendUserCallbacks200Response.md +20 -0
  62. data/docs/ResendUserCallbacksRequest.md +28 -0
  63. data/docs/ResendWebhookCallbacksRequest.md +30 -0
  64. data/docs/RotateCallbackSecretResponse.md +18 -0
  65. data/docs/RotateSecretResponse.md +18 -0
  66. data/docs/SentWebhookDetail.md +40 -0
  67. data/docs/SentWebhookDetailResponse.md +18 -0
  68. data/docs/SentWebhooksQuantity.md +18 -0
  69. data/docs/Summary.md +26 -0
  70. data/docs/SummaryBlock.md +24 -0
  71. data/docs/SummaryBlockGroupedInner.md +20 -0
  72. data/docs/SummaryBlockStatuses.md +26 -0
  73. data/docs/SummaryStatus.md +22 -0
  74. data/docs/Transaction.md +90 -0
  75. data/docs/TransactionWithRefunds.md +92 -0
  76. data/docs/Webhook.md +30 -0
  77. data/docs/WebhookCreateRequest.md +24 -0
  78. data/docs/WebhookEventType.md +15 -0
  79. data/docs/WebhookListResponse.md +18 -0
  80. data/docs/WebhookUpdateRequest.md +22 -0
  81. data/docs/WebhookWithSecret.md +32 -0
  82. data/docs/WebhooksApi.md +574 -0
  83. data/docs/WithdrawalsApi.md +299 -0
  84. data/git_push.sh +57 -0
  85. data/lib/payzu-pix/api/account_api.rb +136 -0
  86. data/lib/payzu-pix/api/callbacks_api.rb +577 -0
  87. data/lib/payzu-pix/api/infractions_api.rb +452 -0
  88. data/lib/payzu-pix/api/internal_transfer_api.rb +164 -0
  89. data/lib/payzu-pix/api/keys_and_dict_api.rb +234 -0
  90. data/lib/payzu-pix/api/pix_operations_api.rb +300 -0
  91. data/lib/payzu-pix/api/refunds_api.rb +96 -0
  92. data/lib/payzu-pix/api/reports_api.rb +968 -0
  93. data/lib/payzu-pix/api/webhooks_api.rb +542 -0
  94. data/lib/payzu-pix/api/withdrawals_api.rb +305 -0
  95. data/lib/payzu-pix/api_client.rb +441 -0
  96. data/lib/payzu-pix/api_error.rb +58 -0
  97. data/lib/payzu-pix/api_model_base.rb +88 -0
  98. data/lib/payzu-pix/configuration.rb +392 -0
  99. data/lib/payzu-pix/models/api_error_details_inner.rb +192 -0
  100. data/lib/payzu-pix/models/bank_statement.rb +296 -0
  101. data/lib/payzu-pix/models/bank_statement_list_response.rb +159 -0
  102. data/lib/payzu-pix/models/bank_statement_list_response_pagination.rb +169 -0
  103. data/lib/payzu-pix/models/callback_detail.rb +228 -0
  104. data/lib/payzu-pix/models/callback_list_response.rb +159 -0
  105. data/lib/payzu-pix/models/callback_list_response_pagination.rb +169 -0
  106. data/lib/payzu-pix/models/callback_secret_response.rb +158 -0
  107. data/lib/payzu-pix/models/defense.rb +234 -0
  108. data/lib/payzu-pix/models/defense_files_inner.rb +179 -0
  109. data/lib/payzu-pix/models/defense_history_entry.rb +225 -0
  110. data/lib/payzu-pix/models/defense_history_entry_files_inner.rb +168 -0
  111. data/lib/payzu-pix/models/deposit_pending.rb +407 -0
  112. data/lib/payzu-pix/models/deposit_pending_list_response.rb +180 -0
  113. data/lib/payzu-pix/models/dict_consult_response.rb +231 -0
  114. data/lib/payzu-pix/models/download_user_report200_response.rb +158 -0
  115. data/lib/payzu-pix/models/enqueued_callback.rb +147 -0
  116. data/lib/payzu-pix/models/enqueued_callback_enqueued.rb +170 -0
  117. data/lib/payzu-pix/models/enqueued_callback_item.rb +190 -0
  118. data/lib/payzu-pix/models/error_response.rb +336 -0
  119. data/lib/payzu-pix/models/get_user200_response.rb +334 -0
  120. data/lib/payzu-pix/models/get_user200_response_daily_withdraw_limit.rb +180 -0
  121. data/lib/payzu-pix/models/get_user200_response_service_fee.rb +199 -0
  122. data/lib/payzu-pix/models/get_user_balance200_response.rb +158 -0
  123. data/lib/payzu-pix/models/get_user_transaction_by_id200_response.rb +595 -0
  124. data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_callback_log_inner.rb +188 -0
  125. data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_infraction_inner.rb +202 -0
  126. data/lib/payzu-pix/models/get_user_transactions200_response.rb +170 -0
  127. data/lib/payzu-pix/models/infraction_detail.rb +293 -0
  128. data/lib/payzu-pix/models/infraction_detail_transaction.rb +213 -0
  129. data/lib/payzu-pix/models/infraction_list_response.rb +159 -0
  130. data/lib/payzu-pix/models/infraction_list_response_pagination.rb +179 -0
  131. data/lib/payzu-pix/models/list_user_reports200_response.rb +170 -0
  132. data/lib/payzu-pix/models/pix_key_info.rb +263 -0
  133. data/lib/payzu-pix/models/post_internal_transfer_request.rb +377 -0
  134. data/lib/payzu-pix/models/post_pix_qrcode_read_request.rb +174 -0
  135. data/lib/payzu-pix/models/post_pix_request.rb +382 -0
  136. data/lib/payzu-pix/models/post_user_report_request.rb +238 -0
  137. data/lib/payzu-pix/models/post_withdraw_qrcode_request.rb +302 -0
  138. data/lib/payzu-pix/models/post_withdraw_request.rb +350 -0
  139. data/lib/payzu-pix/models/proof_response.rb +148 -0
  140. data/lib/payzu-pix/models/qr_code_read_response.rb +283 -0
  141. data/lib/payzu-pix/models/refund.rb +257 -0
  142. data/lib/payzu-pix/models/refund_request.rb +215 -0
  143. data/lib/payzu-pix/models/report_job.rb +234 -0
  144. data/lib/payzu-pix/models/report_job_accepted.rb +237 -0
  145. data/lib/payzu-pix/models/report_job_detail.rb +237 -0
  146. data/lib/payzu-pix/models/resend_user_callback_single200_response.rb +148 -0
  147. data/lib/payzu-pix/models/resend_user_callbacks200_response.rb +158 -0
  148. data/lib/payzu-pix/models/resend_user_callbacks_request.rb +262 -0
  149. data/lib/payzu-pix/models/resend_webhook_callbacks_request.rb +274 -0
  150. data/lib/payzu-pix/models/rotate_callback_secret_response.rb +148 -0
  151. data/lib/payzu-pix/models/rotate_secret_response.rb +148 -0
  152. data/lib/payzu-pix/models/sent_webhook_detail.rb +261 -0
  153. data/lib/payzu-pix/models/sent_webhook_detail_response.rb +164 -0
  154. data/lib/payzu-pix/models/sent_webhooks_quantity.rb +148 -0
  155. data/lib/payzu-pix/models/summary.rb +188 -0
  156. data/lib/payzu-pix/models/summary_block.rb +179 -0
  157. data/lib/payzu-pix/models/summary_block_grouped_inner.rb +158 -0
  158. data/lib/payzu-pix/models/summary_block_statuses.rb +189 -0
  159. data/lib/payzu-pix/models/summary_status.rb +168 -0
  160. data/lib/payzu-pix/models/transaction.rb +588 -0
  161. data/lib/payzu-pix/models/transaction_with_refunds.rb +583 -0
  162. data/lib/payzu-pix/models/webhook.rb +210 -0
  163. data/lib/payzu-pix/models/webhook_create_request.rb +201 -0
  164. data/lib/payzu-pix/models/webhook_event_type.rb +47 -0
  165. data/lib/payzu-pix/models/webhook_list_response.rb +150 -0
  166. data/lib/payzu-pix/models/webhook_update_request.rb +171 -0
  167. data/lib/payzu-pix/models/webhook_with_secret.rb +220 -0
  168. data/lib/payzu-pix/version.rb +15 -0
  169. data/lib/payzu-pix.rb +119 -0
  170. data/payzu-pix.gemspec +41 -0
  171. data/spec/spec_helper.rb +111 -0
  172. metadata +283 -0
@@ -0,0 +1,382 @@
1
+ =begin
2
+ #PayZu Pix API
3
+
4
+ #REST API for Pix operations on the PayZu platform, deposits, withdrawals, internal transfers, infractions, reports, and callback inspection. All amounts are in BRL (reais) unless explicitly noted. Authentication uses a Bearer token issued during onboarding. ## SDKs oficiais - Node.js: `npm install payzu-pix` - Python: `pip install payzu-pix` - PHP: `composer require payzu/pix` - Ruby: `gem install payzu-pix` - Java: `br.com.payzu:payzu-pix` (Maven Central) - Go: `go get github.com/PayZuAI/payzu-sdks/go/v2` Repo: https://github.com/PayZuAI/payzu-sdks
5
+
6
+ The version of the OpenAPI document: 1.8.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PayZuPix
17
+ class PostPixRequest < ApiModelBase
18
+ # Amount in BRL. Must be >= 1.
19
+ attr_accessor :amount
20
+
21
+ # URL for transaction notifications (http or https).
22
+ attr_accessor :callback_url
23
+
24
+ # Payer full name. Letters and spaces only.
25
+ attr_accessor :generated_name
26
+
27
+ # Payer email (optional).
28
+ attr_accessor :generated_email
29
+
30
+ # Payer CPF (11 digits) or CNPJ (14 digits), no punctuation, with valid check digits.
31
+ attr_accessor :generated_document
32
+
33
+ # Seconds until the QR Code expires.
34
+ attr_accessor :expires_in
35
+
36
+ # External reference (order, invoice, etc.). A clientReference already used returns the transaction created with it.
37
+ attr_accessor :client_reference
38
+
39
+ # Virtual sub-account (up to 50 characters) to correlate stores, branches, marketplaces. Returned in the callback.
40
+ attr_accessor :virtual_account
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'amount' => :'amount',
46
+ :'callback_url' => :'callbackUrl',
47
+ :'generated_name' => :'generatedName',
48
+ :'generated_email' => :'generatedEmail',
49
+ :'generated_document' => :'generatedDocument',
50
+ :'expires_in' => :'expiresIn',
51
+ :'client_reference' => :'clientReference',
52
+ :'virtual_account' => :'virtualAccount'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'amount' => :'Float',
70
+ :'callback_url' => :'String',
71
+ :'generated_name' => :'String',
72
+ :'generated_email' => :'String',
73
+ :'generated_document' => :'String',
74
+ :'expires_in' => :'Float',
75
+ :'client_reference' => :'String',
76
+ :'virtual_account' => :'String'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::PostPixRequest` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::PostPixRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'amount')
103
+ self.amount = attributes[:'amount']
104
+ else
105
+ self.amount = nil
106
+ end
107
+
108
+ if attributes.key?(:'callback_url')
109
+ self.callback_url = attributes[:'callback_url']
110
+ end
111
+
112
+ if attributes.key?(:'generated_name')
113
+ self.generated_name = attributes[:'generated_name']
114
+ end
115
+
116
+ if attributes.key?(:'generated_email')
117
+ self.generated_email = attributes[:'generated_email']
118
+ end
119
+
120
+ if attributes.key?(:'generated_document')
121
+ self.generated_document = attributes[:'generated_document']
122
+ end
123
+
124
+ if attributes.key?(:'expires_in')
125
+ self.expires_in = attributes[:'expires_in']
126
+ end
127
+
128
+ if attributes.key?(:'client_reference')
129
+ self.client_reference = attributes[:'client_reference']
130
+ end
131
+
132
+ if attributes.key?(:'virtual_account')
133
+ self.virtual_account = attributes[:'virtual_account']
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
141
+ invalid_properties = Array.new
142
+ if @amount.nil?
143
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
144
+ end
145
+
146
+ if @amount < 1
147
+ invalid_properties.push('invalid value for "amount", must be greater than or equal to 1.')
148
+ end
149
+
150
+ pattern = Regexp.new(/^https?:\/\//)
151
+ if !@callback_url.nil? && @callback_url !~ pattern
152
+ invalid_properties.push("invalid value for \"callback_url\", must conform to the pattern #{pattern}.")
153
+ end
154
+
155
+ if !@generated_name.nil? && @generated_name.to_s.length < 1
156
+ invalid_properties.push('invalid value for "generated_name", the character length must be greater than or equal to 1.')
157
+ end
158
+
159
+ pattern = Regexp.new(/^[a-zA-Z À-ÿ]+$/)
160
+ if !@generated_name.nil? && @generated_name !~ pattern
161
+ invalid_properties.push("invalid value for \"generated_name\", must conform to the pattern #{pattern}.")
162
+ end
163
+
164
+ pattern = Regexp.new(/^(\d{11}|\d{14})$/)
165
+ if !@generated_document.nil? && @generated_document !~ pattern
166
+ invalid_properties.push("invalid value for \"generated_document\", must conform to the pattern #{pattern}.")
167
+ end
168
+
169
+ if !@expires_in.nil? && @expires_in > 172000
170
+ invalid_properties.push('invalid value for "expires_in", must be smaller than or equal to 172000.')
171
+ end
172
+
173
+ if !@client_reference.nil? && @client_reference.to_s.length > 64
174
+ invalid_properties.push('invalid value for "client_reference", the character length must be smaller than or equal to 64.')
175
+ end
176
+
177
+ if !@virtual_account.nil? && @virtual_account.to_s.length > 50
178
+ invalid_properties.push('invalid value for "virtual_account", the character length must be smaller than or equal to 50.')
179
+ end
180
+
181
+ if !@virtual_account.nil? && @virtual_account.to_s.length < 1
182
+ invalid_properties.push('invalid value for "virtual_account", the character length must be greater than or equal to 1.')
183
+ end
184
+
185
+ invalid_properties
186
+ end
187
+
188
+ # Check to see if the all the properties in the model are valid
189
+ # @return true if the model is valid
190
+ def valid?
191
+ warn '[DEPRECATED] the `valid?` method is obsolete'
192
+ return false if @amount.nil?
193
+ return false if @amount < 1
194
+ return false if !@callback_url.nil? && @callback_url !~ Regexp.new(/^https?:\/\//)
195
+ return false if !@generated_name.nil? && @generated_name.to_s.length < 1
196
+ return false if !@generated_name.nil? && @generated_name !~ Regexp.new(/^[a-zA-Z À-ÿ]+$/)
197
+ return false if !@generated_document.nil? && @generated_document !~ Regexp.new(/^(\d{11}|\d{14})$/)
198
+ return false if !@expires_in.nil? && @expires_in > 172000
199
+ return false if !@client_reference.nil? && @client_reference.to_s.length > 64
200
+ return false if !@virtual_account.nil? && @virtual_account.to_s.length > 50
201
+ return false if !@virtual_account.nil? && @virtual_account.to_s.length < 1
202
+ true
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] amount Value to be assigned
207
+ def amount=(amount)
208
+ if amount.nil?
209
+ fail ArgumentError, 'amount cannot be nil'
210
+ end
211
+
212
+ if amount < 1
213
+ fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 1.'
214
+ end
215
+
216
+ @amount = amount
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] callback_url Value to be assigned
221
+ def callback_url=(callback_url)
222
+ if callback_url.nil?
223
+ fail ArgumentError, 'callback_url cannot be nil'
224
+ end
225
+
226
+ pattern = Regexp.new(/^https?:\/\//)
227
+ if callback_url !~ pattern
228
+ fail ArgumentError, "invalid value for \"callback_url\", must conform to the pattern #{pattern}."
229
+ end
230
+
231
+ @callback_url = callback_url
232
+ end
233
+
234
+ # Custom attribute writer method with validation
235
+ # @param [Object] generated_name Value to be assigned
236
+ def generated_name=(generated_name)
237
+ if generated_name.nil?
238
+ fail ArgumentError, 'generated_name cannot be nil'
239
+ end
240
+
241
+ if generated_name.to_s.length < 1
242
+ fail ArgumentError, 'invalid value for "generated_name", the character length must be greater than or equal to 1.'
243
+ end
244
+
245
+ pattern = Regexp.new(/^[a-zA-Z À-ÿ]+$/)
246
+ if generated_name !~ pattern
247
+ fail ArgumentError, "invalid value for \"generated_name\", must conform to the pattern #{pattern}."
248
+ end
249
+
250
+ @generated_name = generated_name
251
+ end
252
+
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] generated_document Value to be assigned
255
+ def generated_document=(generated_document)
256
+ if generated_document.nil?
257
+ fail ArgumentError, 'generated_document cannot be nil'
258
+ end
259
+
260
+ pattern = Regexp.new(/^(\d{11}|\d{14})$/)
261
+ if generated_document !~ pattern
262
+ fail ArgumentError, "invalid value for \"generated_document\", must conform to the pattern #{pattern}."
263
+ end
264
+
265
+ @generated_document = generated_document
266
+ end
267
+
268
+ # Custom attribute writer method with validation
269
+ # @param [Object] expires_in Value to be assigned
270
+ def expires_in=(expires_in)
271
+ if expires_in.nil?
272
+ fail ArgumentError, 'expires_in cannot be nil'
273
+ end
274
+
275
+ if expires_in > 172000
276
+ fail ArgumentError, 'invalid value for "expires_in", must be smaller than or equal to 172000.'
277
+ end
278
+
279
+ @expires_in = expires_in
280
+ end
281
+
282
+ # Custom attribute writer method with validation
283
+ # @param [Object] client_reference Value to be assigned
284
+ def client_reference=(client_reference)
285
+ if client_reference.nil?
286
+ fail ArgumentError, 'client_reference cannot be nil'
287
+ end
288
+
289
+ if client_reference.to_s.length > 64
290
+ fail ArgumentError, 'invalid value for "client_reference", the character length must be smaller than or equal to 64.'
291
+ end
292
+
293
+ @client_reference = client_reference
294
+ end
295
+
296
+ # Custom attribute writer method with validation
297
+ # @param [Object] virtual_account Value to be assigned
298
+ def virtual_account=(virtual_account)
299
+ if virtual_account.nil?
300
+ fail ArgumentError, 'virtual_account cannot be nil'
301
+ end
302
+
303
+ if virtual_account.to_s.length > 50
304
+ fail ArgumentError, 'invalid value for "virtual_account", the character length must be smaller than or equal to 50.'
305
+ end
306
+
307
+ if virtual_account.to_s.length < 1
308
+ fail ArgumentError, 'invalid value for "virtual_account", the character length must be greater than or equal to 1.'
309
+ end
310
+
311
+ @virtual_account = virtual_account
312
+ end
313
+
314
+ # Checks equality by comparing each attribute.
315
+ # @param [Object] Object to be compared
316
+ def ==(o)
317
+ return true if self.equal?(o)
318
+ self.class == o.class &&
319
+ amount == o.amount &&
320
+ callback_url == o.callback_url &&
321
+ generated_name == o.generated_name &&
322
+ generated_email == o.generated_email &&
323
+ generated_document == o.generated_document &&
324
+ expires_in == o.expires_in &&
325
+ client_reference == o.client_reference &&
326
+ virtual_account == o.virtual_account
327
+ end
328
+
329
+ # @see the `==` method
330
+ # @param [Object] Object to be compared
331
+ def eql?(o)
332
+ self == o
333
+ end
334
+
335
+ # Calculates hash code according to all attributes.
336
+ # @return [Integer] Hash code
337
+ def hash
338
+ [amount, callback_url, generated_name, generated_email, generated_document, expires_in, client_reference, virtual_account].hash
339
+ end
340
+
341
+ # Builds the object from hash
342
+ # @param [Hash] attributes Model attributes in the form of hash
343
+ # @return [Object] Returns the model itself
344
+ def self.build_from_hash(attributes)
345
+ return nil unless attributes.is_a?(Hash)
346
+ attributes = attributes.transform_keys(&:to_sym)
347
+ transformed_hash = {}
348
+ openapi_types.each_pair do |key, type|
349
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
350
+ transformed_hash["#{key}"] = nil
351
+ elsif type =~ /\AArray<(.*)>/i
352
+ # check to ensure the input is an array given that the attribute
353
+ # is documented as an array but the input is not
354
+ if attributes[attribute_map[key]].is_a?(Array)
355
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
356
+ end
357
+ elsif !attributes[attribute_map[key]].nil?
358
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
359
+ end
360
+ end
361
+ new(transformed_hash)
362
+ end
363
+
364
+ # Returns the object in the form of hash
365
+ # @return [Hash] Returns the object in the form of hash
366
+ def to_hash
367
+ hash = {}
368
+ self.class.attribute_map.each_pair do |attr, param|
369
+ value = self.send(attr)
370
+ if value.nil?
371
+ is_nullable = self.class.openapi_nullable.include?(attr)
372
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
373
+ end
374
+
375
+ hash[param] = _to_hash(value)
376
+ end
377
+ hash
378
+ end
379
+
380
+ end
381
+
382
+ end
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #PayZu Pix API
3
+
4
+ #REST API for Pix operations on the PayZu platform, deposits, withdrawals, internal transfers, infractions, reports, and callback inspection. All amounts are in BRL (reais) unless explicitly noted. Authentication uses a Bearer token issued during onboarding. ## SDKs oficiais - Node.js: `npm install payzu-pix` - Python: `pip install payzu-pix` - PHP: `composer require payzu/pix` - Ruby: `gem install payzu-pix` - Java: `br.com.payzu:payzu-pix` (Maven Central) - Go: `go get github.com/PayZuAI/payzu-sdks/go/v2` Repo: https://github.com/PayZuAI/payzu-sdks
5
+
6
+ The version of the OpenAPI document: 1.8.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PayZuPix
17
+ class PostUserReportRequest < ApiModelBase
18
+ # Start of the report period.
19
+ attr_accessor :date_from
20
+
21
+ # End of the report period.
22
+ attr_accessor :date_to
23
+
24
+ # Transaction statuses included in the file. Empty or omitted: all.
25
+ attr_accessor :status
26
+
27
+ # Transaction types included in the file. Empty or omitted: all.
28
+ attr_accessor :type
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'date_from' => :'dateFrom',
56
+ :'date_to' => :'dateTo',
57
+ :'status' => :'status',
58
+ :'type' => :'type'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'date_from' => :'Time',
76
+ :'date_to' => :'Time',
77
+ :'status' => :'Array<String>',
78
+ :'type' => :'Array<String>'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::PostUserReportRequest` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::PostUserReportRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'date_from')
105
+ self.date_from = attributes[:'date_from']
106
+ else
107
+ self.date_from = nil
108
+ end
109
+
110
+ if attributes.key?(:'date_to')
111
+ self.date_to = attributes[:'date_to']
112
+ else
113
+ self.date_to = nil
114
+ end
115
+
116
+ if attributes.key?(:'status')
117
+ if (value = attributes[:'status']).is_a?(Array)
118
+ self.status = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'type')
123
+ if (value = attributes[:'type']).is_a?(Array)
124
+ self.type = value
125
+ end
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @date_from.nil?
135
+ invalid_properties.push('invalid value for "date_from", date_from cannot be nil.')
136
+ end
137
+
138
+ if @date_to.nil?
139
+ invalid_properties.push('invalid value for "date_to", date_to cannot be nil.')
140
+ end
141
+
142
+ invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+ warn '[DEPRECATED] the `valid?` method is obsolete'
149
+ return false if @date_from.nil?
150
+ return false if @date_to.nil?
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] date_from Value to be assigned
156
+ def date_from=(date_from)
157
+ if date_from.nil?
158
+ fail ArgumentError, 'date_from cannot be nil'
159
+ end
160
+
161
+ @date_from = date_from
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] date_to Value to be assigned
166
+ def date_to=(date_to)
167
+ if date_to.nil?
168
+ fail ArgumentError, 'date_to cannot be nil'
169
+ end
170
+
171
+ @date_to = date_to
172
+ end
173
+
174
+ # Checks equality by comparing each attribute.
175
+ # @param [Object] Object to be compared
176
+ def ==(o)
177
+ return true if self.equal?(o)
178
+ self.class == o.class &&
179
+ date_from == o.date_from &&
180
+ date_to == o.date_to &&
181
+ status == o.status &&
182
+ type == o.type
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Integer] Hash code
193
+ def hash
194
+ [date_from, date_to, status, type].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def self.build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ attributes = attributes.transform_keys(&:to_sym)
203
+ transformed_hash = {}
204
+ openapi_types.each_pair do |key, type|
205
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = nil
207
+ elsif type =~ /\AArray<(.*)>/i
208
+ # check to ensure the input is an array given that the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[attribute_map[key]].is_a?(Array)
211
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
212
+ end
213
+ elsif !attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
215
+ end
216
+ end
217
+ new(transformed_hash)
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ end
237
+
238
+ end