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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +231 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +141 -0
- data/docs/ApiErrorDetailsInner.md +20 -0
- data/docs/BankStatement.md +42 -0
- data/docs/BankStatementListResponse.md +20 -0
- data/docs/BankStatementListResponsePagination.md +22 -0
- data/docs/CallbackDetail.md +34 -0
- data/docs/CallbackListResponse.md +20 -0
- data/docs/CallbackListResponsePagination.md +22 -0
- data/docs/CallbackSecretResponse.md +20 -0
- data/docs/CallbacksApi.md +587 -0
- data/docs/Defense.md +30 -0
- data/docs/DefenseFilesInner.md +24 -0
- data/docs/DefenseHistoryEntry.md +28 -0
- data/docs/DefenseHistoryEntryFilesInner.md +22 -0
- data/docs/DepositPending.md +62 -0
- data/docs/DepositPendingListResponse.md +24 -0
- data/docs/DictConsultResponse.md +30 -0
- data/docs/DownloadUserReport200Response.md +20 -0
- data/docs/EnqueuedCallback.md +18 -0
- data/docs/EnqueuedCallbackEnqueued.md +22 -0
- data/docs/EnqueuedCallbackItem.md +22 -0
- data/docs/ErrorResponse.md +32 -0
- data/docs/GetUser200Response.md +46 -0
- data/docs/GetUser200ResponseDailyWithdrawLimit.md +24 -0
- data/docs/GetUser200ResponseServiceFee.md +28 -0
- data/docs/GetUserBalance200Response.md +20 -0
- data/docs/GetUserTransactionById200Response.md +94 -0
- data/docs/GetUserTransactionById200ResponseAllOfCallbackLogInner.md +26 -0
- data/docs/GetUserTransactionById200ResponseAllOfInfractionInner.md +24 -0
- data/docs/GetUserTransactions200Response.md +22 -0
- data/docs/InfractionDetail.md +40 -0
- data/docs/InfractionDetailTransaction.md +30 -0
- data/docs/InfractionListResponse.md +20 -0
- data/docs/InfractionListResponsePagination.md +24 -0
- data/docs/InfractionsApi.md +413 -0
- data/docs/InternalTransferApi.md +153 -0
- data/docs/KeysAndDICTApi.md +217 -0
- data/docs/ListUserReports200Response.md +22 -0
- data/docs/PixKeyInfo.md +36 -0
- data/docs/PixOperationsApi.md +299 -0
- data/docs/PostInternalTransferRequest.md +30 -0
- data/docs/PostPixQrcodeReadRequest.md +18 -0
- data/docs/PostPixRequest.md +32 -0
- data/docs/PostUserReportRequest.md +24 -0
- data/docs/PostWithdrawQrcodeRequest.md +28 -0
- data/docs/PostWithdrawRequest.md +30 -0
- data/docs/ProofResponse.md +18 -0
- data/docs/QRCodeReadResponse.md +38 -0
- data/docs/Refund.md +34 -0
- data/docs/RefundRequest.md +22 -0
- data/docs/RefundsApi.md +79 -0
- data/docs/ReportJob.md +30 -0
- data/docs/ReportJobAccepted.md +30 -0
- data/docs/ReportJobDetail.md +30 -0
- data/docs/ReportsApi.md +881 -0
- data/docs/ResendUserCallbackSingle200Response.md +18 -0
- data/docs/ResendUserCallbacks200Response.md +20 -0
- data/docs/ResendUserCallbacksRequest.md +28 -0
- data/docs/ResendWebhookCallbacksRequest.md +30 -0
- data/docs/RotateCallbackSecretResponse.md +18 -0
- data/docs/RotateSecretResponse.md +18 -0
- data/docs/SentWebhookDetail.md +40 -0
- data/docs/SentWebhookDetailResponse.md +18 -0
- data/docs/SentWebhooksQuantity.md +18 -0
- data/docs/Summary.md +26 -0
- data/docs/SummaryBlock.md +24 -0
- data/docs/SummaryBlockGroupedInner.md +20 -0
- data/docs/SummaryBlockStatuses.md +26 -0
- data/docs/SummaryStatus.md +22 -0
- data/docs/Transaction.md +90 -0
- data/docs/TransactionWithRefunds.md +92 -0
- data/docs/Webhook.md +30 -0
- data/docs/WebhookCreateRequest.md +24 -0
- data/docs/WebhookEventType.md +15 -0
- data/docs/WebhookListResponse.md +18 -0
- data/docs/WebhookUpdateRequest.md +22 -0
- data/docs/WebhookWithSecret.md +32 -0
- data/docs/WebhooksApi.md +574 -0
- data/docs/WithdrawalsApi.md +299 -0
- data/git_push.sh +57 -0
- data/lib/payzu-pix/api/account_api.rb +136 -0
- data/lib/payzu-pix/api/callbacks_api.rb +577 -0
- data/lib/payzu-pix/api/infractions_api.rb +452 -0
- data/lib/payzu-pix/api/internal_transfer_api.rb +164 -0
- data/lib/payzu-pix/api/keys_and_dict_api.rb +234 -0
- data/lib/payzu-pix/api/pix_operations_api.rb +300 -0
- data/lib/payzu-pix/api/refunds_api.rb +96 -0
- data/lib/payzu-pix/api/reports_api.rb +968 -0
- data/lib/payzu-pix/api/webhooks_api.rb +542 -0
- data/lib/payzu-pix/api/withdrawals_api.rb +305 -0
- data/lib/payzu-pix/api_client.rb +441 -0
- data/lib/payzu-pix/api_error.rb +58 -0
- data/lib/payzu-pix/api_model_base.rb +88 -0
- data/lib/payzu-pix/configuration.rb +392 -0
- data/lib/payzu-pix/models/api_error_details_inner.rb +192 -0
- data/lib/payzu-pix/models/bank_statement.rb +296 -0
- data/lib/payzu-pix/models/bank_statement_list_response.rb +159 -0
- data/lib/payzu-pix/models/bank_statement_list_response_pagination.rb +169 -0
- data/lib/payzu-pix/models/callback_detail.rb +228 -0
- data/lib/payzu-pix/models/callback_list_response.rb +159 -0
- data/lib/payzu-pix/models/callback_list_response_pagination.rb +169 -0
- data/lib/payzu-pix/models/callback_secret_response.rb +158 -0
- data/lib/payzu-pix/models/defense.rb +234 -0
- data/lib/payzu-pix/models/defense_files_inner.rb +179 -0
- data/lib/payzu-pix/models/defense_history_entry.rb +225 -0
- data/lib/payzu-pix/models/defense_history_entry_files_inner.rb +168 -0
- data/lib/payzu-pix/models/deposit_pending.rb +407 -0
- data/lib/payzu-pix/models/deposit_pending_list_response.rb +180 -0
- data/lib/payzu-pix/models/dict_consult_response.rb +231 -0
- data/lib/payzu-pix/models/download_user_report200_response.rb +158 -0
- data/lib/payzu-pix/models/enqueued_callback.rb +147 -0
- data/lib/payzu-pix/models/enqueued_callback_enqueued.rb +170 -0
- data/lib/payzu-pix/models/enqueued_callback_item.rb +190 -0
- data/lib/payzu-pix/models/error_response.rb +336 -0
- data/lib/payzu-pix/models/get_user200_response.rb +334 -0
- data/lib/payzu-pix/models/get_user200_response_daily_withdraw_limit.rb +180 -0
- data/lib/payzu-pix/models/get_user200_response_service_fee.rb +199 -0
- data/lib/payzu-pix/models/get_user_balance200_response.rb +158 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response.rb +595 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_callback_log_inner.rb +188 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_infraction_inner.rb +202 -0
- data/lib/payzu-pix/models/get_user_transactions200_response.rb +170 -0
- data/lib/payzu-pix/models/infraction_detail.rb +293 -0
- data/lib/payzu-pix/models/infraction_detail_transaction.rb +213 -0
- data/lib/payzu-pix/models/infraction_list_response.rb +159 -0
- data/lib/payzu-pix/models/infraction_list_response_pagination.rb +179 -0
- data/lib/payzu-pix/models/list_user_reports200_response.rb +170 -0
- data/lib/payzu-pix/models/pix_key_info.rb +263 -0
- data/lib/payzu-pix/models/post_internal_transfer_request.rb +377 -0
- data/lib/payzu-pix/models/post_pix_qrcode_read_request.rb +174 -0
- data/lib/payzu-pix/models/post_pix_request.rb +382 -0
- data/lib/payzu-pix/models/post_user_report_request.rb +238 -0
- data/lib/payzu-pix/models/post_withdraw_qrcode_request.rb +302 -0
- data/lib/payzu-pix/models/post_withdraw_request.rb +350 -0
- data/lib/payzu-pix/models/proof_response.rb +148 -0
- data/lib/payzu-pix/models/qr_code_read_response.rb +283 -0
- data/lib/payzu-pix/models/refund.rb +257 -0
- data/lib/payzu-pix/models/refund_request.rb +215 -0
- data/lib/payzu-pix/models/report_job.rb +234 -0
- data/lib/payzu-pix/models/report_job_accepted.rb +237 -0
- data/lib/payzu-pix/models/report_job_detail.rb +237 -0
- data/lib/payzu-pix/models/resend_user_callback_single200_response.rb +148 -0
- data/lib/payzu-pix/models/resend_user_callbacks200_response.rb +158 -0
- data/lib/payzu-pix/models/resend_user_callbacks_request.rb +262 -0
- data/lib/payzu-pix/models/resend_webhook_callbacks_request.rb +274 -0
- data/lib/payzu-pix/models/rotate_callback_secret_response.rb +148 -0
- data/lib/payzu-pix/models/rotate_secret_response.rb +148 -0
- data/lib/payzu-pix/models/sent_webhook_detail.rb +261 -0
- data/lib/payzu-pix/models/sent_webhook_detail_response.rb +164 -0
- data/lib/payzu-pix/models/sent_webhooks_quantity.rb +148 -0
- data/lib/payzu-pix/models/summary.rb +188 -0
- data/lib/payzu-pix/models/summary_block.rb +179 -0
- data/lib/payzu-pix/models/summary_block_grouped_inner.rb +158 -0
- data/lib/payzu-pix/models/summary_block_statuses.rb +189 -0
- data/lib/payzu-pix/models/summary_status.rb +168 -0
- data/lib/payzu-pix/models/transaction.rb +588 -0
- data/lib/payzu-pix/models/transaction_with_refunds.rb +583 -0
- data/lib/payzu-pix/models/webhook.rb +210 -0
- data/lib/payzu-pix/models/webhook_create_request.rb +201 -0
- data/lib/payzu-pix/models/webhook_event_type.rb +47 -0
- data/lib/payzu-pix/models/webhook_list_response.rb +150 -0
- data/lib/payzu-pix/models/webhook_update_request.rb +171 -0
- data/lib/payzu-pix/models/webhook_with_secret.rb +220 -0
- data/lib/payzu-pix/version.rb +15 -0
- data/lib/payzu-pix.rb +119 -0
- data/payzu-pix.gemspec +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +283 -0
|
@@ -0,0 +1,542 @@
|
|
|
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 WebhooksApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Delete webhook
|
|
23
|
+
# Removes a webhook.
|
|
24
|
+
# @param id [String] Webhook id.
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [nil]
|
|
27
|
+
def delete_user_webhook(id, opts = {})
|
|
28
|
+
delete_user_webhook_with_http_info(id, opts)
|
|
29
|
+
nil
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Delete webhook
|
|
33
|
+
# Removes a webhook.
|
|
34
|
+
# @param id [String] Webhook id.
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
37
|
+
def delete_user_webhook_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.delete_user_webhook ...'
|
|
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 WebhooksApi.delete_user_webhook"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/user/webhooks/{id}'.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]
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"WebhooksApi.delete_user_webhook",
|
|
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(:DELETE, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: WebhooksApi#delete_user_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Get webhook
|
|
86
|
+
# Returns a single webhook.
|
|
87
|
+
# @param id [String] Webhook id.
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @return [Webhook]
|
|
90
|
+
def get_user_webhook(id, opts = {})
|
|
91
|
+
data, _status_code, _headers = get_user_webhook_with_http_info(id, opts)
|
|
92
|
+
data
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Get webhook
|
|
96
|
+
# Returns a single webhook.
|
|
97
|
+
# @param id [String] Webhook id.
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
|
|
100
|
+
def get_user_webhook_with_http_info(id, opts = {})
|
|
101
|
+
if @api_client.config.debugging
|
|
102
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.get_user_webhook ...'
|
|
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 WebhooksApi.get_user_webhook"
|
|
107
|
+
end
|
|
108
|
+
# resource path
|
|
109
|
+
local_var_path = '/user/webhooks/{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] || 'Webhook'
|
|
127
|
+
|
|
128
|
+
# auth_names
|
|
129
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
130
|
+
|
|
131
|
+
new_options = opts.merge(
|
|
132
|
+
:operation => :"WebhooksApi.get_user_webhook",
|
|
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: WebhooksApi#get_user_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
144
|
+
end
|
|
145
|
+
return data, status_code, headers
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Get sent callback detail
|
|
149
|
+
# Returns the delivery detail of a single sent callback.
|
|
150
|
+
# @param id [String] Webhook id.
|
|
151
|
+
# @param callback_id [String] Callback log id.
|
|
152
|
+
# @param [Hash] opts the optional parameters
|
|
153
|
+
# @return [SentWebhookDetailResponse]
|
|
154
|
+
def get_user_webhook_sent_detail(id, callback_id, opts = {})
|
|
155
|
+
data, _status_code, _headers = get_user_webhook_sent_detail_with_http_info(id, callback_id, opts)
|
|
156
|
+
data
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Get sent callback detail
|
|
160
|
+
# Returns the delivery detail of a single sent callback.
|
|
161
|
+
# @param id [String] Webhook id.
|
|
162
|
+
# @param callback_id [String] Callback log id.
|
|
163
|
+
# @param [Hash] opts the optional parameters
|
|
164
|
+
# @return [Array<(SentWebhookDetailResponse, Integer, Hash)>] SentWebhookDetailResponse data, response status code and response headers
|
|
165
|
+
def get_user_webhook_sent_detail_with_http_info(id, callback_id, opts = {})
|
|
166
|
+
if @api_client.config.debugging
|
|
167
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.get_user_webhook_sent_detail ...'
|
|
168
|
+
end
|
|
169
|
+
# verify the required parameter 'id' is set
|
|
170
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
171
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_user_webhook_sent_detail"
|
|
172
|
+
end
|
|
173
|
+
# verify the required parameter 'callback_id' is set
|
|
174
|
+
if @api_client.config.client_side_validation && callback_id.nil?
|
|
175
|
+
fail ArgumentError, "Missing the required parameter 'callback_id' when calling WebhooksApi.get_user_webhook_sent_detail"
|
|
176
|
+
end
|
|
177
|
+
# resource path
|
|
178
|
+
local_var_path = '/user/webhooks/{id}/sent/{callbackId}'.sub('{id}', CGI.escape(id.to_s)).sub('{callbackId}', CGI.escape(callback_id.to_s))
|
|
179
|
+
|
|
180
|
+
# query parameters
|
|
181
|
+
query_params = opts[:query_params] || {}
|
|
182
|
+
|
|
183
|
+
# header parameters
|
|
184
|
+
header_params = opts[:header_params] || {}
|
|
185
|
+
# HTTP header 'Accept' (if needed)
|
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
187
|
+
|
|
188
|
+
# form parameters
|
|
189
|
+
form_params = opts[:form_params] || {}
|
|
190
|
+
|
|
191
|
+
# http body (model)
|
|
192
|
+
post_body = opts[:debug_body]
|
|
193
|
+
|
|
194
|
+
# return_type
|
|
195
|
+
return_type = opts[:debug_return_type] || 'SentWebhookDetailResponse'
|
|
196
|
+
|
|
197
|
+
# auth_names
|
|
198
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
199
|
+
|
|
200
|
+
new_options = opts.merge(
|
|
201
|
+
:operation => :"WebhooksApi.get_user_webhook_sent_detail",
|
|
202
|
+
:header_params => header_params,
|
|
203
|
+
:query_params => query_params,
|
|
204
|
+
:form_params => form_params,
|
|
205
|
+
:body => post_body,
|
|
206
|
+
:auth_names => auth_names,
|
|
207
|
+
:return_type => return_type
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
211
|
+
if @api_client.config.debugging
|
|
212
|
+
@api_client.config.logger.debug "API called: WebhooksApi#get_user_webhook_sent_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
213
|
+
end
|
|
214
|
+
return data, status_code, headers
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# List webhooks
|
|
218
|
+
# Lists the webhooks registered for the account.
|
|
219
|
+
# @param [Hash] opts the optional parameters
|
|
220
|
+
# @option opts [Boolean] :active Filter by active status.
|
|
221
|
+
# @return [WebhookListResponse]
|
|
222
|
+
def get_user_webhooks(opts = {})
|
|
223
|
+
data, _status_code, _headers = get_user_webhooks_with_http_info(opts)
|
|
224
|
+
data
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# List webhooks
|
|
228
|
+
# Lists the webhooks registered for the account.
|
|
229
|
+
# @param [Hash] opts the optional parameters
|
|
230
|
+
# @option opts [Boolean] :active Filter by active status.
|
|
231
|
+
# @return [Array<(WebhookListResponse, Integer, Hash)>] WebhookListResponse data, response status code and response headers
|
|
232
|
+
def get_user_webhooks_with_http_info(opts = {})
|
|
233
|
+
if @api_client.config.debugging
|
|
234
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.get_user_webhooks ...'
|
|
235
|
+
end
|
|
236
|
+
# resource path
|
|
237
|
+
local_var_path = '/user/webhooks'
|
|
238
|
+
|
|
239
|
+
# query parameters
|
|
240
|
+
query_params = opts[:query_params] || {}
|
|
241
|
+
query_params[:'active'] = opts[:'active'] if !opts[:'active'].nil?
|
|
242
|
+
|
|
243
|
+
# header parameters
|
|
244
|
+
header_params = opts[:header_params] || {}
|
|
245
|
+
# HTTP header 'Accept' (if needed)
|
|
246
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
247
|
+
|
|
248
|
+
# form parameters
|
|
249
|
+
form_params = opts[:form_params] || {}
|
|
250
|
+
|
|
251
|
+
# http body (model)
|
|
252
|
+
post_body = opts[:debug_body]
|
|
253
|
+
|
|
254
|
+
# return_type
|
|
255
|
+
return_type = opts[:debug_return_type] || 'WebhookListResponse'
|
|
256
|
+
|
|
257
|
+
# auth_names
|
|
258
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
259
|
+
|
|
260
|
+
new_options = opts.merge(
|
|
261
|
+
:operation => :"WebhooksApi.get_user_webhooks",
|
|
262
|
+
:header_params => header_params,
|
|
263
|
+
:query_params => query_params,
|
|
264
|
+
:form_params => form_params,
|
|
265
|
+
:body => post_body,
|
|
266
|
+
:auth_names => auth_names,
|
|
267
|
+
:return_type => return_type
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
271
|
+
if @api_client.config.debugging
|
|
272
|
+
@api_client.config.logger.debug "API called: WebhooksApi#get_user_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
273
|
+
end
|
|
274
|
+
return data, status_code, headers
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Count sent callbacks
|
|
278
|
+
# Returns how many webhook deliveries were made, optionally filtered by webhook.
|
|
279
|
+
# @param [Hash] opts the optional parameters
|
|
280
|
+
# @option opts [String] :webhook_id Filter the count by webhook id.
|
|
281
|
+
# @return [SentWebhooksQuantity]
|
|
282
|
+
def get_user_webhooks_sent_quantity(opts = {})
|
|
283
|
+
data, _status_code, _headers = get_user_webhooks_sent_quantity_with_http_info(opts)
|
|
284
|
+
data
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Count sent callbacks
|
|
288
|
+
# Returns how many webhook deliveries were made, optionally filtered by webhook.
|
|
289
|
+
# @param [Hash] opts the optional parameters
|
|
290
|
+
# @option opts [String] :webhook_id Filter the count by webhook id.
|
|
291
|
+
# @return [Array<(SentWebhooksQuantity, Integer, Hash)>] SentWebhooksQuantity data, response status code and response headers
|
|
292
|
+
def get_user_webhooks_sent_quantity_with_http_info(opts = {})
|
|
293
|
+
if @api_client.config.debugging
|
|
294
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.get_user_webhooks_sent_quantity ...'
|
|
295
|
+
end
|
|
296
|
+
# resource path
|
|
297
|
+
local_var_path = '/user/webhooks/sent/quantity'
|
|
298
|
+
|
|
299
|
+
# query parameters
|
|
300
|
+
query_params = opts[:query_params] || {}
|
|
301
|
+
query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil?
|
|
302
|
+
|
|
303
|
+
# header parameters
|
|
304
|
+
header_params = opts[:header_params] || {}
|
|
305
|
+
# HTTP header 'Accept' (if needed)
|
|
306
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
307
|
+
|
|
308
|
+
# form parameters
|
|
309
|
+
form_params = opts[:form_params] || {}
|
|
310
|
+
|
|
311
|
+
# http body (model)
|
|
312
|
+
post_body = opts[:debug_body]
|
|
313
|
+
|
|
314
|
+
# return_type
|
|
315
|
+
return_type = opts[:debug_return_type] || 'SentWebhooksQuantity'
|
|
316
|
+
|
|
317
|
+
# auth_names
|
|
318
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
319
|
+
|
|
320
|
+
new_options = opts.merge(
|
|
321
|
+
:operation => :"WebhooksApi.get_user_webhooks_sent_quantity",
|
|
322
|
+
:header_params => header_params,
|
|
323
|
+
:query_params => query_params,
|
|
324
|
+
:form_params => form_params,
|
|
325
|
+
:body => post_body,
|
|
326
|
+
:auth_names => auth_names,
|
|
327
|
+
:return_type => return_type
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
331
|
+
if @api_client.config.debugging
|
|
332
|
+
@api_client.config.logger.debug "API called: WebhooksApi#get_user_webhooks_sent_quantity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
333
|
+
end
|
|
334
|
+
return data, status_code, headers
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Update webhook
|
|
338
|
+
# Updates the url, active flag or events of a webhook. Provide at least one field.
|
|
339
|
+
# @param id [String] Webhook id.
|
|
340
|
+
# @param webhook_update_request [WebhookUpdateRequest]
|
|
341
|
+
# @param [Hash] opts the optional parameters
|
|
342
|
+
# @return [Webhook]
|
|
343
|
+
def patch_user_webhook(id, webhook_update_request, opts = {})
|
|
344
|
+
data, _status_code, _headers = patch_user_webhook_with_http_info(id, webhook_update_request, opts)
|
|
345
|
+
data
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# Update webhook
|
|
349
|
+
# Updates the url, active flag or events of a webhook. Provide at least one field.
|
|
350
|
+
# @param id [String] Webhook id.
|
|
351
|
+
# @param webhook_update_request [WebhookUpdateRequest]
|
|
352
|
+
# @param [Hash] opts the optional parameters
|
|
353
|
+
# @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
|
|
354
|
+
def patch_user_webhook_with_http_info(id, webhook_update_request, opts = {})
|
|
355
|
+
if @api_client.config.debugging
|
|
356
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.patch_user_webhook ...'
|
|
357
|
+
end
|
|
358
|
+
# verify the required parameter 'id' is set
|
|
359
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
360
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.patch_user_webhook"
|
|
361
|
+
end
|
|
362
|
+
# verify the required parameter 'webhook_update_request' is set
|
|
363
|
+
if @api_client.config.client_side_validation && webhook_update_request.nil?
|
|
364
|
+
fail ArgumentError, "Missing the required parameter 'webhook_update_request' when calling WebhooksApi.patch_user_webhook"
|
|
365
|
+
end
|
|
366
|
+
# resource path
|
|
367
|
+
local_var_path = '/user/webhooks/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
368
|
+
|
|
369
|
+
# query parameters
|
|
370
|
+
query_params = opts[:query_params] || {}
|
|
371
|
+
|
|
372
|
+
# header parameters
|
|
373
|
+
header_params = opts[:header_params] || {}
|
|
374
|
+
# HTTP header 'Accept' (if needed)
|
|
375
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
376
|
+
# HTTP header 'Content-Type'
|
|
377
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
378
|
+
if !content_type.nil?
|
|
379
|
+
header_params['Content-Type'] = content_type
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
# form parameters
|
|
383
|
+
form_params = opts[:form_params] || {}
|
|
384
|
+
|
|
385
|
+
# http body (model)
|
|
386
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_update_request)
|
|
387
|
+
|
|
388
|
+
# return_type
|
|
389
|
+
return_type = opts[:debug_return_type] || 'Webhook'
|
|
390
|
+
|
|
391
|
+
# auth_names
|
|
392
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
393
|
+
|
|
394
|
+
new_options = opts.merge(
|
|
395
|
+
:operation => :"WebhooksApi.patch_user_webhook",
|
|
396
|
+
:header_params => header_params,
|
|
397
|
+
:query_params => query_params,
|
|
398
|
+
:form_params => form_params,
|
|
399
|
+
:body => post_body,
|
|
400
|
+
:auth_names => auth_names,
|
|
401
|
+
:return_type => return_type
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
405
|
+
if @api_client.config.debugging
|
|
406
|
+
@api_client.config.logger.debug "API called: WebhooksApi#patch_user_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
407
|
+
end
|
|
408
|
+
return data, status_code, headers
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# Create webhook
|
|
412
|
+
# Registers a webhook endpoint. If `generateSecret` is true, the response includes the HMAC `secret` (shown only here).
|
|
413
|
+
# @param webhook_create_request [WebhookCreateRequest]
|
|
414
|
+
# @param [Hash] opts the optional parameters
|
|
415
|
+
# @return [WebhookWithSecret]
|
|
416
|
+
def post_user_webhook(webhook_create_request, opts = {})
|
|
417
|
+
data, _status_code, _headers = post_user_webhook_with_http_info(webhook_create_request, opts)
|
|
418
|
+
data
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
# Create webhook
|
|
422
|
+
# Registers a webhook endpoint. If `generateSecret` is true, the response includes the HMAC `secret` (shown only here).
|
|
423
|
+
# @param webhook_create_request [WebhookCreateRequest]
|
|
424
|
+
# @param [Hash] opts the optional parameters
|
|
425
|
+
# @return [Array<(WebhookWithSecret, Integer, Hash)>] WebhookWithSecret data, response status code and response headers
|
|
426
|
+
def post_user_webhook_with_http_info(webhook_create_request, opts = {})
|
|
427
|
+
if @api_client.config.debugging
|
|
428
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.post_user_webhook ...'
|
|
429
|
+
end
|
|
430
|
+
# verify the required parameter 'webhook_create_request' is set
|
|
431
|
+
if @api_client.config.client_side_validation && webhook_create_request.nil?
|
|
432
|
+
fail ArgumentError, "Missing the required parameter 'webhook_create_request' when calling WebhooksApi.post_user_webhook"
|
|
433
|
+
end
|
|
434
|
+
# resource path
|
|
435
|
+
local_var_path = '/user/webhooks'
|
|
436
|
+
|
|
437
|
+
# query parameters
|
|
438
|
+
query_params = opts[:query_params] || {}
|
|
439
|
+
|
|
440
|
+
# header parameters
|
|
441
|
+
header_params = opts[:header_params] || {}
|
|
442
|
+
# HTTP header 'Accept' (if needed)
|
|
443
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
444
|
+
# HTTP header 'Content-Type'
|
|
445
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
446
|
+
if !content_type.nil?
|
|
447
|
+
header_params['Content-Type'] = content_type
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
# form parameters
|
|
451
|
+
form_params = opts[:form_params] || {}
|
|
452
|
+
|
|
453
|
+
# http body (model)
|
|
454
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_create_request)
|
|
455
|
+
|
|
456
|
+
# return_type
|
|
457
|
+
return_type = opts[:debug_return_type] || 'WebhookWithSecret'
|
|
458
|
+
|
|
459
|
+
# auth_names
|
|
460
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
461
|
+
|
|
462
|
+
new_options = opts.merge(
|
|
463
|
+
:operation => :"WebhooksApi.post_user_webhook",
|
|
464
|
+
:header_params => header_params,
|
|
465
|
+
:query_params => query_params,
|
|
466
|
+
:form_params => form_params,
|
|
467
|
+
:body => post_body,
|
|
468
|
+
:auth_names => auth_names,
|
|
469
|
+
:return_type => return_type
|
|
470
|
+
)
|
|
471
|
+
|
|
472
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
473
|
+
if @api_client.config.debugging
|
|
474
|
+
@api_client.config.logger.debug "API called: WebhooksApi#post_user_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
475
|
+
end
|
|
476
|
+
return data, status_code, headers
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
# Rotate webhook secret
|
|
480
|
+
# Generates a new HMAC signing secret and invalidates the previous one. The new `secret` is shown only in this response.
|
|
481
|
+
# @param id [String] Webhook id.
|
|
482
|
+
# @param [Hash] opts the optional parameters
|
|
483
|
+
# @return [RotateSecretResponse]
|
|
484
|
+
def post_user_webhook_rotate_secret(id, opts = {})
|
|
485
|
+
data, _status_code, _headers = post_user_webhook_rotate_secret_with_http_info(id, opts)
|
|
486
|
+
data
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
# Rotate webhook secret
|
|
490
|
+
# Generates a new HMAC signing secret and invalidates the previous one. The new `secret` is shown only in this response.
|
|
491
|
+
# @param id [String] Webhook id.
|
|
492
|
+
# @param [Hash] opts the optional parameters
|
|
493
|
+
# @return [Array<(RotateSecretResponse, Integer, Hash)>] RotateSecretResponse data, response status code and response headers
|
|
494
|
+
def post_user_webhook_rotate_secret_with_http_info(id, opts = {})
|
|
495
|
+
if @api_client.config.debugging
|
|
496
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.post_user_webhook_rotate_secret ...'
|
|
497
|
+
end
|
|
498
|
+
# verify the required parameter 'id' is set
|
|
499
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
500
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.post_user_webhook_rotate_secret"
|
|
501
|
+
end
|
|
502
|
+
# resource path
|
|
503
|
+
local_var_path = '/user/webhooks/{id}/rotate-secret'.sub('{id}', CGI.escape(id.to_s))
|
|
504
|
+
|
|
505
|
+
# query parameters
|
|
506
|
+
query_params = opts[:query_params] || {}
|
|
507
|
+
|
|
508
|
+
# header parameters
|
|
509
|
+
header_params = opts[:header_params] || {}
|
|
510
|
+
# HTTP header 'Accept' (if needed)
|
|
511
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
512
|
+
|
|
513
|
+
# form parameters
|
|
514
|
+
form_params = opts[:form_params] || {}
|
|
515
|
+
|
|
516
|
+
# http body (model)
|
|
517
|
+
post_body = opts[:debug_body]
|
|
518
|
+
|
|
519
|
+
# return_type
|
|
520
|
+
return_type = opts[:debug_return_type] || 'RotateSecretResponse'
|
|
521
|
+
|
|
522
|
+
# auth_names
|
|
523
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
524
|
+
|
|
525
|
+
new_options = opts.merge(
|
|
526
|
+
:operation => :"WebhooksApi.post_user_webhook_rotate_secret",
|
|
527
|
+
:header_params => header_params,
|
|
528
|
+
:query_params => query_params,
|
|
529
|
+
:form_params => form_params,
|
|
530
|
+
:body => post_body,
|
|
531
|
+
:auth_names => auth_names,
|
|
532
|
+
:return_type => return_type
|
|
533
|
+
)
|
|
534
|
+
|
|
535
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
536
|
+
if @api_client.config.debugging
|
|
537
|
+
@api_client.config.logger.debug "API called: WebhooksApi#post_user_webhook_rotate_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
538
|
+
end
|
|
539
|
+
return data, status_code, headers
|
|
540
|
+
end
|
|
541
|
+
end
|
|
542
|
+
end
|