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,577 @@
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 CallbacksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create callback secret
23
+ # Creates the account callback secret, used to sign deliveries sent to the transaction callbackUrl. The secret is returned once and cannot be read again.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [CallbackSecretResponse]
26
+ def create_user_callback_secret(opts = {})
27
+ data, _status_code, _headers = create_user_callback_secret_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Create callback secret
32
+ # Creates the account callback secret, used to sign deliveries sent to the transaction callbackUrl. The secret is returned once and cannot be read again.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(CallbackSecretResponse, Integer, Hash)>] CallbackSecretResponse data, response status code and response headers
35
+ def create_user_callback_secret_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.create_user_callback_secret ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/user/callbacks/secret'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'CallbackSecretResponse'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"CallbacksApi.create_user_callback_secret",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: CallbacksApi#create_user_callback_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Get Callback
80
+ # Returns the details of a specific callback log.
81
+ # @param id [String] Unique callback ID
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [CallbackDetail]
84
+ def get_user_callback_by_id(id, opts = {})
85
+ data, _status_code, _headers = get_user_callback_by_id_with_http_info(id, opts)
86
+ data
87
+ end
88
+
89
+ # Get Callback
90
+ # Returns the details of a specific callback log.
91
+ # @param id [String] Unique callback ID
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(CallbackDetail, Integer, Hash)>] CallbackDetail data, response status code and response headers
94
+ def get_user_callback_by_id_with_http_info(id, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.get_user_callback_by_id ...'
97
+ end
98
+ # verify the required parameter 'id' is set
99
+ if @api_client.config.client_side_validation && id.nil?
100
+ fail ArgumentError, "Missing the required parameter 'id' when calling CallbacksApi.get_user_callback_by_id"
101
+ end
102
+ # resource path
103
+ local_var_path = '/user/callbacks/{id}'.sub('{id}', CGI.escape(id.to_s))
104
+
105
+ # query parameters
106
+ query_params = opts[:query_params] || {}
107
+
108
+ # header parameters
109
+ header_params = opts[:header_params] || {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
112
+
113
+ # form parameters
114
+ form_params = opts[:form_params] || {}
115
+
116
+ # http body (model)
117
+ post_body = opts[:debug_body]
118
+
119
+ # return_type
120
+ return_type = opts[:debug_return_type] || 'CallbackDetail'
121
+
122
+ # auth_names
123
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
124
+
125
+ new_options = opts.merge(
126
+ :operation => :"CallbacksApi.get_user_callback_by_id",
127
+ :header_params => header_params,
128
+ :query_params => query_params,
129
+ :form_params => form_params,
130
+ :body => post_body,
131
+ :auth_names => auth_names,
132
+ :return_type => return_type
133
+ )
134
+
135
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug "API called: CallbacksApi#get_user_callback_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
138
+ end
139
+ return data, status_code, headers
140
+ end
141
+
142
+ # List Callbacks
143
+ # Returns a paginated list of webhook callback logs for the user's transactions.
144
+ # @param [Hash] opts the optional parameters
145
+ # @option opts [Integer] :page Page number. (default to 1)
146
+ # @option opts [Integer] :limit Items per page. (default to 10)
147
+ # @option opts [String] :sort_by Sort field. (default to 'createdAt')
148
+ # @option opts [String] :sort_direction Sort direction. (default to 'desc')
149
+ # @option opts [String] :id Filter by callback ID
150
+ # @option opts [String] :url Filter by callback URL
151
+ # @option opts [Integer] :status HTTP status code
152
+ # @option opts [String] :transaction_id Transaction ID.
153
+ # @option opts [Boolean] :has_error Filter callbacks that errored
154
+ # @option opts [Time] :created_at_from Start of the creation date range.
155
+ # @option opts [Time] :created_at_to End of the creation date range.
156
+ # @option opts [String] :webhook_id Webhook id.
157
+ # @option opts [WebhookEventType] :event_type Webhook event type.
158
+ # @return [CallbackListResponse]
159
+ def get_user_callbacks(opts = {})
160
+ data, _status_code, _headers = get_user_callbacks_with_http_info(opts)
161
+ data
162
+ end
163
+
164
+ # List Callbacks
165
+ # Returns a paginated list of webhook callback logs for the user&#39;s transactions.
166
+ # @param [Hash] opts the optional parameters
167
+ # @option opts [Integer] :page Page number. (default to 1)
168
+ # @option opts [Integer] :limit Items per page. (default to 10)
169
+ # @option opts [String] :sort_by Sort field. (default to 'createdAt')
170
+ # @option opts [String] :sort_direction Sort direction. (default to 'desc')
171
+ # @option opts [String] :id Filter by callback ID
172
+ # @option opts [String] :url Filter by callback URL
173
+ # @option opts [Integer] :status HTTP status code
174
+ # @option opts [String] :transaction_id Transaction ID.
175
+ # @option opts [Boolean] :has_error Filter callbacks that errored
176
+ # @option opts [Time] :created_at_from Start of the creation date range.
177
+ # @option opts [Time] :created_at_to End of the creation date range.
178
+ # @option opts [String] :webhook_id Webhook id.
179
+ # @option opts [WebhookEventType] :event_type Webhook event type.
180
+ # @return [Array<(CallbackListResponse, Integer, Hash)>] CallbackListResponse data, response status code and response headers
181
+ def get_user_callbacks_with_http_info(opts = {})
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.get_user_callbacks ...'
184
+ end
185
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
186
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CallbacksApi.get_user_callbacks, must be greater than or equal to 1.'
187
+ end
188
+
189
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
190
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CallbacksApi.get_user_callbacks, must be smaller than or equal to 100.'
191
+ end
192
+
193
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
194
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CallbacksApi.get_user_callbacks, must be greater than or equal to 1.'
195
+ end
196
+
197
+ allowable_values = ["createdAt", "status"]
198
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
199
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
200
+ end
201
+ allowable_values = ["asc", "desc"]
202
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
203
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
204
+ end
205
+ # resource path
206
+ local_var_path = '/user/callbacks'
207
+
208
+ # query parameters
209
+ query_params = opts[:query_params] || {}
210
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
211
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
212
+ query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
213
+ query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
214
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
215
+ query_params[:'url'] = opts[:'url'] if !opts[:'url'].nil?
216
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
217
+ query_params[:'transactionId'] = opts[:'transaction_id'] if !opts[:'transaction_id'].nil?
218
+ query_params[:'hasError'] = opts[:'has_error'] if !opts[:'has_error'].nil?
219
+ query_params[:'createdAtFrom'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil?
220
+ query_params[:'createdAtTo'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil?
221
+ query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil?
222
+ query_params[:'eventType'] = opts[:'event_type'] if !opts[:'event_type'].nil?
223
+
224
+ # header parameters
225
+ header_params = opts[:header_params] || {}
226
+ # HTTP header 'Accept' (if needed)
227
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
228
+
229
+ # form parameters
230
+ form_params = opts[:form_params] || {}
231
+
232
+ # http body (model)
233
+ post_body = opts[:debug_body]
234
+
235
+ # return_type
236
+ return_type = opts[:debug_return_type] || 'CallbackListResponse'
237
+
238
+ # auth_names
239
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
240
+
241
+ new_options = opts.merge(
242
+ :operation => :"CallbacksApi.get_user_callbacks",
243
+ :header_params => header_params,
244
+ :query_params => query_params,
245
+ :form_params => form_params,
246
+ :body => post_body,
247
+ :auth_names => auth_names,
248
+ :return_type => return_type
249
+ )
250
+
251
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
252
+ if @api_client.config.debugging
253
+ @api_client.config.logger.debug "API called: CallbacksApi#get_user_callbacks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
254
+ end
255
+ return data, status_code, headers
256
+ end
257
+
258
+ # Re-send callback (single)
259
+ # Resend the callback of a single transaction.
260
+ # @param transaction_id [String] Transaction ID.
261
+ # @param [Hash] opts the optional parameters
262
+ # @return [ResendUserCallbackSingle200Response]
263
+ def resend_user_callback_single(transaction_id, opts = {})
264
+ data, _status_code, _headers = resend_user_callback_single_with_http_info(transaction_id, opts)
265
+ data
266
+ end
267
+
268
+ # Re-send callback (single)
269
+ # Resend the callback of a single transaction.
270
+ # @param transaction_id [String] Transaction ID.
271
+ # @param [Hash] opts the optional parameters
272
+ # @return [Array<(ResendUserCallbackSingle200Response, Integer, Hash)>] ResendUserCallbackSingle200Response data, response status code and response headers
273
+ def resend_user_callback_single_with_http_info(transaction_id, opts = {})
274
+ if @api_client.config.debugging
275
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.resend_user_callback_single ...'
276
+ end
277
+ # verify the required parameter 'transaction_id' is set
278
+ if @api_client.config.client_side_validation && transaction_id.nil?
279
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling CallbacksApi.resend_user_callback_single"
280
+ end
281
+ # resource path
282
+ local_var_path = '/user/callbacks/resend/{transactionId}'.sub('{transactionId}', CGI.escape(transaction_id.to_s))
283
+
284
+ # query parameters
285
+ query_params = opts[:query_params] || {}
286
+
287
+ # header parameters
288
+ header_params = opts[:header_params] || {}
289
+ # HTTP header 'Accept' (if needed)
290
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
291
+
292
+ # form parameters
293
+ form_params = opts[:form_params] || {}
294
+
295
+ # http body (model)
296
+ post_body = opts[:debug_body]
297
+
298
+ # return_type
299
+ return_type = opts[:debug_return_type] || 'ResendUserCallbackSingle200Response'
300
+
301
+ # auth_names
302
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
303
+
304
+ new_options = opts.merge(
305
+ :operation => :"CallbacksApi.resend_user_callback_single",
306
+ :header_params => header_params,
307
+ :query_params => query_params,
308
+ :form_params => form_params,
309
+ :body => post_body,
310
+ :auth_names => auth_names,
311
+ :return_type => return_type
312
+ )
313
+
314
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug "API called: CallbacksApi#resend_user_callback_single\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
317
+ end
318
+ return data, status_code, headers
319
+ end
320
+
321
+ # Re-send callbacks (bulk)
322
+ # Resend callbacks in bulk for transactions matching the given filters.
323
+ # @param resend_user_callbacks_request [ResendUserCallbacksRequest]
324
+ # @param [Hash] opts the optional parameters
325
+ # @return [ResendUserCallbacks200Response]
326
+ def resend_user_callbacks(resend_user_callbacks_request, opts = {})
327
+ data, _status_code, _headers = resend_user_callbacks_with_http_info(resend_user_callbacks_request, opts)
328
+ data
329
+ end
330
+
331
+ # Re-send callbacks (bulk)
332
+ # Resend callbacks in bulk for transactions matching the given filters.
333
+ # @param resend_user_callbacks_request [ResendUserCallbacksRequest]
334
+ # @param [Hash] opts the optional parameters
335
+ # @return [Array<(ResendUserCallbacks200Response, Integer, Hash)>] ResendUserCallbacks200Response data, response status code and response headers
336
+ def resend_user_callbacks_with_http_info(resend_user_callbacks_request, opts = {})
337
+ if @api_client.config.debugging
338
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.resend_user_callbacks ...'
339
+ end
340
+ # verify the required parameter 'resend_user_callbacks_request' is set
341
+ if @api_client.config.client_side_validation && resend_user_callbacks_request.nil?
342
+ fail ArgumentError, "Missing the required parameter 'resend_user_callbacks_request' when calling CallbacksApi.resend_user_callbacks"
343
+ end
344
+ # resource path
345
+ local_var_path = '/user/callbacks/resend'
346
+
347
+ # query parameters
348
+ query_params = opts[:query_params] || {}
349
+
350
+ # header parameters
351
+ header_params = opts[:header_params] || {}
352
+ # HTTP header 'Accept' (if needed)
353
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
354
+ # HTTP header 'Content-Type'
355
+ content_type = @api_client.select_header_content_type(['application/json'])
356
+ if !content_type.nil?
357
+ header_params['Content-Type'] = content_type
358
+ end
359
+
360
+ # form parameters
361
+ form_params = opts[:form_params] || {}
362
+
363
+ # http body (model)
364
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(resend_user_callbacks_request)
365
+
366
+ # return_type
367
+ return_type = opts[:debug_return_type] || 'ResendUserCallbacks200Response'
368
+
369
+ # auth_names
370
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
371
+
372
+ new_options = opts.merge(
373
+ :operation => :"CallbacksApi.resend_user_callbacks",
374
+ :header_params => header_params,
375
+ :query_params => query_params,
376
+ :form_params => form_params,
377
+ :body => post_body,
378
+ :auth_names => auth_names,
379
+ :return_type => return_type
380
+ )
381
+
382
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
383
+ if @api_client.config.debugging
384
+ @api_client.config.logger.debug "API called: CallbacksApi#resend_user_callbacks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
385
+ end
386
+ return data, status_code, headers
387
+ end
388
+
389
+ # Resend callbacks by webhook
390
+ # Queues a bulk resend of the failed callbacks of a given webhook.
391
+ # @param webhook_id [String] Webhook id.
392
+ # @param [Hash] opts the optional parameters
393
+ # @return [EnqueuedCallback]
394
+ def resend_user_callbacks_webhook(webhook_id, opts = {})
395
+ data, _status_code, _headers = resend_user_callbacks_webhook_with_http_info(webhook_id, opts)
396
+ data
397
+ end
398
+
399
+ # Resend callbacks by webhook
400
+ # Queues a bulk resend of the failed callbacks of a given webhook.
401
+ # @param webhook_id [String] Webhook id.
402
+ # @param [Hash] opts the optional parameters
403
+ # @return [Array<(EnqueuedCallback, Integer, Hash)>] EnqueuedCallback data, response status code and response headers
404
+ def resend_user_callbacks_webhook_with_http_info(webhook_id, opts = {})
405
+ if @api_client.config.debugging
406
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.resend_user_callbacks_webhook ...'
407
+ end
408
+ # verify the required parameter 'webhook_id' is set
409
+ if @api_client.config.client_side_validation && webhook_id.nil?
410
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling CallbacksApi.resend_user_callbacks_webhook"
411
+ end
412
+ # resource path
413
+ local_var_path = '/user/callbacks/resend/webhook/{webhookId}'.sub('{webhookId}', CGI.escape(webhook_id.to_s))
414
+
415
+ # query parameters
416
+ query_params = opts[:query_params] || {}
417
+
418
+ # header parameters
419
+ header_params = opts[:header_params] || {}
420
+ # HTTP header 'Accept' (if needed)
421
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
422
+
423
+ # form parameters
424
+ form_params = opts[:form_params] || {}
425
+
426
+ # http body (model)
427
+ post_body = opts[:debug_body]
428
+
429
+ # return_type
430
+ return_type = opts[:debug_return_type] || 'EnqueuedCallback'
431
+
432
+ # auth_names
433
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
434
+
435
+ new_options = opts.merge(
436
+ :operation => :"CallbacksApi.resend_user_callbacks_webhook",
437
+ :header_params => header_params,
438
+ :query_params => query_params,
439
+ :form_params => form_params,
440
+ :body => post_body,
441
+ :auth_names => auth_names,
442
+ :return_type => return_type
443
+ )
444
+
445
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
446
+ if @api_client.config.debugging
447
+ @api_client.config.logger.debug "API called: CallbacksApi#resend_user_callbacks_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
448
+ end
449
+ return data, status_code, headers
450
+ end
451
+
452
+ # Resend webhook callbacks by filters
453
+ # Queues the resend of failed webhook deliveries in a period. For each webhook, transaction and event, only the last delivery attempt in the period counts, and it is resent only when it failed. The filters apply to the transactions of those deliveries.
454
+ # @param resend_webhook_callbacks_request [ResendWebhookCallbacksRequest]
455
+ # @param [Hash] opts the optional parameters
456
+ # @return [EnqueuedCallback]
457
+ def resend_user_callbacks_webhooks(resend_webhook_callbacks_request, opts = {})
458
+ data, _status_code, _headers = resend_user_callbacks_webhooks_with_http_info(resend_webhook_callbacks_request, opts)
459
+ data
460
+ end
461
+
462
+ # Resend webhook callbacks by filters
463
+ # Queues the resend of failed webhook deliveries in a period. For each webhook, transaction and event, only the last delivery attempt in the period counts, and it is resent only when it failed. The filters apply to the transactions of those deliveries.
464
+ # @param resend_webhook_callbacks_request [ResendWebhookCallbacksRequest]
465
+ # @param [Hash] opts the optional parameters
466
+ # @return [Array<(EnqueuedCallback, Integer, Hash)>] EnqueuedCallback data, response status code and response headers
467
+ def resend_user_callbacks_webhooks_with_http_info(resend_webhook_callbacks_request, opts = {})
468
+ if @api_client.config.debugging
469
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.resend_user_callbacks_webhooks ...'
470
+ end
471
+ # verify the required parameter 'resend_webhook_callbacks_request' is set
472
+ if @api_client.config.client_side_validation && resend_webhook_callbacks_request.nil?
473
+ fail ArgumentError, "Missing the required parameter 'resend_webhook_callbacks_request' when calling CallbacksApi.resend_user_callbacks_webhooks"
474
+ end
475
+ # resource path
476
+ local_var_path = '/user/callbacks/resend/webhook'
477
+
478
+ # query parameters
479
+ query_params = opts[:query_params] || {}
480
+
481
+ # header parameters
482
+ header_params = opts[:header_params] || {}
483
+ # HTTP header 'Accept' (if needed)
484
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
485
+ # HTTP header 'Content-Type'
486
+ content_type = @api_client.select_header_content_type(['application/json'])
487
+ if !content_type.nil?
488
+ header_params['Content-Type'] = content_type
489
+ end
490
+
491
+ # form parameters
492
+ form_params = opts[:form_params] || {}
493
+
494
+ # http body (model)
495
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(resend_webhook_callbacks_request)
496
+
497
+ # return_type
498
+ return_type = opts[:debug_return_type] || 'EnqueuedCallback'
499
+
500
+ # auth_names
501
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
502
+
503
+ new_options = opts.merge(
504
+ :operation => :"CallbacksApi.resend_user_callbacks_webhooks",
505
+ :header_params => header_params,
506
+ :query_params => query_params,
507
+ :form_params => form_params,
508
+ :body => post_body,
509
+ :auth_names => auth_names,
510
+ :return_type => return_type
511
+ )
512
+
513
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
514
+ if @api_client.config.debugging
515
+ @api_client.config.logger.debug "API called: CallbacksApi#resend_user_callbacks_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
516
+ end
517
+ return data, status_code, headers
518
+ end
519
+
520
+ # Rotate callback secret
521
+ # Replaces the account callback secret. Deliveries start being signed with the new secret right away.
522
+ # @param [Hash] opts the optional parameters
523
+ # @return [RotateCallbackSecretResponse]
524
+ def rotate_user_callback_secret(opts = {})
525
+ data, _status_code, _headers = rotate_user_callback_secret_with_http_info(opts)
526
+ data
527
+ end
528
+
529
+ # Rotate callback secret
530
+ # Replaces the account callback secret. Deliveries start being signed with the new secret right away.
531
+ # @param [Hash] opts the optional parameters
532
+ # @return [Array<(RotateCallbackSecretResponse, Integer, Hash)>] RotateCallbackSecretResponse data, response status code and response headers
533
+ def rotate_user_callback_secret_with_http_info(opts = {})
534
+ if @api_client.config.debugging
535
+ @api_client.config.logger.debug 'Calling API: CallbacksApi.rotate_user_callback_secret ...'
536
+ end
537
+ # resource path
538
+ local_var_path = '/user/callbacks/secret/rotate'
539
+
540
+ # query parameters
541
+ query_params = opts[:query_params] || {}
542
+
543
+ # header parameters
544
+ header_params = opts[:header_params] || {}
545
+ # HTTP header 'Accept' (if needed)
546
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
547
+
548
+ # form parameters
549
+ form_params = opts[:form_params] || {}
550
+
551
+ # http body (model)
552
+ post_body = opts[:debug_body]
553
+
554
+ # return_type
555
+ return_type = opts[:debug_return_type] || 'RotateCallbackSecretResponse'
556
+
557
+ # auth_names
558
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
559
+
560
+ new_options = opts.merge(
561
+ :operation => :"CallbacksApi.rotate_user_callback_secret",
562
+ :header_params => header_params,
563
+ :query_params => query_params,
564
+ :form_params => form_params,
565
+ :body => post_body,
566
+ :auth_names => auth_names,
567
+ :return_type => return_type
568
+ )
569
+
570
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
571
+ if @api_client.config.debugging
572
+ @api_client.config.logger.debug "API called: CallbacksApi#rotate_user_callback_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
573
+ end
574
+ return data, status_code, headers
575
+ end
576
+ end
577
+ end