sendmux-management 1.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/CHANGELOG.md +12 -0
- data/README.md +3 -0
- data/lib/sendmux/management/client.rb +66 -0
- data/lib/sendmux/management/version.rb +7 -0
- data/lib/sendmux/management.rb +12 -0
- data/lib/sendmux_management_generated/api/billing_api.rb +221 -0
- data/lib/sendmux_management_generated/api/domain_filters_api.rb +161 -0
- data/lib/sendmux_management_generated/api/domains_api.rb +419 -0
- data/lib/sendmux_management_generated/api/emails_api.rb +258 -0
- data/lib/sendmux_management_generated/api/inboxes_api.rb +175 -0
- data/lib/sendmux_management_generated/api/mailbox_filters_api.rb +161 -0
- data/lib/sendmux_management_generated/api/mailboxes_api.rb +659 -0
- data/lib/sendmux_management_generated/api/sending_accounts_api.rb +946 -0
- data/lib/sendmux_management_generated/api/webhooks_api.rb +666 -0
- data/lib/sendmux_management_generated/api_client.rb +441 -0
- data/lib/sendmux_management_generated/api_error.rb +58 -0
- data/lib/sendmux_management_generated/api_model_base.rb +88 -0
- data/lib/sendmux_management_generated/configuration.rb +393 -0
- data/lib/sendmux_management_generated/models/api_error_detail.rb +219 -0
- data/lib/sendmux_management_generated/models/api_error_error.rb +275 -0
- data/lib/sendmux_management_generated/models/api_error_meta.rb +164 -0
- data/lib/sendmux_management_generated/models/api_error_response.rb +216 -0
- data/lib/sendmux_management_generated/models/balance.rb +293 -0
- data/lib/sendmux_management_generated/models/balance_auto_topup.rb +226 -0
- data/lib/sendmux_management_generated/models/balance_response.rb +223 -0
- data/lib/sendmux_management_generated/models/cursor_pagination.rb +173 -0
- data/lib/sendmux_management_generated/models/delivery_log_item.rb +393 -0
- data/lib/sendmux_management_generated/models/delivery_log_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/delivery_log_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/domain_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/domain_deleted_response_all_of_data.rb +190 -0
- data/lib/sendmux_management_generated/models/domain_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/domain_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/domain_verify_response.rb +223 -0
- data/lib/sendmux_management_generated/models/email_metrics.rb +218 -0
- data/lib/sendmux_management_generated/models/email_metrics_comparison.rb +294 -0
- data/lib/sendmux_management_generated/models/email_metrics_comparison_change_pct.rb +268 -0
- data/lib/sendmux_management_generated/models/email_metrics_response.rb +223 -0
- data/lib/sendmux_management_generated/models/email_metrics_summary.rb +268 -0
- data/lib/sendmux_management_generated/models/email_metrics_timeseries_inner.rb +294 -0
- data/lib/sendmux_management_generated/models/filter_rule.rb +242 -0
- data/lib/sendmux_management_generated/models/filter_state.rb +218 -0
- data/lib/sendmux_management_generated/models/filter_state_response.rb +223 -0
- data/lib/sendmux_management_generated/models/incoming_log_item.rb +465 -0
- data/lib/sendmux_management_generated/models/incoming_log_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/incoming_log_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox.rb +284 -0
- data/lib/sendmux_management_generated/models/mailbox_app_password_result.rb +164 -0
- data/lib/sendmux_management_generated/models/mailbox_app_password_result_credential.rb +359 -0
- data/lib/sendmux_management_generated/models/mailbox_app_password_result_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_create_result.rb +189 -0
- data/lib/sendmux_management_generated/models/mailbox_create_result_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_credential.rb +353 -0
- data/lib/sendmux_management_generated/models/mailbox_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_domain.rb +358 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_dns_records.rb +276 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_mx_record.rb +190 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_name_value_record.rb +191 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_verify_checks.rb +246 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_verify_result.rb +242 -0
- data/lib/sendmux_management_generated/models/mailbox_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/mailbox_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_key_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_send_scope.rb +213 -0
- data/lib/sendmux_management_generated/models/management_create_domain_request.rb +165 -0
- data/lib/sendmux_management_generated/models/management_create_mailbox_key_request.rb +182 -0
- data/lib/sendmux_management_generated/models/management_create_mailbox_request.rb +257 -0
- data/lib/sendmux_management_generated/models/management_create_mailbox_request_send_scope.rb +210 -0
- data/lib/sendmux_management_generated/models/management_test_webhook200_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_allowed_actions.rb +268 -0
- data/lib/sendmux_management_generated/models/provider_create_body.rb +579 -0
- data/lib/sendmux_management_generated/models/provider_create_body_quotas.rb +174 -0
- data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day.rb +104 -0
- data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day_any_of.rb +215 -0
- data/lib/sendmux_management_generated/models/provider_deleted.rb +190 -0
- data/lib/sendmux_management_generated/models/provider_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_item.rb +695 -0
- data/lib/sendmux_management_generated/models/provider_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/provider_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_limits.rb +190 -0
- data/lib/sendmux_management_generated/models/provider_limits_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_quota_range.rb +208 -0
- data/lib/sendmux_management_generated/models/provider_quotas.rb +186 -0
- data/lib/sendmux_management_generated/models/provider_stats.rb +325 -0
- data/lib/sendmux_management_generated/models/provider_stats_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_status_counts.rb +242 -0
- data/lib/sendmux_management_generated/models/provider_test_result.rb +251 -0
- data/lib/sendmux_management_generated/models/provider_test_result_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_type_counts.rb +246 -0
- data/lib/sendmux_management_generated/models/provider_update_body.rb +537 -0
- data/lib/sendmux_management_generated/models/provider_usage.rb +216 -0
- data/lib/sendmux_management_generated/models/provider_usage_item.rb +374 -0
- data/lib/sendmux_management_generated/models/provider_usage_response.rb +223 -0
- data/lib/sendmux_management_generated/models/resource_limit_snapshot.rb +420 -0
- data/lib/sendmux_management_generated/models/response_meta.rb +164 -0
- data/lib/sendmux_management_generated/models/sending_account_limit_request.rb +190 -0
- data/lib/sendmux_management_generated/models/sending_account_limit_request_response.rb +223 -0
- data/lib/sendmux_management_generated/models/set_filter_state_body.rb +226 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit.rb +315 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request.rb +361 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create.rb +190 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_request.rb +368 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_response.rb +223 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page.rb +176 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page_response.rb +223 -0
- data/lib/sendmux_management_generated/models/spend_summary.rb +292 -0
- data/lib/sendmux_management_generated/models/spend_summary_response.rb +223 -0
- data/lib/sendmux_management_generated/models/success_envelope.rb +192 -0
- data/lib/sendmux_management_generated/models/transaction.rb +332 -0
- data/lib/sendmux_management_generated/models/transaction_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/update_mailbox_body.rb +210 -0
- data/lib/sendmux_management_generated/models/webhook_create_body.rb +269 -0
- data/lib/sendmux_management_generated/models/webhook_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_attempt.rb +562 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_attempt_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_payload.rb +359 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_payload_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_event_data.rb +395 -0
- data/lib/sendmux_management_generated/models/webhook_event_payload.rb +297 -0
- data/lib/sendmux_management_generated/models/webhook_filters.rb +168 -0
- data/lib/sendmux_management_generated/models/webhook_subscription.rb +380 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_with_secret.rb +414 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_with_secret_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_test_response.rb +165 -0
- data/lib/sendmux_management_generated/models/webhook_update_body.rb +233 -0
- data/lib/sendmux_management_generated/version.rb +15 -0
- data/lib/sendmux_management_generated.rb +158 -0
- metadata +247 -0
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.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 Sendmux::Management::Generated
|
|
16
|
+
class WebhooksApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a webhook subscription
|
|
23
|
+
# Creates a new webhook subscription and returns the signing secret ONCE in the response body. Store it securely — it cannot be retrieved later. Use `POST /webhooks/{id}/rotate-secret` to issue a new one. Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :idempotency_key
|
|
26
|
+
# @option opts [WebhookCreateBody] :webhook_create_body
|
|
27
|
+
# @return [WebhookSubscriptionWithSecretResponse]
|
|
28
|
+
def management_create_webhook(opts = {})
|
|
29
|
+
data, _status_code, _headers = management_create_webhook_with_http_info(opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create a webhook subscription
|
|
34
|
+
# Creates a new webhook subscription and returns the signing secret ONCE in the response body. Store it securely — it cannot be retrieved later. Use `POST /webhooks/{id}/rotate-secret` to issue a new one. Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @option opts [String] :idempotency_key
|
|
37
|
+
# @option opts [WebhookCreateBody] :webhook_create_body
|
|
38
|
+
# @return [Array<(WebhookSubscriptionWithSecretResponse, Integer, Hash)>] WebhookSubscriptionWithSecretResponse data, response status code and response headers
|
|
39
|
+
def management_create_webhook_with_http_info(opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_create_webhook ...'
|
|
42
|
+
end
|
|
43
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
|
|
44
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WebhooksApi.management_create_webhook, the character length must be smaller than or equal to 255.'
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# resource path
|
|
48
|
+
local_var_path = '/webhooks'
|
|
49
|
+
|
|
50
|
+
# query parameters
|
|
51
|
+
query_params = opts[:query_params] || {}
|
|
52
|
+
|
|
53
|
+
# header parameters
|
|
54
|
+
header_params = opts[:header_params] || {}
|
|
55
|
+
# HTTP header 'Accept' (if needed)
|
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
57
|
+
# HTTP header 'Content-Type'
|
|
58
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
59
|
+
if !content_type.nil?
|
|
60
|
+
header_params['Content-Type'] = content_type
|
|
61
|
+
end
|
|
62
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
63
|
+
|
|
64
|
+
# form parameters
|
|
65
|
+
form_params = opts[:form_params] || {}
|
|
66
|
+
|
|
67
|
+
# http body (model)
|
|
68
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'webhook_create_body'])
|
|
69
|
+
|
|
70
|
+
# return_type
|
|
71
|
+
return_type = opts[:debug_return_type] || 'WebhookSubscriptionWithSecretResponse'
|
|
72
|
+
|
|
73
|
+
# auth_names
|
|
74
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
75
|
+
|
|
76
|
+
new_options = opts.merge(
|
|
77
|
+
:operation => :"WebhooksApi.management_create_webhook",
|
|
78
|
+
:header_params => header_params,
|
|
79
|
+
:query_params => query_params,
|
|
80
|
+
:form_params => form_params,
|
|
81
|
+
:body => post_body,
|
|
82
|
+
:auth_names => auth_names,
|
|
83
|
+
:return_type => return_type
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
87
|
+
if @api_client.config.debugging
|
|
88
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
89
|
+
end
|
|
90
|
+
return data, status_code, headers
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Delete a webhook subscription
|
|
94
|
+
# Permanently removes the subscription. In-flight retries are dropped.
|
|
95
|
+
# @param public_id [String]
|
|
96
|
+
# @param [Hash] opts the optional parameters
|
|
97
|
+
# @return [WebhookDeletedResponse]
|
|
98
|
+
def management_delete_webhook(public_id, opts = {})
|
|
99
|
+
data, _status_code, _headers = management_delete_webhook_with_http_info(public_id, opts)
|
|
100
|
+
data
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Delete a webhook subscription
|
|
104
|
+
# Permanently removes the subscription. In-flight retries are dropped.
|
|
105
|
+
# @param public_id [String]
|
|
106
|
+
# @param [Hash] opts the optional parameters
|
|
107
|
+
# @return [Array<(WebhookDeletedResponse, Integer, Hash)>] WebhookDeletedResponse data, response status code and response headers
|
|
108
|
+
def management_delete_webhook_with_http_info(public_id, opts = {})
|
|
109
|
+
if @api_client.config.debugging
|
|
110
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_delete_webhook ...'
|
|
111
|
+
end
|
|
112
|
+
# verify the required parameter 'public_id' is set
|
|
113
|
+
if @api_client.config.client_side_validation && public_id.nil?
|
|
114
|
+
fail ArgumentError, "Missing the required parameter 'public_id' when calling WebhooksApi.management_delete_webhook"
|
|
115
|
+
end
|
|
116
|
+
# resource path
|
|
117
|
+
local_var_path = '/webhooks/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s))
|
|
118
|
+
|
|
119
|
+
# query parameters
|
|
120
|
+
query_params = opts[:query_params] || {}
|
|
121
|
+
|
|
122
|
+
# header parameters
|
|
123
|
+
header_params = opts[:header_params] || {}
|
|
124
|
+
# HTTP header 'Accept' (if needed)
|
|
125
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
126
|
+
|
|
127
|
+
# form parameters
|
|
128
|
+
form_params = opts[:form_params] || {}
|
|
129
|
+
|
|
130
|
+
# http body (model)
|
|
131
|
+
post_body = opts[:debug_body]
|
|
132
|
+
|
|
133
|
+
# return_type
|
|
134
|
+
return_type = opts[:debug_return_type] || 'WebhookDeletedResponse'
|
|
135
|
+
|
|
136
|
+
# auth_names
|
|
137
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
138
|
+
|
|
139
|
+
new_options = opts.merge(
|
|
140
|
+
:operation => :"WebhooksApi.management_delete_webhook",
|
|
141
|
+
:header_params => header_params,
|
|
142
|
+
:query_params => query_params,
|
|
143
|
+
:form_params => form_params,
|
|
144
|
+
:body => post_body,
|
|
145
|
+
:auth_names => auth_names,
|
|
146
|
+
:return_type => return_type
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
150
|
+
if @api_client.config.debugging
|
|
151
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
152
|
+
end
|
|
153
|
+
return data, status_code, headers
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Get a webhook delivery payload
|
|
157
|
+
# Returns the retained JSON request body for one delivery attempt. Payloads are retained for 7 days and may no longer be available after `payload_expires_at`.
|
|
158
|
+
# @param public_id [String]
|
|
159
|
+
# @param delivery_id [String]
|
|
160
|
+
# @param [Hash] opts the optional parameters
|
|
161
|
+
# @return [WebhookDeliveryPayloadResponse]
|
|
162
|
+
def management_get_delivery_payload(public_id, delivery_id, opts = {})
|
|
163
|
+
data, _status_code, _headers = management_get_delivery_payload_with_http_info(public_id, delivery_id, opts)
|
|
164
|
+
data
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Get a webhook delivery payload
|
|
168
|
+
# Returns the retained JSON request body for one delivery attempt. Payloads are retained for 7 days and may no longer be available after `payload_expires_at`.
|
|
169
|
+
# @param public_id [String]
|
|
170
|
+
# @param delivery_id [String]
|
|
171
|
+
# @param [Hash] opts the optional parameters
|
|
172
|
+
# @return [Array<(WebhookDeliveryPayloadResponse, Integer, Hash)>] WebhookDeliveryPayloadResponse data, response status code and response headers
|
|
173
|
+
def management_get_delivery_payload_with_http_info(public_id, delivery_id, opts = {})
|
|
174
|
+
if @api_client.config.debugging
|
|
175
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_get_delivery_payload ...'
|
|
176
|
+
end
|
|
177
|
+
# verify the required parameter 'public_id' is set
|
|
178
|
+
if @api_client.config.client_side_validation && public_id.nil?
|
|
179
|
+
fail ArgumentError, "Missing the required parameter 'public_id' when calling WebhooksApi.management_get_delivery_payload"
|
|
180
|
+
end
|
|
181
|
+
# verify the required parameter 'delivery_id' is set
|
|
182
|
+
if @api_client.config.client_side_validation && delivery_id.nil?
|
|
183
|
+
fail ArgumentError, "Missing the required parameter 'delivery_id' when calling WebhooksApi.management_get_delivery_payload"
|
|
184
|
+
end
|
|
185
|
+
# resource path
|
|
186
|
+
local_var_path = '/webhooks/{public_id}/deliveries/{delivery_id}/payload'.sub('{public_id}', CGI.escape(public_id.to_s)).sub('{delivery_id}', CGI.escape(delivery_id.to_s))
|
|
187
|
+
|
|
188
|
+
# query parameters
|
|
189
|
+
query_params = opts[:query_params] || {}
|
|
190
|
+
|
|
191
|
+
# header parameters
|
|
192
|
+
header_params = opts[:header_params] || {}
|
|
193
|
+
# HTTP header 'Accept' (if needed)
|
|
194
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
195
|
+
|
|
196
|
+
# form parameters
|
|
197
|
+
form_params = opts[:form_params] || {}
|
|
198
|
+
|
|
199
|
+
# http body (model)
|
|
200
|
+
post_body = opts[:debug_body]
|
|
201
|
+
|
|
202
|
+
# return_type
|
|
203
|
+
return_type = opts[:debug_return_type] || 'WebhookDeliveryPayloadResponse'
|
|
204
|
+
|
|
205
|
+
# auth_names
|
|
206
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
207
|
+
|
|
208
|
+
new_options = opts.merge(
|
|
209
|
+
:operation => :"WebhooksApi.management_get_delivery_payload",
|
|
210
|
+
:header_params => header_params,
|
|
211
|
+
:query_params => query_params,
|
|
212
|
+
:form_params => form_params,
|
|
213
|
+
:body => post_body,
|
|
214
|
+
:auth_names => auth_names,
|
|
215
|
+
:return_type => return_type
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
219
|
+
if @api_client.config.debugging
|
|
220
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_get_delivery_payload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
221
|
+
end
|
|
222
|
+
return data, status_code, headers
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Get a webhook subscription
|
|
226
|
+
# Returns a single webhook subscription. The signing secret is never included. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed. The same ETag is the value to use in `If-Match` on PATCH for optimistic concurrency.
|
|
227
|
+
# @param public_id [String]
|
|
228
|
+
# @param [Hash] opts the optional parameters
|
|
229
|
+
# @option opts [String] :if_none_match
|
|
230
|
+
# @return [WebhookSubscriptionResponse]
|
|
231
|
+
def management_get_webhook(public_id, opts = {})
|
|
232
|
+
data, _status_code, _headers = management_get_webhook_with_http_info(public_id, opts)
|
|
233
|
+
data
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Get a webhook subscription
|
|
237
|
+
# Returns a single webhook subscription. The signing secret is never included. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed. The same ETag is the value to use in `If-Match` on PATCH for optimistic concurrency.
|
|
238
|
+
# @param public_id [String]
|
|
239
|
+
# @param [Hash] opts the optional parameters
|
|
240
|
+
# @option opts [String] :if_none_match
|
|
241
|
+
# @return [Array<(WebhookSubscriptionResponse, Integer, Hash)>] WebhookSubscriptionResponse data, response status code and response headers
|
|
242
|
+
def management_get_webhook_with_http_info(public_id, opts = {})
|
|
243
|
+
if @api_client.config.debugging
|
|
244
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_get_webhook ...'
|
|
245
|
+
end
|
|
246
|
+
# verify the required parameter 'public_id' is set
|
|
247
|
+
if @api_client.config.client_side_validation && public_id.nil?
|
|
248
|
+
fail ArgumentError, "Missing the required parameter 'public_id' when calling WebhooksApi.management_get_webhook"
|
|
249
|
+
end
|
|
250
|
+
# resource path
|
|
251
|
+
local_var_path = '/webhooks/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s))
|
|
252
|
+
|
|
253
|
+
# query parameters
|
|
254
|
+
query_params = opts[:query_params] || {}
|
|
255
|
+
|
|
256
|
+
# header parameters
|
|
257
|
+
header_params = opts[:header_params] || {}
|
|
258
|
+
# HTTP header 'Accept' (if needed)
|
|
259
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
260
|
+
header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
|
|
261
|
+
|
|
262
|
+
# form parameters
|
|
263
|
+
form_params = opts[:form_params] || {}
|
|
264
|
+
|
|
265
|
+
# http body (model)
|
|
266
|
+
post_body = opts[:debug_body]
|
|
267
|
+
|
|
268
|
+
# return_type
|
|
269
|
+
return_type = opts[:debug_return_type] || 'WebhookSubscriptionResponse'
|
|
270
|
+
|
|
271
|
+
# auth_names
|
|
272
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
273
|
+
|
|
274
|
+
new_options = opts.merge(
|
|
275
|
+
:operation => :"WebhooksApi.management_get_webhook",
|
|
276
|
+
:header_params => header_params,
|
|
277
|
+
:query_params => query_params,
|
|
278
|
+
:form_params => form_params,
|
|
279
|
+
:body => post_body,
|
|
280
|
+
:auth_names => auth_names,
|
|
281
|
+
:return_type => return_type
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
285
|
+
if @api_client.config.debugging
|
|
286
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
287
|
+
end
|
|
288
|
+
return data, status_code, headers
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# List webhook delivery attempts
|
|
292
|
+
# Returns recent delivery attempts for one webhook subscription, ordered by `created_at` descending. Delivery metadata is retained for 7 days. Use the payload endpoint while `payload_available` is true to inspect the exact JSON request body that was delivered.
|
|
293
|
+
# @param public_id [String]
|
|
294
|
+
# @param [Hash] opts the optional parameters
|
|
295
|
+
# @option opts [String] :cursor
|
|
296
|
+
# @option opts [Integer] :limit
|
|
297
|
+
# @option opts [String] :event_type
|
|
298
|
+
# @option opts [String] :result
|
|
299
|
+
# @return [WebhookDeliveryAttemptCursorListResponse]
|
|
300
|
+
def management_list_delivery(public_id, opts = {})
|
|
301
|
+
data, _status_code, _headers = management_list_delivery_with_http_info(public_id, opts)
|
|
302
|
+
data
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# List webhook delivery attempts
|
|
306
|
+
# Returns recent delivery attempts for one webhook subscription, ordered by `created_at` descending. Delivery metadata is retained for 7 days. Use the payload endpoint while `payload_available` is true to inspect the exact JSON request body that was delivered.
|
|
307
|
+
# @param public_id [String]
|
|
308
|
+
# @param [Hash] opts the optional parameters
|
|
309
|
+
# @option opts [String] :cursor
|
|
310
|
+
# @option opts [Integer] :limit
|
|
311
|
+
# @option opts [String] :event_type
|
|
312
|
+
# @option opts [String] :result
|
|
313
|
+
# @return [Array<(WebhookDeliveryAttemptCursorListResponse, Integer, Hash)>] WebhookDeliveryAttemptCursorListResponse data, response status code and response headers
|
|
314
|
+
def management_list_delivery_with_http_info(public_id, opts = {})
|
|
315
|
+
if @api_client.config.debugging
|
|
316
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_list_delivery ...'
|
|
317
|
+
end
|
|
318
|
+
# verify the required parameter 'public_id' is set
|
|
319
|
+
if @api_client.config.client_side_validation && public_id.nil?
|
|
320
|
+
fail ArgumentError, "Missing the required parameter 'public_id' when calling WebhooksApi.management_list_delivery"
|
|
321
|
+
end
|
|
322
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
323
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WebhooksApi.management_list_delivery, must be smaller than or equal to 100.'
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
327
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WebhooksApi.management_list_delivery, must be greater than or equal to 1.'
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
allowable_values = ["message.delivered", "message.bounced", "message.complained", "message.rejected", "message.delivery_delayed", "message.received", "message.received.spam", "sendmux.test", "unknown_default_open_api"]
|
|
331
|
+
if @api_client.config.client_side_validation && opts[:'event_type'] && !allowable_values.include?(opts[:'event_type'])
|
|
332
|
+
fail ArgumentError, "invalid value for \"event_type\", must be one of #{allowable_values}"
|
|
333
|
+
end
|
|
334
|
+
allowable_values = ["success", "retrying", "failed", "permanent_failure", "unknown_default_open_api"]
|
|
335
|
+
if @api_client.config.client_side_validation && opts[:'result'] && !allowable_values.include?(opts[:'result'])
|
|
336
|
+
fail ArgumentError, "invalid value for \"result\", must be one of #{allowable_values}"
|
|
337
|
+
end
|
|
338
|
+
# resource path
|
|
339
|
+
local_var_path = '/webhooks/{public_id}/deliveries'.sub('{public_id}', CGI.escape(public_id.to_s))
|
|
340
|
+
|
|
341
|
+
# query parameters
|
|
342
|
+
query_params = opts[:query_params] || {}
|
|
343
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
344
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
345
|
+
query_params[:'event_type'] = opts[:'event_type'] if !opts[:'event_type'].nil?
|
|
346
|
+
query_params[:'result'] = opts[:'result'] if !opts[:'result'].nil?
|
|
347
|
+
|
|
348
|
+
# header parameters
|
|
349
|
+
header_params = opts[:header_params] || {}
|
|
350
|
+
# HTTP header 'Accept' (if needed)
|
|
351
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
352
|
+
|
|
353
|
+
# form parameters
|
|
354
|
+
form_params = opts[:form_params] || {}
|
|
355
|
+
|
|
356
|
+
# http body (model)
|
|
357
|
+
post_body = opts[:debug_body]
|
|
358
|
+
|
|
359
|
+
# return_type
|
|
360
|
+
return_type = opts[:debug_return_type] || 'WebhookDeliveryAttemptCursorListResponse'
|
|
361
|
+
|
|
362
|
+
# auth_names
|
|
363
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
364
|
+
|
|
365
|
+
new_options = opts.merge(
|
|
366
|
+
:operation => :"WebhooksApi.management_list_delivery",
|
|
367
|
+
:header_params => header_params,
|
|
368
|
+
:query_params => query_params,
|
|
369
|
+
:form_params => form_params,
|
|
370
|
+
:body => post_body,
|
|
371
|
+
:auth_names => auth_names,
|
|
372
|
+
:return_type => return_type
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
376
|
+
if @api_client.config.debugging
|
|
377
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_list_delivery\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
378
|
+
end
|
|
379
|
+
return data, status_code, headers
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
# List webhook subscriptions
|
|
383
|
+
# Returns a cursor-paginated list of webhook subscriptions configured for the team, ordered by `created_at` descending. The signing secret is never included. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
|
|
384
|
+
# @param [Hash] opts the optional parameters
|
|
385
|
+
# @option opts [String] :cursor
|
|
386
|
+
# @option opts [Integer] :limit
|
|
387
|
+
# @return [WebhookSubscriptionCursorListResponse]
|
|
388
|
+
def management_list_webhooks(opts = {})
|
|
389
|
+
data, _status_code, _headers = management_list_webhooks_with_http_info(opts)
|
|
390
|
+
data
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# List webhook subscriptions
|
|
394
|
+
# Returns a cursor-paginated list of webhook subscriptions configured for the team, ordered by `created_at` descending. The signing secret is never included. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
|
|
395
|
+
# @param [Hash] opts the optional parameters
|
|
396
|
+
# @option opts [String] :cursor
|
|
397
|
+
# @option opts [Integer] :limit
|
|
398
|
+
# @return [Array<(WebhookSubscriptionCursorListResponse, Integer, Hash)>] WebhookSubscriptionCursorListResponse data, response status code and response headers
|
|
399
|
+
def management_list_webhooks_with_http_info(opts = {})
|
|
400
|
+
if @api_client.config.debugging
|
|
401
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_list_webhooks ...'
|
|
402
|
+
end
|
|
403
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
404
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WebhooksApi.management_list_webhooks, must be smaller than or equal to 100.'
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
408
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WebhooksApi.management_list_webhooks, must be greater than or equal to 1.'
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# resource path
|
|
412
|
+
local_var_path = '/webhooks'
|
|
413
|
+
|
|
414
|
+
# query parameters
|
|
415
|
+
query_params = opts[:query_params] || {}
|
|
416
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
417
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
418
|
+
|
|
419
|
+
# header parameters
|
|
420
|
+
header_params = opts[:header_params] || {}
|
|
421
|
+
# HTTP header 'Accept' (if needed)
|
|
422
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
423
|
+
|
|
424
|
+
# form parameters
|
|
425
|
+
form_params = opts[:form_params] || {}
|
|
426
|
+
|
|
427
|
+
# http body (model)
|
|
428
|
+
post_body = opts[:debug_body]
|
|
429
|
+
|
|
430
|
+
# return_type
|
|
431
|
+
return_type = opts[:debug_return_type] || 'WebhookSubscriptionCursorListResponse'
|
|
432
|
+
|
|
433
|
+
# auth_names
|
|
434
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
435
|
+
|
|
436
|
+
new_options = opts.merge(
|
|
437
|
+
:operation => :"WebhooksApi.management_list_webhooks",
|
|
438
|
+
:header_params => header_params,
|
|
439
|
+
:query_params => query_params,
|
|
440
|
+
:form_params => form_params,
|
|
441
|
+
:body => post_body,
|
|
442
|
+
:auth_names => auth_names,
|
|
443
|
+
:return_type => return_type
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
447
|
+
if @api_client.config.debugging
|
|
448
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
449
|
+
end
|
|
450
|
+
return data, status_code, headers
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# Rotate the signing secret
|
|
454
|
+
# Generates a fresh signing secret and returns it ONCE. The old secret is immediately invalidated — the next event delivery is signed with the new secret. Store the new value securely; it cannot be retrieved later. Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original rotation response rather than minting a fresh secret. Replays against a different `public_id` under the same key return `409 idempotency_conflict`.
|
|
455
|
+
# @param public_id [String]
|
|
456
|
+
# @param [Hash] opts the optional parameters
|
|
457
|
+
# @option opts [String] :idempotency_key
|
|
458
|
+
# @return [WebhookSubscriptionWithSecretResponse]
|
|
459
|
+
def management_rotate_webhook_secret(public_id, opts = {})
|
|
460
|
+
data, _status_code, _headers = management_rotate_webhook_secret_with_http_info(public_id, opts)
|
|
461
|
+
data
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
# Rotate the signing secret
|
|
465
|
+
# Generates a fresh signing secret and returns it ONCE. The old secret is immediately invalidated — the next event delivery is signed with the new secret. Store the new value securely; it cannot be retrieved later. Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original rotation response rather than minting a fresh secret. Replays against a different `public_id` under the same key return `409 idempotency_conflict`.
|
|
466
|
+
# @param public_id [String]
|
|
467
|
+
# @param [Hash] opts the optional parameters
|
|
468
|
+
# @option opts [String] :idempotency_key
|
|
469
|
+
# @return [Array<(WebhookSubscriptionWithSecretResponse, Integer, Hash)>] WebhookSubscriptionWithSecretResponse data, response status code and response headers
|
|
470
|
+
def management_rotate_webhook_secret_with_http_info(public_id, opts = {})
|
|
471
|
+
if @api_client.config.debugging
|
|
472
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_rotate_webhook_secret ...'
|
|
473
|
+
end
|
|
474
|
+
# verify the required parameter 'public_id' is set
|
|
475
|
+
if @api_client.config.client_side_validation && public_id.nil?
|
|
476
|
+
fail ArgumentError, "Missing the required parameter 'public_id' when calling WebhooksApi.management_rotate_webhook_secret"
|
|
477
|
+
end
|
|
478
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
|
|
479
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WebhooksApi.management_rotate_webhook_secret, the character length must be smaller than or equal to 255.'
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
# resource path
|
|
483
|
+
local_var_path = '/webhooks/{public_id}/rotate-secret'.sub('{public_id}', CGI.escape(public_id.to_s))
|
|
484
|
+
|
|
485
|
+
# query parameters
|
|
486
|
+
query_params = opts[:query_params] || {}
|
|
487
|
+
|
|
488
|
+
# header parameters
|
|
489
|
+
header_params = opts[:header_params] || {}
|
|
490
|
+
# HTTP header 'Accept' (if needed)
|
|
491
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
492
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
493
|
+
|
|
494
|
+
# form parameters
|
|
495
|
+
form_params = opts[:form_params] || {}
|
|
496
|
+
|
|
497
|
+
# http body (model)
|
|
498
|
+
post_body = opts[:debug_body]
|
|
499
|
+
|
|
500
|
+
# return_type
|
|
501
|
+
return_type = opts[:debug_return_type] || 'WebhookSubscriptionWithSecretResponse'
|
|
502
|
+
|
|
503
|
+
# auth_names
|
|
504
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
505
|
+
|
|
506
|
+
new_options = opts.merge(
|
|
507
|
+
:operation => :"WebhooksApi.management_rotate_webhook_secret",
|
|
508
|
+
:header_params => header_params,
|
|
509
|
+
:query_params => query_params,
|
|
510
|
+
:form_params => form_params,
|
|
511
|
+
:body => post_body,
|
|
512
|
+
:auth_names => auth_names,
|
|
513
|
+
:return_type => return_type
|
|
514
|
+
)
|
|
515
|
+
|
|
516
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
517
|
+
if @api_client.config.debugging
|
|
518
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_rotate_webhook_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
519
|
+
end
|
|
520
|
+
return data, status_code, headers
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
# Send a synthetic test event
|
|
524
|
+
# Publishes a synthetic `sendmux.test` event to this webhook subscription. The subscription must include `\"sendmux.test\"` in `event_types`, and mailbox filters do not block the test delivery. Returns the generated `event_id` so you can correlate the `X-Sendmux-Event-Id` header on your endpoint. Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original `event_id` rather than publishing a second test event.
|
|
525
|
+
# @param public_id [String]
|
|
526
|
+
# @param [Hash] opts the optional parameters
|
|
527
|
+
# @option opts [String] :idempotency_key
|
|
528
|
+
# @return [ManagementTestWebhook200Response]
|
|
529
|
+
def management_test_webhook(public_id, opts = {})
|
|
530
|
+
data, _status_code, _headers = management_test_webhook_with_http_info(public_id, opts)
|
|
531
|
+
data
|
|
532
|
+
end
|
|
533
|
+
|
|
534
|
+
# Send a synthetic test event
|
|
535
|
+
# Publishes a synthetic `sendmux.test` event to this webhook subscription. The subscription must include `\"sendmux.test\"` in `event_types`, and mailbox filters do not block the test delivery. Returns the generated `event_id` so you can correlate the `X-Sendmux-Event-Id` header on your endpoint. Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original `event_id` rather than publishing a second test event.
|
|
536
|
+
# @param public_id [String]
|
|
537
|
+
# @param [Hash] opts the optional parameters
|
|
538
|
+
# @option opts [String] :idempotency_key
|
|
539
|
+
# @return [Array<(ManagementTestWebhook200Response, Integer, Hash)>] ManagementTestWebhook200Response data, response status code and response headers
|
|
540
|
+
def management_test_webhook_with_http_info(public_id, opts = {})
|
|
541
|
+
if @api_client.config.debugging
|
|
542
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_test_webhook ...'
|
|
543
|
+
end
|
|
544
|
+
# verify the required parameter 'public_id' is set
|
|
545
|
+
if @api_client.config.client_side_validation && public_id.nil?
|
|
546
|
+
fail ArgumentError, "Missing the required parameter 'public_id' when calling WebhooksApi.management_test_webhook"
|
|
547
|
+
end
|
|
548
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
|
|
549
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WebhooksApi.management_test_webhook, the character length must be smaller than or equal to 255.'
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
# resource path
|
|
553
|
+
local_var_path = '/webhooks/{public_id}/test'.sub('{public_id}', CGI.escape(public_id.to_s))
|
|
554
|
+
|
|
555
|
+
# query parameters
|
|
556
|
+
query_params = opts[:query_params] || {}
|
|
557
|
+
|
|
558
|
+
# header parameters
|
|
559
|
+
header_params = opts[:header_params] || {}
|
|
560
|
+
# HTTP header 'Accept' (if needed)
|
|
561
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
562
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
563
|
+
|
|
564
|
+
# form parameters
|
|
565
|
+
form_params = opts[:form_params] || {}
|
|
566
|
+
|
|
567
|
+
# http body (model)
|
|
568
|
+
post_body = opts[:debug_body]
|
|
569
|
+
|
|
570
|
+
# return_type
|
|
571
|
+
return_type = opts[:debug_return_type] || 'ManagementTestWebhook200Response'
|
|
572
|
+
|
|
573
|
+
# auth_names
|
|
574
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
575
|
+
|
|
576
|
+
new_options = opts.merge(
|
|
577
|
+
:operation => :"WebhooksApi.management_test_webhook",
|
|
578
|
+
:header_params => header_params,
|
|
579
|
+
:query_params => query_params,
|
|
580
|
+
:form_params => form_params,
|
|
581
|
+
:body => post_body,
|
|
582
|
+
:auth_names => auth_names,
|
|
583
|
+
:return_type => return_type
|
|
584
|
+
)
|
|
585
|
+
|
|
586
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
587
|
+
if @api_client.config.debugging
|
|
588
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_test_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
589
|
+
end
|
|
590
|
+
return data, status_code, headers
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
# Update a webhook subscription
|
|
594
|
+
# Updates the URL, event types, or enabled flag. Any field omitted from the request body is left unchanged. The signing secret is unaffected — use `POST /webhooks/{id}/rotate-secret` to rotate it. For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
|
|
595
|
+
# @param public_id [String]
|
|
596
|
+
# @param [Hash] opts the optional parameters
|
|
597
|
+
# @option opts [String] :if_match
|
|
598
|
+
# @option opts [WebhookUpdateBody] :webhook_update_body
|
|
599
|
+
# @return [WebhookSubscriptionResponse]
|
|
600
|
+
def management_update_webhook(public_id, opts = {})
|
|
601
|
+
data, _status_code, _headers = management_update_webhook_with_http_info(public_id, opts)
|
|
602
|
+
data
|
|
603
|
+
end
|
|
604
|
+
|
|
605
|
+
# Update a webhook subscription
|
|
606
|
+
# Updates the URL, event types, or enabled flag. Any field omitted from the request body is left unchanged. The signing secret is unaffected — use `POST /webhooks/{id}/rotate-secret` to rotate it. For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
|
|
607
|
+
# @param public_id [String]
|
|
608
|
+
# @param [Hash] opts the optional parameters
|
|
609
|
+
# @option opts [String] :if_match
|
|
610
|
+
# @option opts [WebhookUpdateBody] :webhook_update_body
|
|
611
|
+
# @return [Array<(WebhookSubscriptionResponse, Integer, Hash)>] WebhookSubscriptionResponse data, response status code and response headers
|
|
612
|
+
def management_update_webhook_with_http_info(public_id, opts = {})
|
|
613
|
+
if @api_client.config.debugging
|
|
614
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.management_update_webhook ...'
|
|
615
|
+
end
|
|
616
|
+
# verify the required parameter 'public_id' is set
|
|
617
|
+
if @api_client.config.client_side_validation && public_id.nil?
|
|
618
|
+
fail ArgumentError, "Missing the required parameter 'public_id' when calling WebhooksApi.management_update_webhook"
|
|
619
|
+
end
|
|
620
|
+
# resource path
|
|
621
|
+
local_var_path = '/webhooks/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s))
|
|
622
|
+
|
|
623
|
+
# query parameters
|
|
624
|
+
query_params = opts[:query_params] || {}
|
|
625
|
+
|
|
626
|
+
# header parameters
|
|
627
|
+
header_params = opts[:header_params] || {}
|
|
628
|
+
# HTTP header 'Accept' (if needed)
|
|
629
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
630
|
+
# HTTP header 'Content-Type'
|
|
631
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
632
|
+
if !content_type.nil?
|
|
633
|
+
header_params['Content-Type'] = content_type
|
|
634
|
+
end
|
|
635
|
+
header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
|
|
636
|
+
|
|
637
|
+
# form parameters
|
|
638
|
+
form_params = opts[:form_params] || {}
|
|
639
|
+
|
|
640
|
+
# http body (model)
|
|
641
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'webhook_update_body'])
|
|
642
|
+
|
|
643
|
+
# return_type
|
|
644
|
+
return_type = opts[:debug_return_type] || 'WebhookSubscriptionResponse'
|
|
645
|
+
|
|
646
|
+
# auth_names
|
|
647
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
648
|
+
|
|
649
|
+
new_options = opts.merge(
|
|
650
|
+
:operation => :"WebhooksApi.management_update_webhook",
|
|
651
|
+
:header_params => header_params,
|
|
652
|
+
:query_params => query_params,
|
|
653
|
+
:form_params => form_params,
|
|
654
|
+
:body => post_body,
|
|
655
|
+
:auth_names => auth_names,
|
|
656
|
+
:return_type => return_type
|
|
657
|
+
)
|
|
658
|
+
|
|
659
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
660
|
+
if @api_client.config.debugging
|
|
661
|
+
@api_client.config.logger.debug "API called: WebhooksApi#management_update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
662
|
+
end
|
|
663
|
+
return data, status_code, headers
|
|
664
|
+
end
|
|
665
|
+
end
|
|
666
|
+
end
|