svix 0.41.0 → 0.48.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +62 -8
- data/lib/svix/api/application_api.rb +23 -1
- data/lib/svix/api/authentication_api.rb +7 -1
- data/lib/svix/api/endpoint_api.rb +61 -18
- data/lib/svix/api/environment_api.rb +158 -0
- data/lib/svix/api/environment_settings_api.rb +82 -0
- data/lib/svix/api/event_type_api.rb +23 -1
- data/lib/svix/api/health_api.rb +6 -1
- data/lib/svix/api/integration_api.rb +627 -0
- data/lib/svix/api/message_api.rb +31 -3
- data/lib/svix/api/message_attempt_api.rb +359 -5
- data/lib/svix/api/organization_api.rb +152 -0
- data/lib/svix/api/organization_settings_api.rb +7 -7
- data/lib/svix/api/statistics_api.rb +7 -1
- data/lib/svix/api_client.rb +1 -1
- data/lib/svix/api_error.rb +1 -1
- data/lib/svix/configuration.rb +1 -1
- data/lib/svix/endpoint_api.rb +1 -1
- data/lib/svix/integration_api.rb +38 -0
- data/lib/svix/internal.rb +1 -0
- data/lib/svix/message_attempt_api.rb +11 -1
- data/lib/svix/models/application_in.rb +1 -1
- data/lib/svix/models/application_out.rb +1 -1
- data/lib/svix/models/attempt_statistics_data.rb +1 -1
- data/lib/svix/models/attempt_statistics_response.rb +1 -1
- data/lib/svix/models/border_radius_config.rb +1 -1
- data/lib/svix/models/border_radius_enum.rb +1 -1
- data/lib/svix/models/custom_theme_override.rb +1 -1
- data/lib/svix/models/dashboard_access_out.rb +1 -1
- data/lib/svix/models/endpoint_created_event.rb +1 -1
- data/lib/svix/models/endpoint_created_event_data.rb +1 -1
- data/lib/svix/models/endpoint_deleted_event.rb +1 -1
- data/lib/svix/models/endpoint_deleted_event_data.rb +1 -1
- data/lib/svix/models/endpoint_disabled_event.rb +1 -1
- data/lib/svix/models/endpoint_disabled_event_data.rb +1 -1
- data/lib/svix/models/endpoint_headers_in.rb +1 -1
- data/lib/svix/models/endpoint_headers_out.rb +1 -1
- data/lib/svix/models/endpoint_in.rb +38 -2
- data/lib/svix/models/endpoint_message_out.rb +38 -2
- data/lib/svix/models/endpoint_out.rb +38 -2
- data/lib/svix/models/endpoint_secret_out.rb +1 -1
- data/lib/svix/models/endpoint_secret_rotate_in.rb +1 -1
- data/lib/svix/models/endpoint_stats.rb +1 -1
- data/lib/svix/models/endpoint_update.rb +38 -2
- data/lib/svix/models/endpoint_updated_event.rb +1 -1
- data/lib/svix/models/endpoint_updated_event_data.rb +1 -1
- data/lib/svix/models/environment_in.rb +257 -0
- data/lib/svix/models/environment_out.rb +259 -0
- data/lib/svix/models/environment_settings_out.rb +308 -0
- data/lib/svix/models/event_example_in.rb +1 -1
- data/lib/svix/models/event_type_example_out.rb +1 -1
- data/lib/svix/models/event_type_in.rb +1 -1
- data/lib/svix/models/event_type_out.rb +1 -1
- data/lib/svix/models/event_type_schema_in.rb +1 -1
- data/lib/svix/models/event_type_update.rb +1 -1
- data/lib/svix/models/export_organization_out.rb +259 -0
- data/lib/svix/models/font_size_config.rb +1 -1
- data/lib/svix/models/http_error_out.rb +1 -1
- data/lib/svix/models/http_validation_error.rb +1 -1
- data/lib/svix/models/import_organization_in.rb +257 -0
- data/lib/svix/models/integration_in.rb +223 -0
- data/lib/svix/models/integration_key_out.rb +223 -0
- data/lib/svix/models/integration_out.rb +265 -0
- data/lib/svix/models/integration_update.rb +223 -0
- data/lib/svix/models/list_response_application_out.rb +1 -1
- data/lib/svix/models/list_response_endpoint_message_out.rb +1 -1
- data/lib/svix/models/list_response_endpoint_out.rb +1 -1
- data/lib/svix/models/list_response_event_type_out.rb +1 -1
- data/lib/svix/models/list_response_integration_out.rb +248 -0
- data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +1 -1
- data/lib/svix/models/list_response_message_attempt_out.rb +1 -1
- data/lib/svix/models/list_response_message_endpoint_out.rb +1 -1
- data/lib/svix/models/list_response_message_out.rb +1 -1
- data/lib/svix/models/message_attempt_endpoint_out.rb +16 -2
- data/lib/svix/models/message_attempt_exhausted_event.rb +1 -1
- data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -1
- data/lib/svix/models/message_attempt_failed_event.rb +1 -1
- data/lib/svix/models/message_attempt_out.rb +1 -1
- data/lib/svix/models/message_attempt_trigger_type.rb +1 -1
- data/lib/svix/models/message_endpoint_out.rb +38 -2
- data/lib/svix/models/message_in.rb +38 -2
- data/lib/svix/models/message_out.rb +38 -2
- data/lib/svix/models/message_status.rb +1 -1
- data/lib/svix/models/portal_settings_out.rb +16 -5
- data/lib/svix/models/recover_in.rb +1 -1
- data/lib/svix/models/settings_in.rb +339 -0
- data/lib/svix/models/settings_out.rb +339 -0
- data/lib/svix/models/statistics_period.rb +1 -1
- data/lib/svix/models/validation_error.rb +1 -1
- data/lib/svix/models/webhook_types.rb +1 -1
- data/lib/svix/svix.rb +2 -0
- data/lib/svix/version.rb +1 -1
- data/lib/svix.rb +8 -2
- metadata +23 -6
data/lib/svix/api/message_api.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
#Svix API
|
3
3
|
|
4
|
-
#Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
|
4
|
+
#Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 1.4
|
7
7
|
|
@@ -20,10 +20,12 @@ module Svix
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Create Message
|
23
|
-
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned.
|
23
|
+
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema.
|
24
24
|
# @param app_id [String]
|
25
25
|
# @param message_in [MessageIn]
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [Boolean] :with_content (default to true)
|
28
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
27
29
|
# @return [MessageOut]
|
28
30
|
def create_message_api_v1_app_app_id_msg_post(app_id, message_in, opts = {})
|
29
31
|
data, _status_code, _headers = create_message_api_v1_app_app_id_msg_post_with_http_info(app_id, message_in, opts)
|
@@ -31,10 +33,12 @@ module Svix
|
|
31
33
|
end
|
32
34
|
|
33
35
|
# Create Message
|
34
|
-
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned.
|
36
|
+
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema.
|
35
37
|
# @param app_id [String]
|
36
38
|
# @param message_in [MessageIn]
|
37
39
|
# @param [Hash] opts the optional parameters
|
40
|
+
# @option opts [Boolean] :with_content
|
41
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
38
42
|
# @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
|
39
43
|
def create_message_api_v1_app_app_id_msg_post_with_http_info(app_id, message_in, opts = {})
|
40
44
|
if @api_client.config.debugging
|
@@ -66,6 +70,7 @@ module Svix
|
|
66
70
|
|
67
71
|
# query parameters
|
68
72
|
query_params = opts[:query_params] || {}
|
73
|
+
query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
|
69
74
|
|
70
75
|
# header parameters
|
71
76
|
header_params = opts[:header_params] || {}
|
@@ -73,6 +78,7 @@ module Svix
|
|
73
78
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
74
79
|
# HTTP header 'Content-Type'
|
75
80
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
81
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
76
82
|
|
77
83
|
# form parameters
|
78
84
|
form_params = opts[:form_params] || {}
|
@@ -108,6 +114,7 @@ module Svix
|
|
108
114
|
# @param msg_id [String]
|
109
115
|
# @param app_id [String]
|
110
116
|
# @param [Hash] opts the optional parameters
|
117
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
111
118
|
# @return [MessageOut]
|
112
119
|
def get_message_api_v1_app_app_id_msg_msg_id_get(msg_id, app_id, opts = {})
|
113
120
|
data, _status_code, _headers = get_message_api_v1_app_app_id_msg_msg_id_get_with_http_info(msg_id, app_id, opts)
|
@@ -119,6 +126,7 @@ module Svix
|
|
119
126
|
# @param msg_id [String]
|
120
127
|
# @param app_id [String]
|
121
128
|
# @param [Hash] opts the optional parameters
|
129
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
122
130
|
# @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
|
123
131
|
def get_message_api_v1_app_app_id_msg_msg_id_get_with_http_info(msg_id, app_id, opts = {})
|
124
132
|
if @api_client.config.debugging
|
@@ -168,6 +176,7 @@ module Svix
|
|
168
176
|
header_params = opts[:header_params] || {}
|
169
177
|
# HTTP header 'Accept' (if needed)
|
170
178
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
179
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
171
180
|
|
172
181
|
# form parameters
|
173
182
|
form_params = opts[:form_params] || {}
|
@@ -205,7 +214,9 @@ module Svix
|
|
205
214
|
# @option opts [String] :iterator
|
206
215
|
# @option opts [Integer] :limit (default to 50)
|
207
216
|
# @option opts [Array<String>] :event_types
|
217
|
+
# @option opts [String] :channel
|
208
218
|
# @option opts [Time] :before
|
219
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
209
220
|
# @return [ListResponseMessageOut]
|
210
221
|
def list_messages_api_v1_app_app_id_msg_get(app_id, opts = {})
|
211
222
|
data, _status_code, _headers = list_messages_api_v1_app_app_id_msg_get_with_http_info(app_id, opts)
|
@@ -219,7 +230,9 @@ module Svix
|
|
219
230
|
# @option opts [String] :iterator
|
220
231
|
# @option opts [Integer] :limit
|
221
232
|
# @option opts [Array<String>] :event_types
|
233
|
+
# @option opts [String] :channel
|
222
234
|
# @option opts [Time] :before
|
235
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
223
236
|
# @return [Array<(ListResponseMessageOut, Integer, Hash)>] ListResponseMessageOut data, response status code and response headers
|
224
237
|
def list_messages_api_v1_app_app_id_msg_get_with_http_info(app_id, opts = {})
|
225
238
|
if @api_client.config.debugging
|
@@ -242,6 +255,19 @@ module Svix
|
|
242
255
|
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.list_messages_api_v1_app_app_id_msg_get, must conform to the pattern #{pattern}."
|
243
256
|
end
|
244
257
|
|
258
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
259
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.list_messages_api_v1_app_app_id_msg_get, must be smaller than or equal to 250.'
|
260
|
+
end
|
261
|
+
|
262
|
+
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
|
263
|
+
fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageApi.list_messages_api_v1_app_app_id_msg_get, the character length must be smaller than or equal to 128.'
|
264
|
+
end
|
265
|
+
|
266
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
267
|
+
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
|
268
|
+
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.list_messages_api_v1_app_app_id_msg_get, must conform to the pattern #{pattern}."
|
269
|
+
end
|
270
|
+
|
245
271
|
# resource path
|
246
272
|
local_var_path = '/api/v1/app/{app_id}/msg/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
247
273
|
|
@@ -250,12 +276,14 @@ module Svix
|
|
250
276
|
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
251
277
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
252
278
|
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
279
|
+
query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
|
253
280
|
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
254
281
|
|
255
282
|
# header parameters
|
256
283
|
header_params = opts[:header_params] || {}
|
257
284
|
# HTTP header 'Accept' (if needed)
|
258
285
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
286
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
259
287
|
|
260
288
|
# form parameters
|
261
289
|
form_params = opts[:form_params] || {}
|