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,968 @@
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 'cgi'
14
+
15
+ module PayZuPix
16
+ class ReportsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Download report
23
+ # Returns a short-lived signed URL to download the CSV file.
24
+ # @param id [String] Report ID.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [DownloadUserReport200Response]
27
+ def download_user_report(id, opts = {})
28
+ data, _status_code, _headers = download_user_report_with_http_info(id, opts)
29
+ data
30
+ end
31
+
32
+ # Download report
33
+ # Returns a short-lived signed URL to download the CSV file.
34
+ # @param id [String] Report ID.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(DownloadUserReport200Response, Integer, Hash)>] DownloadUserReport200Response data, response status code and response headers
37
+ def download_user_report_with_http_info(id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ReportsApi.download_user_report ...'
40
+ end
41
+ # verify the required parameter 'id' is set
42
+ if @api_client.config.client_side_validation && id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReportsApi.download_user_report"
44
+ end
45
+ # resource path
46
+ local_var_path = '/user/report/{id}/download'.sub('{id}', CGI.escape(id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'DownloadUserReport200Response'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"ReportsApi.download_user_report",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: ReportsApi#download_user_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Get bank statement
86
+ # Returns a single statement entry.
87
+ # @param id [String] Statement entry id.
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [BankStatement]
90
+ def get_user_bank_statement(id, opts = {})
91
+ data, _status_code, _headers = get_user_bank_statement_with_http_info(id, opts)
92
+ data
93
+ end
94
+
95
+ # Get bank statement
96
+ # Returns a single statement entry.
97
+ # @param id [String] Statement entry id.
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(BankStatement, Integer, Hash)>] BankStatement data, response status code and response headers
100
+ def get_user_bank_statement_with_http_info(id, opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_bank_statement ...'
103
+ end
104
+ # verify the required parameter 'id' is set
105
+ if @api_client.config.client_side_validation && id.nil?
106
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReportsApi.get_user_bank_statement"
107
+ end
108
+ # resource path
109
+ local_var_path = '/user/bank-statements/{id}'.sub('{id}', CGI.escape(id.to_s))
110
+
111
+ # query parameters
112
+ query_params = opts[:query_params] || {}
113
+
114
+ # header parameters
115
+ header_params = opts[:header_params] || {}
116
+ # HTTP header 'Accept' (if needed)
117
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
118
+
119
+ # form parameters
120
+ form_params = opts[:form_params] || {}
121
+
122
+ # http body (model)
123
+ post_body = opts[:debug_body]
124
+
125
+ # return_type
126
+ return_type = opts[:debug_return_type] || 'BankStatement'
127
+
128
+ # auth_names
129
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
130
+
131
+ new_options = opts.merge(
132
+ :operation => :"ReportsApi.get_user_bank_statement",
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => return_type
139
+ )
140
+
141
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_bank_statement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # List bank statements
149
+ # Lists the account statement entries. `createdAtFrom` and `createdAtTo` are required.
150
+ # @param created_at_from [Time] Start date (required).
151
+ # @param created_at_to [Time] End date (required).
152
+ # @param [Hash] opts the optional parameters
153
+ # @option opts [String] :id Entry ID.
154
+ # @option opts [String] :operation Operation type. &#x60;INCREMENT&#x60; &#x60;DECREMENT&#x60;
155
+ # @option opts [String] :reason Reason for the entry.
156
+ # @option opts [String] :transaction_id Transaction ID.
157
+ # @option opts [Float] :amount_from Minimum amount.
158
+ # @option opts [Float] :amount_to Maximum amount.
159
+ # @option opts [Integer] :page Page number. (default to 1)
160
+ # @option opts [Integer] :limit Items per page. (default to 10)
161
+ # @option opts [String] :sort_by Sort field. (default to 'createdAt')
162
+ # @option opts [String] :sort_direction Sort direction. (default to 'desc')
163
+ # @return [BankStatementListResponse]
164
+ def get_user_bank_statements(created_at_from, created_at_to, opts = {})
165
+ data, _status_code, _headers = get_user_bank_statements_with_http_info(created_at_from, created_at_to, opts)
166
+ data
167
+ end
168
+
169
+ # List bank statements
170
+ # Lists the account statement entries. &#x60;createdAtFrom&#x60; and &#x60;createdAtTo&#x60; are required.
171
+ # @param created_at_from [Time] Start date (required).
172
+ # @param created_at_to [Time] End date (required).
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [String] :id Entry ID.
175
+ # @option opts [String] :operation Operation type. &#x60;INCREMENT&#x60; &#x60;DECREMENT&#x60;
176
+ # @option opts [String] :reason Reason for the entry.
177
+ # @option opts [String] :transaction_id Transaction ID.
178
+ # @option opts [Float] :amount_from Minimum amount.
179
+ # @option opts [Float] :amount_to Maximum amount.
180
+ # @option opts [Integer] :page Page number. (default to 1)
181
+ # @option opts [Integer] :limit Items per page. (default to 10)
182
+ # @option opts [String] :sort_by Sort field. (default to 'createdAt')
183
+ # @option opts [String] :sort_direction Sort direction. (default to 'desc')
184
+ # @return [Array<(BankStatementListResponse, Integer, Hash)>] BankStatementListResponse data, response status code and response headers
185
+ def get_user_bank_statements_with_http_info(created_at_from, created_at_to, opts = {})
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_bank_statements ...'
188
+ end
189
+ # verify the required parameter 'created_at_from' is set
190
+ if @api_client.config.client_side_validation && created_at_from.nil?
191
+ fail ArgumentError, "Missing the required parameter 'created_at_from' when calling ReportsApi.get_user_bank_statements"
192
+ end
193
+ # verify the required parameter 'created_at_to' is set
194
+ if @api_client.config.client_side_validation && created_at_to.nil?
195
+ fail ArgumentError, "Missing the required parameter 'created_at_to' when calling ReportsApi.get_user_bank_statements"
196
+ end
197
+ allowable_values = ["INCREMENT", "DECREMENT"]
198
+ if @api_client.config.client_side_validation && opts[:'operation'] && !allowable_values.include?(opts[:'operation'])
199
+ fail ArgumentError, "invalid value for \"operation\", must be one of #{allowable_values}"
200
+ end
201
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
202
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ReportsApi.get_user_bank_statements, must be greater than or equal to 1.'
203
+ end
204
+
205
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
206
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.get_user_bank_statements, must be smaller than or equal to 100.'
207
+ end
208
+
209
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
210
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.get_user_bank_statements, must be greater than or equal to 1.'
211
+ end
212
+
213
+ allowable_values = ["createdAt", "amount"]
214
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
215
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
216
+ end
217
+ allowable_values = ["asc", "desc"]
218
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
219
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
220
+ end
221
+ # resource path
222
+ local_var_path = '/user/bank-statements'
223
+
224
+ # query parameters
225
+ query_params = opts[:query_params] || {}
226
+ query_params[:'createdAtFrom'] = created_at_from
227
+ query_params[:'createdAtTo'] = created_at_to
228
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
229
+ query_params[:'operation'] = opts[:'operation'] if !opts[:'operation'].nil?
230
+ query_params[:'reason'] = opts[:'reason'] if !opts[:'reason'].nil?
231
+ query_params[:'transactionId'] = opts[:'transaction_id'] if !opts[:'transaction_id'].nil?
232
+ query_params[:'amountFrom'] = opts[:'amount_from'] if !opts[:'amount_from'].nil?
233
+ query_params[:'amountTo'] = opts[:'amount_to'] if !opts[:'amount_to'].nil?
234
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
235
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
236
+ query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
237
+ query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
238
+
239
+ # header parameters
240
+ header_params = opts[:header_params] || {}
241
+ # HTTP header 'Accept' (if needed)
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
243
+
244
+ # form parameters
245
+ form_params = opts[:form_params] || {}
246
+
247
+ # http body (model)
248
+ post_body = opts[:debug_body]
249
+
250
+ # return_type
251
+ return_type = opts[:debug_return_type] || 'BankStatementListResponse'
252
+
253
+ # auth_names
254
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
255
+
256
+ new_options = opts.merge(
257
+ :operation => :"ReportsApi.get_user_bank_statements",
258
+ :header_params => header_params,
259
+ :query_params => query_params,
260
+ :form_params => form_params,
261
+ :body => post_body,
262
+ :auth_names => auth_names,
263
+ :return_type => return_type
264
+ )
265
+
266
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_bank_statements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
269
+ end
270
+ return data, status_code, headers
271
+ end
272
+
273
+ # List pending deposits
274
+ # Lists deposits that are pending / not yet reconciled.
275
+ # @param [Hash] opts the optional parameters
276
+ # @option opts [String] :status Comma-separated statuses: PENDING, APPROVED, REJECTED, EXPIRED, COMPLETED.
277
+ # @option opts [String] :document CPF or CNPJ, digits only.
278
+ # @option opts [String] :name Name of the payer or receiver.
279
+ # @option opts [String] :end_to_end_id End-to-end ID of the Pix.
280
+ # @option opts [Float] :amount_min Minimum amount.
281
+ # @option opts [Float] :amount_max Maximum amount.
282
+ # @option opts [Time] :created_at_from Start of the creation date range.
283
+ # @option opts [Time] :created_at_to End of the creation date range.
284
+ # @option opts [Integer] :page Page number. (default to 1)
285
+ # @option opts [Integer] :limit Items per page. (default to 20)
286
+ # @return [DepositPendingListResponse]
287
+ def get_user_deposit_pending(opts = {})
288
+ data, _status_code, _headers = get_user_deposit_pending_with_http_info(opts)
289
+ data
290
+ end
291
+
292
+ # List pending deposits
293
+ # Lists deposits that are pending / not yet reconciled.
294
+ # @param [Hash] opts the optional parameters
295
+ # @option opts [String] :status Comma-separated statuses: PENDING, APPROVED, REJECTED, EXPIRED, COMPLETED.
296
+ # @option opts [String] :document CPF or CNPJ, digits only.
297
+ # @option opts [String] :name Name of the payer or receiver.
298
+ # @option opts [String] :end_to_end_id End-to-end ID of the Pix.
299
+ # @option opts [Float] :amount_min Minimum amount.
300
+ # @option opts [Float] :amount_max Maximum amount.
301
+ # @option opts [Time] :created_at_from Start of the creation date range.
302
+ # @option opts [Time] :created_at_to End of the creation date range.
303
+ # @option opts [Integer] :page Page number. (default to 1)
304
+ # @option opts [Integer] :limit Items per page. (default to 20)
305
+ # @return [Array<(DepositPendingListResponse, Integer, Hash)>] DepositPendingListResponse data, response status code and response headers
306
+ def get_user_deposit_pending_with_http_info(opts = {})
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_deposit_pending ...'
309
+ end
310
+ pattern = Regexp.new(/^[0-9]{11,14}$/)
311
+ if @api_client.config.client_side_validation && !opts[:'document'].nil? && opts[:'document'] !~ pattern
312
+ fail ArgumentError, "invalid value for 'opts[:\"document\"]' when calling ReportsApi.get_user_deposit_pending, must conform to the pattern #{pattern}."
313
+ end
314
+
315
+ if @api_client.config.client_side_validation && !opts[:'amount_min'].nil? && opts[:'amount_min'] < 0.01
316
+ fail ArgumentError, 'invalid value for "opts[:"amount_min"]" when calling ReportsApi.get_user_deposit_pending, must be greater than or equal to 0.01.'
317
+ end
318
+
319
+ if @api_client.config.client_side_validation && !opts[:'amount_max'].nil? && opts[:'amount_max'] < 0.01
320
+ fail ArgumentError, 'invalid value for "opts[:"amount_max"]" when calling ReportsApi.get_user_deposit_pending, must be greater than or equal to 0.01.'
321
+ end
322
+
323
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
324
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ReportsApi.get_user_deposit_pending, must be greater than or equal to 1.'
325
+ end
326
+
327
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
328
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.get_user_deposit_pending, must be smaller than or equal to 100.'
329
+ end
330
+
331
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
332
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.get_user_deposit_pending, must be greater than or equal to 1.'
333
+ end
334
+
335
+ # resource path
336
+ local_var_path = '/user/deposit-pending'
337
+
338
+ # query parameters
339
+ query_params = opts[:query_params] || {}
340
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
341
+ query_params[:'document'] = opts[:'document'] if !opts[:'document'].nil?
342
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
343
+ query_params[:'endToEndId'] = opts[:'end_to_end_id'] if !opts[:'end_to_end_id'].nil?
344
+ query_params[:'amountMin'] = opts[:'amount_min'] if !opts[:'amount_min'].nil?
345
+ query_params[:'amountMax'] = opts[:'amount_max'] if !opts[:'amount_max'].nil?
346
+ query_params[:'createdAtFrom'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?
347
+ query_params[:'createdAtTo'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?
348
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
349
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
350
+
351
+ # header parameters
352
+ header_params = opts[:header_params] || {}
353
+ # HTTP header 'Accept' (if needed)
354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
355
+
356
+ # form parameters
357
+ form_params = opts[:form_params] || {}
358
+
359
+ # http body (model)
360
+ post_body = opts[:debug_body]
361
+
362
+ # return_type
363
+ return_type = opts[:debug_return_type] || 'DepositPendingListResponse'
364
+
365
+ # auth_names
366
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
367
+
368
+ new_options = opts.merge(
369
+ :operation => :"ReportsApi.get_user_deposit_pending",
370
+ :header_params => header_params,
371
+ :query_params => query_params,
372
+ :form_params => form_params,
373
+ :body => post_body,
374
+ :auth_names => auth_names,
375
+ :return_type => return_type
376
+ )
377
+
378
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
379
+ if @api_client.config.debugging
380
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_deposit_pending\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
381
+ end
382
+ return data, status_code, headers
383
+ end
384
+
385
+ # Get pending deposit
386
+ # Returns a single pending deposit.
387
+ # @param id [String] Pending deposit id.
388
+ # @param [Hash] opts the optional parameters
389
+ # @return [DepositPending]
390
+ def get_user_deposit_pending_by_id(id, opts = {})
391
+ data, _status_code, _headers = get_user_deposit_pending_by_id_with_http_info(id, opts)
392
+ data
393
+ end
394
+
395
+ # Get pending deposit
396
+ # Returns a single pending deposit.
397
+ # @param id [String] Pending deposit id.
398
+ # @param [Hash] opts the optional parameters
399
+ # @return [Array<(DepositPending, Integer, Hash)>] DepositPending data, response status code and response headers
400
+ def get_user_deposit_pending_by_id_with_http_info(id, opts = {})
401
+ if @api_client.config.debugging
402
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_deposit_pending_by_id ...'
403
+ end
404
+ # verify the required parameter 'id' is set
405
+ if @api_client.config.client_side_validation && id.nil?
406
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReportsApi.get_user_deposit_pending_by_id"
407
+ end
408
+ # resource path
409
+ local_var_path = '/user/deposit-pending/{id}'.sub('{id}', CGI.escape(id.to_s))
410
+
411
+ # query parameters
412
+ query_params = opts[:query_params] || {}
413
+
414
+ # header parameters
415
+ header_params = opts[:header_params] || {}
416
+ # HTTP header 'Accept' (if needed)
417
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
418
+
419
+ # form parameters
420
+ form_params = opts[:form_params] || {}
421
+
422
+ # http body (model)
423
+ post_body = opts[:debug_body]
424
+
425
+ # return_type
426
+ return_type = opts[:debug_return_type] || 'DepositPending'
427
+
428
+ # auth_names
429
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
430
+
431
+ new_options = opts.merge(
432
+ :operation => :"ReportsApi.get_user_deposit_pending_by_id",
433
+ :header_params => header_params,
434
+ :query_params => query_params,
435
+ :form_params => form_params,
436
+ :body => post_body,
437
+ :auth_names => auth_names,
438
+ :return_type => return_type
439
+ )
440
+
441
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
442
+ if @api_client.config.debugging
443
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_deposit_pending_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
444
+ end
445
+ return data, status_code, headers
446
+ end
447
+
448
+ # Get report job status
449
+ # Returns the status and metadata of a specific report job by `id`.
450
+ # @param id [String] Report ID.
451
+ # @param [Hash] opts the optional parameters
452
+ # @return [ReportJobDetail]
453
+ def get_user_report(id, opts = {})
454
+ data, _status_code, _headers = get_user_report_with_http_info(id, opts)
455
+ data
456
+ end
457
+
458
+ # Get report job status
459
+ # Returns the status and metadata of a specific report job by &#x60;id&#x60;.
460
+ # @param id [String] Report ID.
461
+ # @param [Hash] opts the optional parameters
462
+ # @return [Array<(ReportJobDetail, Integer, Hash)>] ReportJobDetail data, response status code and response headers
463
+ def get_user_report_with_http_info(id, opts = {})
464
+ if @api_client.config.debugging
465
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_report ...'
466
+ end
467
+ # verify the required parameter 'id' is set
468
+ if @api_client.config.client_side_validation && id.nil?
469
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReportsApi.get_user_report"
470
+ end
471
+ # resource path
472
+ local_var_path = '/user/report/{id}'.sub('{id}', CGI.escape(id.to_s))
473
+
474
+ # query parameters
475
+ query_params = opts[:query_params] || {}
476
+
477
+ # header parameters
478
+ header_params = opts[:header_params] || {}
479
+ # HTTP header 'Accept' (if needed)
480
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
481
+
482
+ # form parameters
483
+ form_params = opts[:form_params] || {}
484
+
485
+ # http body (model)
486
+ post_body = opts[:debug_body]
487
+
488
+ # return_type
489
+ return_type = opts[:debug_return_type] || 'ReportJobDetail'
490
+
491
+ # auth_names
492
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
493
+
494
+ new_options = opts.merge(
495
+ :operation => :"ReportsApi.get_user_report",
496
+ :header_params => header_params,
497
+ :query_params => query_params,
498
+ :form_params => form_params,
499
+ :body => post_body,
500
+ :auth_names => auth_names,
501
+ :return_type => return_type
502
+ )
503
+
504
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
505
+ if @api_client.config.debugging
506
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
507
+ end
508
+ return data, status_code, headers
509
+ end
510
+
511
+ # Transaction summary
512
+ # Aggregated totals for deposits, withdrawals and commission over a period.
513
+ # @param [Hash] opts the optional parameters
514
+ # @option opts [Time] :date_from Start date. Default: start of the previous day (America/Sao_Paulo).
515
+ # @option opts [Time] :date_to End date. Default: now.
516
+ # @option opts [String] :group_by Grouping applied to the transactions. (default to 'day')
517
+ # @option opts [Boolean] :grouped When true, returns a series grouped by date.
518
+ # @return [Summary]
519
+ def get_user_summary(opts = {})
520
+ data, _status_code, _headers = get_user_summary_with_http_info(opts)
521
+ data
522
+ end
523
+
524
+ # Transaction summary
525
+ # Aggregated totals for deposits, withdrawals and commission over a period.
526
+ # @param [Hash] opts the optional parameters
527
+ # @option opts [Time] :date_from Start date. Default: start of the previous day (America/Sao_Paulo).
528
+ # @option opts [Time] :date_to End date. Default: now.
529
+ # @option opts [String] :group_by Grouping applied to the transactions. (default to 'day')
530
+ # @option opts [Boolean] :grouped When true, returns a series grouped by date.
531
+ # @return [Array<(Summary, Integer, Hash)>] Summary data, response status code and response headers
532
+ def get_user_summary_with_http_info(opts = {})
533
+ if @api_client.config.debugging
534
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_summary ...'
535
+ end
536
+ allowable_values = ["day"]
537
+ if @api_client.config.client_side_validation && opts[:'group_by'] && !allowable_values.include?(opts[:'group_by'])
538
+ fail ArgumentError, "invalid value for \"group_by\", must be one of #{allowable_values}"
539
+ end
540
+ # resource path
541
+ local_var_path = '/user/summary'
542
+
543
+ # query parameters
544
+ query_params = opts[:query_params] || {}
545
+ query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
546
+ query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
547
+ query_params[:'groupBy'] = opts[:'group_by'] if !opts[:'group_by'].nil?
548
+ query_params[:'grouped'] = opts[:'grouped'] if !opts[:'grouped'].nil?
549
+
550
+ # header parameters
551
+ header_params = opts[:header_params] || {}
552
+ # HTTP header 'Accept' (if needed)
553
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
554
+
555
+ # form parameters
556
+ form_params = opts[:form_params] || {}
557
+
558
+ # http body (model)
559
+ post_body = opts[:debug_body]
560
+
561
+ # return_type
562
+ return_type = opts[:debug_return_type] || 'Summary'
563
+
564
+ # auth_names
565
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
566
+
567
+ new_options = opts.merge(
568
+ :operation => :"ReportsApi.get_user_summary",
569
+ :header_params => header_params,
570
+ :query_params => query_params,
571
+ :form_params => form_params,
572
+ :body => post_body,
573
+ :auth_names => auth_names,
574
+ :return_type => return_type
575
+ )
576
+
577
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
578
+ if @api_client.config.debugging
579
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
580
+ end
581
+ return data, status_code, headers
582
+ end
583
+
584
+ # List transaction details
585
+ # Retrieve a single transaction with its callback log and linked infractions.
586
+ # @param id [String] Transaction ID.
587
+ # @param [Hash] opts the optional parameters
588
+ # @return [GetUserTransactionById200Response]
589
+ def get_user_transaction_by_id(id, opts = {})
590
+ data, _status_code, _headers = get_user_transaction_by_id_with_http_info(id, opts)
591
+ data
592
+ end
593
+
594
+ # List transaction details
595
+ # Retrieve a single transaction with its callback log and linked infractions.
596
+ # @param id [String] Transaction ID.
597
+ # @param [Hash] opts the optional parameters
598
+ # @return [Array<(GetUserTransactionById200Response, Integer, Hash)>] GetUserTransactionById200Response data, response status code and response headers
599
+ def get_user_transaction_by_id_with_http_info(id, opts = {})
600
+ if @api_client.config.debugging
601
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_transaction_by_id ...'
602
+ end
603
+ # verify the required parameter 'id' is set
604
+ if @api_client.config.client_side_validation && id.nil?
605
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReportsApi.get_user_transaction_by_id"
606
+ end
607
+ # resource path
608
+ local_var_path = '/user/transactions/{id}'.sub('{id}', CGI.escape(id.to_s))
609
+
610
+ # query parameters
611
+ query_params = opts[:query_params] || {}
612
+
613
+ # header parameters
614
+ header_params = opts[:header_params] || {}
615
+ # HTTP header 'Accept' (if needed)
616
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
617
+
618
+ # form parameters
619
+ form_params = opts[:form_params] || {}
620
+
621
+ # http body (model)
622
+ post_body = opts[:debug_body]
623
+
624
+ # return_type
625
+ return_type = opts[:debug_return_type] || 'GetUserTransactionById200Response'
626
+
627
+ # auth_names
628
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
629
+
630
+ new_options = opts.merge(
631
+ :operation => :"ReportsApi.get_user_transaction_by_id",
632
+ :header_params => header_params,
633
+ :query_params => query_params,
634
+ :form_params => form_params,
635
+ :body => post_body,
636
+ :auth_names => auth_names,
637
+ :return_type => return_type
638
+ )
639
+
640
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
641
+ if @api_client.config.debugging
642
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
643
+ end
644
+ return data, status_code, headers
645
+ end
646
+
647
+ # List Transactions
648
+ # Paginated list of account transactions with filters.
649
+ # @param [Hash] opts the optional parameters
650
+ # @option opts [Time] :date_from Start date or date-time (ISO 8601).
651
+ # @option opts [Time] :date_to End date or date-time (ISO 8601). A date without time means 00:00 UTC of that day.
652
+ # @option opts [Integer] :limit Items per page (max 1000). (default to 10)
653
+ # @option opts [Integer] :page Page number (default 1). (default to 1)
654
+ # @option opts [String] :id Transaction ID.
655
+ # @option opts [String] :status Transaction status. Accepts CSV: PENDING,COMPLETED,etc.
656
+ # @option opts [String] :type Transaction type. Accepts CSV: DEPOSIT,WITHDRAW,COMMISSION,LIQUIDATION,ADJUSTMENT.
657
+ # @option opts [String] :method Transaction method/rail. Accepts CSV: PIX,INTERNAL_TRANSFER.
658
+ # @option opts [Float] :amount Amount filter. Minimum 0.01.
659
+ # @option opts [String] :document CPF (11 digits) or CNPJ (14 digits), digits only, no punctuation.
660
+ # @option opts [String] :name Name filter.
661
+ # @option opts [String] :end_to_end_id Pix end-to-end ID.
662
+ # @option opts [String] :sort_by Field to sort by (default to 'createdAt')
663
+ # @option opts [String] :sort_direction Sort direction (default to 'desc')
664
+ # @option opts [String] :client_reference Filter by external reference
665
+ # @option opts [String] :virtual_account Virtual sub-account (up to 50 characters) used at creation. Accepted as an alternative lookup key.
666
+ # @option opts [Boolean] :has_qr_code Only transactions with (true) or without (false) QR Code.
667
+ # @return [GetUserTransactions200Response]
668
+ def get_user_transactions(opts = {})
669
+ data, _status_code, _headers = get_user_transactions_with_http_info(opts)
670
+ data
671
+ end
672
+
673
+ # List Transactions
674
+ # Paginated list of account transactions with filters.
675
+ # @param [Hash] opts the optional parameters
676
+ # @option opts [Time] :date_from Start date or date-time (ISO 8601).
677
+ # @option opts [Time] :date_to End date or date-time (ISO 8601). A date without time means 00:00 UTC of that day.
678
+ # @option opts [Integer] :limit Items per page (max 1000). (default to 10)
679
+ # @option opts [Integer] :page Page number (default 1). (default to 1)
680
+ # @option opts [String] :id Transaction ID.
681
+ # @option opts [String] :status Transaction status. Accepts CSV: PENDING,COMPLETED,etc.
682
+ # @option opts [String] :type Transaction type. Accepts CSV: DEPOSIT,WITHDRAW,COMMISSION,LIQUIDATION,ADJUSTMENT.
683
+ # @option opts [String] :method Transaction method/rail. Accepts CSV: PIX,INTERNAL_TRANSFER.
684
+ # @option opts [Float] :amount Amount filter. Minimum 0.01.
685
+ # @option opts [String] :document CPF (11 digits) or CNPJ (14 digits), digits only, no punctuation.
686
+ # @option opts [String] :name Name filter.
687
+ # @option opts [String] :end_to_end_id Pix end-to-end ID.
688
+ # @option opts [String] :sort_by Field to sort by (default to 'createdAt')
689
+ # @option opts [String] :sort_direction Sort direction (default to 'desc')
690
+ # @option opts [String] :client_reference Filter by external reference
691
+ # @option opts [String] :virtual_account Virtual sub-account (up to 50 characters) used at creation. Accepted as an alternative lookup key.
692
+ # @option opts [Boolean] :has_qr_code Only transactions with (true) or without (false) QR Code.
693
+ # @return [Array<(GetUserTransactions200Response, Integer, Hash)>] GetUserTransactions200Response data, response status code and response headers
694
+ def get_user_transactions_with_http_info(opts = {})
695
+ if @api_client.config.debugging
696
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_user_transactions ...'
697
+ end
698
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
699
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.get_user_transactions, must be smaller than or equal to 1000.'
700
+ end
701
+
702
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
703
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.get_user_transactions, must be greater than or equal to 1.'
704
+ end
705
+
706
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 100000
707
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ReportsApi.get_user_transactions, must be smaller than or equal to 100000.'
708
+ end
709
+
710
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
711
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ReportsApi.get_user_transactions, must be greater than or equal to 1.'
712
+ end
713
+
714
+ if @api_client.config.client_side_validation && !opts[:'amount'].nil? && opts[:'amount'] < 0.01
715
+ fail ArgumentError, 'invalid value for "opts[:"amount"]" when calling ReportsApi.get_user_transactions, must be greater than or equal to 0.01.'
716
+ end
717
+
718
+ pattern = Regexp.new(/^[0-9]{11,14}$/)
719
+ if @api_client.config.client_side_validation && !opts[:'document'].nil? && opts[:'document'] !~ pattern
720
+ fail ArgumentError, "invalid value for 'opts[:\"document\"]' when calling ReportsApi.get_user_transactions, must conform to the pattern #{pattern}."
721
+ end
722
+
723
+ allowable_values = ["createdAt", "updatedAt"]
724
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
725
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
726
+ end
727
+ allowable_values = ["asc", "desc"]
728
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
729
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
730
+ end
731
+ if @api_client.config.client_side_validation && !opts[:'client_reference'].nil? && opts[:'client_reference'].to_s.length > 64
732
+ fail ArgumentError, 'invalid value for "opts[:"client_reference"]" when calling ReportsApi.get_user_transactions, the character length must be smaller than or equal to 64.'
733
+ end
734
+
735
+ if @api_client.config.client_side_validation && !opts[:'virtual_account'].nil? && opts[:'virtual_account'].to_s.length > 50
736
+ fail ArgumentError, 'invalid value for "opts[:"virtual_account"]" when calling ReportsApi.get_user_transactions, the character length must be smaller than or equal to 50.'
737
+ end
738
+
739
+ # resource path
740
+ local_var_path = '/user/transactions'
741
+
742
+ # query parameters
743
+ query_params = opts[:query_params] || {}
744
+ query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
745
+ query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
746
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
747
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
748
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
749
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
750
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
751
+ query_params[:'method'] = opts[:'method'] if !opts[:'method'].nil?
752
+ query_params[:'amount'] = opts[:'amount'] if !opts[:'amount'].nil?
753
+ query_params[:'document'] = opts[:'document'] if !opts[:'document'].nil?
754
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
755
+ query_params[:'endToEndId'] = opts[:'end_to_end_id'] if !opts[:'end_to_end_id'].nil?
756
+ query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
757
+ query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
758
+ query_params[:'clientReference'] = opts[:'client_reference'] if !opts[:'client_reference'].nil?
759
+ query_params[:'virtualAccount'] = opts[:'virtual_account'] if !opts[:'virtual_account'].nil?
760
+ query_params[:'hasQrCode'] = opts[:'has_qr_code'] if !opts[:'has_qr_code'].nil?
761
+
762
+ # header parameters
763
+ header_params = opts[:header_params] || {}
764
+ # HTTP header 'Accept' (if needed)
765
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
766
+
767
+ # form parameters
768
+ form_params = opts[:form_params] || {}
769
+
770
+ # http body (model)
771
+ post_body = opts[:debug_body]
772
+
773
+ # return_type
774
+ return_type = opts[:debug_return_type] || 'GetUserTransactions200Response'
775
+
776
+ # auth_names
777
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
778
+
779
+ new_options = opts.merge(
780
+ :operation => :"ReportsApi.get_user_transactions",
781
+ :header_params => header_params,
782
+ :query_params => query_params,
783
+ :form_params => form_params,
784
+ :body => post_body,
785
+ :auth_names => auth_names,
786
+ :return_type => return_type
787
+ )
788
+
789
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
790
+ if @api_client.config.debugging
791
+ @api_client.config.logger.debug "API called: ReportsApi#get_user_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
792
+ end
793
+ return data, status_code, headers
794
+ end
795
+
796
+ # List report jobs
797
+ # List report jobs created by the authenticated user.
798
+ # @param [Hash] opts the optional parameters
799
+ # @option opts [Integer] :page Page number. (default to 1)
800
+ # @option opts [Integer] :limit Items per page. (default to 10)
801
+ # @option opts [String] :status Report status. Accepts CSV: PENDING,RUNNING,COMPLETED,FAILED.
802
+ # @option opts [Time] :created_at_from Filter: created from.
803
+ # @option opts [Time] :created_at_to Filter: created up to.
804
+ # @option opts [Time] :updated_at_from Filter: updated from.
805
+ # @option opts [Time] :updated_at_to Filter: updated up to.
806
+ # @option opts [String] :sort_by Sort field. (default to 'createdAt')
807
+ # @option opts [String] :sort_direction Sort direction. (default to 'desc')
808
+ # @return [ListUserReports200Response]
809
+ def list_user_reports(opts = {})
810
+ data, _status_code, _headers = list_user_reports_with_http_info(opts)
811
+ data
812
+ end
813
+
814
+ # List report jobs
815
+ # List report jobs created by the authenticated user.
816
+ # @param [Hash] opts the optional parameters
817
+ # @option opts [Integer] :page Page number. (default to 1)
818
+ # @option opts [Integer] :limit Items per page. (default to 10)
819
+ # @option opts [String] :status Report status. Accepts CSV: PENDING,RUNNING,COMPLETED,FAILED.
820
+ # @option opts [Time] :created_at_from Filter: created from.
821
+ # @option opts [Time] :created_at_to Filter: created up to.
822
+ # @option opts [Time] :updated_at_from Filter: updated from.
823
+ # @option opts [Time] :updated_at_to Filter: updated up to.
824
+ # @option opts [String] :sort_by Sort field. (default to 'createdAt')
825
+ # @option opts [String] :sort_direction Sort direction. (default to 'desc')
826
+ # @return [Array<(ListUserReports200Response, Integer, Hash)>] ListUserReports200Response data, response status code and response headers
827
+ def list_user_reports_with_http_info(opts = {})
828
+ if @api_client.config.debugging
829
+ @api_client.config.logger.debug 'Calling API: ReportsApi.list_user_reports ...'
830
+ end
831
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
832
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ReportsApi.list_user_reports, must be greater than or equal to 1.'
833
+ end
834
+
835
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
836
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.list_user_reports, must be smaller than or equal to 100.'
837
+ end
838
+
839
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
840
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReportsApi.list_user_reports, must be greater than or equal to 1.'
841
+ end
842
+
843
+ allowable_values = ["createdAt", "updatedAt"]
844
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
845
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
846
+ end
847
+ allowable_values = ["asc", "desc"]
848
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
849
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
850
+ end
851
+ # resource path
852
+ local_var_path = '/user/report'
853
+
854
+ # query parameters
855
+ query_params = opts[:query_params] || {}
856
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
857
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
858
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
859
+ query_params[:'createdAtFrom'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?
860
+ query_params[:'createdAtTo'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?
861
+ query_params[:'updatedAtFrom'] = opts[:'updated_at_from'] if !opts[:'updated_at_from'].nil?
862
+ query_params[:'updatedAtTo'] = opts[:'updated_at_to'] if !opts[:'updated_at_to'].nil?
863
+ query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
864
+ query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
865
+
866
+ # header parameters
867
+ header_params = opts[:header_params] || {}
868
+ # HTTP header 'Accept' (if needed)
869
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
870
+
871
+ # form parameters
872
+ form_params = opts[:form_params] || {}
873
+
874
+ # http body (model)
875
+ post_body = opts[:debug_body]
876
+
877
+ # return_type
878
+ return_type = opts[:debug_return_type] || 'ListUserReports200Response'
879
+
880
+ # auth_names
881
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
882
+
883
+ new_options = opts.merge(
884
+ :operation => :"ReportsApi.list_user_reports",
885
+ :header_params => header_params,
886
+ :query_params => query_params,
887
+ :form_params => form_params,
888
+ :body => post_body,
889
+ :auth_names => auth_names,
890
+ :return_type => return_type
891
+ )
892
+
893
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
894
+ if @api_client.config.debugging
895
+ @api_client.config.logger.debug "API called: ReportsApi#list_user_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
896
+ end
897
+ return data, status_code, headers
898
+ end
899
+
900
+ # Generate transactions report
901
+ # Queue an asynchronous job that generates a CSV report of transactions for the given period and filters.
902
+ # @param post_user_report_request [PostUserReportRequest]
903
+ # @param [Hash] opts the optional parameters
904
+ # @return [ReportJobAccepted]
905
+ def post_user_report(post_user_report_request, opts = {})
906
+ data, _status_code, _headers = post_user_report_with_http_info(post_user_report_request, opts)
907
+ data
908
+ end
909
+
910
+ # Generate transactions report
911
+ # Queue an asynchronous job that generates a CSV report of transactions for the given period and filters.
912
+ # @param post_user_report_request [PostUserReportRequest]
913
+ # @param [Hash] opts the optional parameters
914
+ # @return [Array<(ReportJobAccepted, Integer, Hash)>] ReportJobAccepted data, response status code and response headers
915
+ def post_user_report_with_http_info(post_user_report_request, opts = {})
916
+ if @api_client.config.debugging
917
+ @api_client.config.logger.debug 'Calling API: ReportsApi.post_user_report ...'
918
+ end
919
+ # verify the required parameter 'post_user_report_request' is set
920
+ if @api_client.config.client_side_validation && post_user_report_request.nil?
921
+ fail ArgumentError, "Missing the required parameter 'post_user_report_request' when calling ReportsApi.post_user_report"
922
+ end
923
+ # resource path
924
+ local_var_path = '/user/report'
925
+
926
+ # query parameters
927
+ query_params = opts[:query_params] || {}
928
+
929
+ # header parameters
930
+ header_params = opts[:header_params] || {}
931
+ # HTTP header 'Accept' (if needed)
932
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
933
+ # HTTP header 'Content-Type'
934
+ content_type = @api_client.select_header_content_type(['application/json'])
935
+ if !content_type.nil?
936
+ header_params['Content-Type'] = content_type
937
+ end
938
+
939
+ # form parameters
940
+ form_params = opts[:form_params] || {}
941
+
942
+ # http body (model)
943
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_user_report_request)
944
+
945
+ # return_type
946
+ return_type = opts[:debug_return_type] || 'ReportJobAccepted'
947
+
948
+ # auth_names
949
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
950
+
951
+ new_options = opts.merge(
952
+ :operation => :"ReportsApi.post_user_report",
953
+ :header_params => header_params,
954
+ :query_params => query_params,
955
+ :form_params => form_params,
956
+ :body => post_body,
957
+ :auth_names => auth_names,
958
+ :return_type => return_type
959
+ )
960
+
961
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
962
+ if @api_client.config.debugging
963
+ @api_client.config.logger.debug "API called: ReportsApi#post_user_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
964
+ end
965
+ return data, status_code, headers
966
+ end
967
+ end
968
+ end