svix 0.41.0 → 0.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +62 -8
  4. data/lib/svix/api/application_api.rb +23 -1
  5. data/lib/svix/api/authentication_api.rb +7 -1
  6. data/lib/svix/api/endpoint_api.rb +61 -18
  7. data/lib/svix/api/environment_api.rb +158 -0
  8. data/lib/svix/api/environment_settings_api.rb +82 -0
  9. data/lib/svix/api/event_type_api.rb +23 -1
  10. data/lib/svix/api/health_api.rb +6 -1
  11. data/lib/svix/api/integration_api.rb +627 -0
  12. data/lib/svix/api/message_api.rb +31 -3
  13. data/lib/svix/api/message_attempt_api.rb +359 -5
  14. data/lib/svix/api/organization_api.rb +152 -0
  15. data/lib/svix/api/organization_settings_api.rb +7 -7
  16. data/lib/svix/api/statistics_api.rb +7 -1
  17. data/lib/svix/api_client.rb +1 -1
  18. data/lib/svix/api_error.rb +1 -1
  19. data/lib/svix/configuration.rb +1 -1
  20. data/lib/svix/endpoint_api.rb +1 -1
  21. data/lib/svix/integration_api.rb +38 -0
  22. data/lib/svix/internal.rb +1 -0
  23. data/lib/svix/message_attempt_api.rb +11 -1
  24. data/lib/svix/models/application_in.rb +1 -1
  25. data/lib/svix/models/application_out.rb +1 -1
  26. data/lib/svix/models/attempt_statistics_data.rb +1 -1
  27. data/lib/svix/models/attempt_statistics_response.rb +1 -1
  28. data/lib/svix/models/border_radius_config.rb +1 -1
  29. data/lib/svix/models/border_radius_enum.rb +1 -1
  30. data/lib/svix/models/custom_theme_override.rb +1 -1
  31. data/lib/svix/models/dashboard_access_out.rb +1 -1
  32. data/lib/svix/models/endpoint_created_event.rb +1 -1
  33. data/lib/svix/models/endpoint_created_event_data.rb +1 -1
  34. data/lib/svix/models/endpoint_deleted_event.rb +1 -1
  35. data/lib/svix/models/endpoint_deleted_event_data.rb +1 -1
  36. data/lib/svix/models/endpoint_disabled_event.rb +1 -1
  37. data/lib/svix/models/endpoint_disabled_event_data.rb +1 -1
  38. data/lib/svix/models/endpoint_headers_in.rb +1 -1
  39. data/lib/svix/models/endpoint_headers_out.rb +1 -1
  40. data/lib/svix/models/endpoint_in.rb +38 -2
  41. data/lib/svix/models/endpoint_message_out.rb +38 -2
  42. data/lib/svix/models/endpoint_out.rb +38 -2
  43. data/lib/svix/models/endpoint_secret_out.rb +1 -1
  44. data/lib/svix/models/endpoint_secret_rotate_in.rb +1 -1
  45. data/lib/svix/models/endpoint_stats.rb +1 -1
  46. data/lib/svix/models/endpoint_update.rb +38 -2
  47. data/lib/svix/models/endpoint_updated_event.rb +1 -1
  48. data/lib/svix/models/endpoint_updated_event_data.rb +1 -1
  49. data/lib/svix/models/environment_in.rb +257 -0
  50. data/lib/svix/models/environment_out.rb +259 -0
  51. data/lib/svix/models/environment_settings_out.rb +308 -0
  52. data/lib/svix/models/event_example_in.rb +1 -1
  53. data/lib/svix/models/event_type_example_out.rb +1 -1
  54. data/lib/svix/models/event_type_in.rb +1 -1
  55. data/lib/svix/models/event_type_out.rb +1 -1
  56. data/lib/svix/models/event_type_schema_in.rb +1 -1
  57. data/lib/svix/models/event_type_update.rb +1 -1
  58. data/lib/svix/models/export_organization_out.rb +259 -0
  59. data/lib/svix/models/font_size_config.rb +1 -1
  60. data/lib/svix/models/http_error_out.rb +1 -1
  61. data/lib/svix/models/http_validation_error.rb +1 -1
  62. data/lib/svix/models/import_organization_in.rb +257 -0
  63. data/lib/svix/models/integration_in.rb +223 -0
  64. data/lib/svix/models/integration_key_out.rb +223 -0
  65. data/lib/svix/models/integration_out.rb +265 -0
  66. data/lib/svix/models/integration_update.rb +223 -0
  67. data/lib/svix/models/list_response_application_out.rb +1 -1
  68. data/lib/svix/models/list_response_endpoint_message_out.rb +1 -1
  69. data/lib/svix/models/list_response_endpoint_out.rb +1 -1
  70. data/lib/svix/models/list_response_event_type_out.rb +1 -1
  71. data/lib/svix/models/list_response_integration_out.rb +248 -0
  72. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +1 -1
  73. data/lib/svix/models/list_response_message_attempt_out.rb +1 -1
  74. data/lib/svix/models/list_response_message_endpoint_out.rb +1 -1
  75. data/lib/svix/models/list_response_message_out.rb +1 -1
  76. data/lib/svix/models/message_attempt_endpoint_out.rb +16 -2
  77. data/lib/svix/models/message_attempt_exhausted_event.rb +1 -1
  78. data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -1
  79. data/lib/svix/models/message_attempt_failed_event.rb +1 -1
  80. data/lib/svix/models/message_attempt_out.rb +1 -1
  81. data/lib/svix/models/message_attempt_trigger_type.rb +1 -1
  82. data/lib/svix/models/message_endpoint_out.rb +38 -2
  83. data/lib/svix/models/message_in.rb +38 -2
  84. data/lib/svix/models/message_out.rb +38 -2
  85. data/lib/svix/models/message_status.rb +1 -1
  86. data/lib/svix/models/portal_settings_out.rb +16 -5
  87. data/lib/svix/models/recover_in.rb +1 -1
  88. data/lib/svix/models/settings_in.rb +339 -0
  89. data/lib/svix/models/settings_out.rb +339 -0
  90. data/lib/svix/models/statistics_period.rb +1 -1
  91. data/lib/svix/models/validation_error.rb +1 -1
  92. data/lib/svix/models/webhook_types.rb +1 -1
  93. data/lib/svix/svix.rb +2 -0
  94. data/lib/svix/version.rb +1 -1
  95. data/lib/svix.rb +8 -2
  96. metadata +23 -6
@@ -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&#39;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&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. If a message with the same &#x60;eventId&#x60; 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&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. It&#39;s verified to be unique only up to a day, after that no verification will be made. If a message with the same &#x60;eventId&#x60; already exists for any application in your environment, a 409 conflict error will be returned. The &#x60;eventType&#x60; indicates the type and schema of the event. All messages of a certain &#x60;eventType&#x60; are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have &#x60;channels&#x60;, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don&#39;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&#39;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&#39;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&#39;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&#39;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&#39;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] || {}