svix 0.32.0 → 0.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/endpoint_api.rb +507 -0
  4. data/lib/svix/api/event_type_api.rb +83 -6
  5. data/lib/svix/api/message_api.rb +2 -2
  6. data/lib/svix/api/message_attempt_api.rb +4 -4
  7. data/lib/svix/api/organization_settings_api.rb +79 -0
  8. data/lib/svix/api/statistics_api.rb +205 -0
  9. data/lib/svix/endpoint_api.rb +22 -1
  10. data/lib/svix/event_type_api.rb +4 -0
  11. data/lib/svix/models/application_out.rb +18 -4
  12. data/lib/svix/models/attempt_statistics_data.rb +231 -0
  13. data/lib/svix/models/attempt_statistics_response.rb +265 -0
  14. data/lib/svix/models/border_radii_config.rb +236 -0
  15. data/lib/svix/models/border_radius_config.rb +236 -0
  16. data/lib/svix/models/border_radius_enum.rb +40 -0
  17. data/lib/svix/models/custom_theme_override.rb +227 -0
  18. data/lib/svix/models/endpoint_created_event_data.rb +36 -0
  19. data/lib/svix/models/endpoint_deleted_event_data.rb +36 -0
  20. data/lib/svix/models/endpoint_disabled_event_data.rb +36 -0
  21. data/lib/svix/models/endpoint_headers_in.rb +225 -0
  22. data/lib/svix/models/endpoint_headers_out.rb +252 -0
  23. data/lib/svix/models/endpoint_in.rb +26 -0
  24. data/lib/svix/models/endpoint_out.rb +24 -1
  25. data/lib/svix/models/endpoint_secret_out.rb +21 -0
  26. data/lib/svix/models/endpoint_secret_rotate_in.rb +236 -0
  27. data/lib/svix/models/endpoint_update.rb +9 -0
  28. data/lib/svix/models/endpoint_updated_event.rb +269 -0
  29. data/lib/svix/models/endpoint_updated_event_data.rb +36 -0
  30. data/lib/svix/models/event_type_example_out.rb +223 -0
  31. data/lib/svix/models/event_type_in.rb +12 -1
  32. data/lib/svix/models/event_type_out.rb +43 -4
  33. data/lib/svix/models/event_type_schema_in.rb +224 -0
  34. data/lib/svix/models/event_type_update.rb +12 -1
  35. data/lib/svix/models/font_size_config.rb +218 -0
  36. data/lib/svix/models/message_attempt_exhausted_event_data.rb +36 -0
  37. data/lib/svix/models/message_endpoint_out.rb +9 -0
  38. data/lib/svix/models/portal_settings_out.rb +286 -0
  39. data/lib/svix/models/radii_enum.rb +39 -0
  40. data/lib/svix/models/recover_in.rb +223 -0
  41. data/lib/svix/models/settings_out.rb +323 -0
  42. data/lib/svix/models/statistics_period.rb +37 -0
  43. data/lib/svix/models/webhook_types.rb +1 -1
  44. data/lib/svix/version.rb +1 -1
  45. data/lib/svix.rb +6 -2
  46. metadata +22 -2
@@ -20,7 +20,7 @@ module Svix
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create Event Type
23
- # Create an event type.
23
+ # Create new or unarchive existing event type. Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas.
24
24
  # @param event_type_in [EventTypeIn]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [EventTypeOut]
@@ -30,7 +30,7 @@ module Svix
30
30
  end
31
31
 
32
32
  # Create Event Type
33
- # Create an event type.
33
+ # Create new or unarchive existing event type. Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas.
34
34
  # @param event_type_in [EventTypeIn]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers
@@ -84,8 +84,8 @@ module Svix
84
84
  return data, status_code, headers
85
85
  end
86
86
 
87
- # Delete Event Type
88
- # Delete an event type.
87
+ # Archive Event Type
88
+ # Archive an event type. Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post).
89
89
  # @param event_type_name [String]
90
90
  # @param [Hash] opts the optional parameters
91
91
  # @return [nil]
@@ -94,8 +94,8 @@ module Svix
94
94
  nil
95
95
  end
96
96
 
97
- # Delete Event Type
98
- # Delete an event type.
97
+ # Archive Event Type
98
+ # Archive an event type. Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post).
99
99
  # @param event_type_name [String]
100
100
  # @param [Hash] opts the optional parameters
101
101
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
@@ -156,6 +156,71 @@ module Svix
156
156
  return data, status_code, headers
157
157
  end
158
158
 
159
+ # Generate Schema Example
160
+ # Generates a fake example from the given JSONSchema
161
+ # @param event_type_schema_in [EventTypeSchemaIn]
162
+ # @param [Hash] opts the optional parameters
163
+ # @return [EventTypeExampleOut]
164
+ def generate_schema_example_api_v1_event_type_schema_generate_example_post(event_type_schema_in, opts = {})
165
+ data, _status_code, _headers = generate_schema_example_api_v1_event_type_schema_generate_example_post_with_http_info(event_type_schema_in, opts)
166
+ data
167
+ end
168
+
169
+ # Generate Schema Example
170
+ # Generates a fake example from the given JSONSchema
171
+ # @param event_type_schema_in [EventTypeSchemaIn]
172
+ # @param [Hash] opts the optional parameters
173
+ # @return [Array<(EventTypeExampleOut, Integer, Hash)>] EventTypeExampleOut data, response status code and response headers
174
+ def generate_schema_example_api_v1_event_type_schema_generate_example_post_with_http_info(event_type_schema_in, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: EventTypeApi.generate_schema_example_api_v1_event_type_schema_generate_example_post ...'
177
+ end
178
+ # verify the required parameter 'event_type_schema_in' is set
179
+ if @api_client.config.client_side_validation && event_type_schema_in.nil?
180
+ fail ArgumentError, "Missing the required parameter 'event_type_schema_in' when calling EventTypeApi.generate_schema_example_api_v1_event_type_schema_generate_example_post"
181
+ end
182
+ # resource path
183
+ local_var_path = '/api/v1/event-type/schema/generate-example/'
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+
188
+ # header parameters
189
+ header_params = opts[:header_params] || {}
190
+ # HTTP header 'Accept' (if needed)
191
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
192
+ # HTTP header 'Content-Type'
193
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
194
+
195
+ # form parameters
196
+ form_params = opts[:form_params] || {}
197
+
198
+ # http body (model)
199
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_schema_in)
200
+
201
+ # return_type
202
+ return_type = opts[:debug_return_type] || 'EventTypeExampleOut'
203
+
204
+ # auth_names
205
+ auth_names = opts[:debug_auth_names] || []
206
+
207
+ new_options = opts.merge(
208
+ :operation => :"EventTypeApi.generate_schema_example_api_v1_event_type_schema_generate_example_post",
209
+ :header_params => header_params,
210
+ :query_params => query_params,
211
+ :form_params => form_params,
212
+ :body => post_body,
213
+ :auth_names => auth_names,
214
+ :return_type => return_type
215
+ )
216
+
217
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
218
+ if @api_client.config.debugging
219
+ @api_client.config.logger.debug "API called: EventTypeApi#generate_schema_example_api_v1_event_type_schema_generate_example_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
220
+ end
221
+ return data, status_code, headers
222
+ end
223
+
159
224
  # Get Event Type
160
225
  # Get an event type.
161
226
  # @param event_type_name [String]
@@ -234,6 +299,7 @@ module Svix
234
299
  # @option opts [String] :iterator
235
300
  # @option opts [Integer] :limit (default to 50)
236
301
  # @option opts [Boolean] :with_content (default to false)
302
+ # @option opts [Boolean] :include_archived (default to false)
237
303
  # @return [ListResponseEventTypeOut]
238
304
  def list_event_types_api_v1_event_type_get(opts = {})
239
305
  data, _status_code, _headers = list_event_types_api_v1_event_type_get_with_http_info(opts)
@@ -246,11 +312,21 @@ module Svix
246
312
  # @option opts [String] :iterator
247
313
  # @option opts [Integer] :limit
248
314
  # @option opts [Boolean] :with_content
315
+ # @option opts [Boolean] :include_archived
249
316
  # @return [Array<(ListResponseEventTypeOut, Integer, Hash)>] ListResponseEventTypeOut data, response status code and response headers
250
317
  def list_event_types_api_v1_event_type_get_with_http_info(opts = {})
251
318
  if @api_client.config.debugging
252
319
  @api_client.config.logger.debug 'Calling API: EventTypeApi.list_event_types_api_v1_event_type_get ...'
253
320
  end
321
+ if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'].to_s.length > 256
322
+ fail ArgumentError, 'invalid value for "opts[:"iterator"]" when calling EventTypeApi.list_event_types_api_v1_event_type_get, the character length must be smaller than or equal to 256.'
323
+ end
324
+
325
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
326
+ if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'] !~ pattern
327
+ fail ArgumentError, "invalid value for 'opts[:\"iterator\"]' when calling EventTypeApi.list_event_types_api_v1_event_type_get, must conform to the pattern #{pattern}."
328
+ end
329
+
254
330
  # resource path
255
331
  local_var_path = '/api/v1/event-type/'
256
332
 
@@ -259,6 +335,7 @@ module Svix
259
335
  query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
260
336
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
261
337
  query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
338
+ query_params[:'include_archived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
262
339
 
263
340
  # header parameters
264
341
  header_params = opts[:header_params] || {}
@@ -20,7 +20,7 @@ module Svix
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create Message
23
- # Creates a new message and dispatch it to all of the application's endpoints. The message will be delivered following the organizations delivery and retry policy. `eventId` Is an optional global unique ID accross all applications. If a message with the same `eventId` already exists, 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. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned.
24
24
  # @param app_id [String]
25
25
  # @param message_in [MessageIn]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module Svix
31
31
  end
32
32
 
33
33
  # Create Message
34
- # Creates a new message and dispatch it to all of the application&#39;s endpoints. The message will be delivered following the organizations delivery and retry policy. &#x60;eventId&#x60; Is an optional global unique ID accross all applications. If a message with the same &#x60;eventId&#x60; already exists, a 409 conflict error will be returned.
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.
35
35
  # @param app_id [String]
36
36
  # @param message_in [MessageIn]
37
37
  # @param [Hash] opts the optional parameters
@@ -222,7 +222,7 @@ module Svix
222
222
  end
223
223
 
224
224
  # List Attempted Messages
225
- # List the message attempts for a particular endpoint. Returning the message. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
225
+ # List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
226
226
  # @param endpoint_id [String]
227
227
  # @param app_id [String]
228
228
  # @param [Hash] opts the optional parameters
@@ -237,7 +237,7 @@ module Svix
237
237
  end
238
238
 
239
239
  # List Attempted Messages
240
- # List the message attempts for a particular endpoint. Returning the message. The &#x60;before&#x60; parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
240
+ # List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. The &#x60;before&#x60; parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
241
241
  # @param endpoint_id [String]
242
242
  # @param app_id [String]
243
243
  # @param [Hash] opts the optional parameters
@@ -433,7 +433,7 @@ module Svix
433
433
  end
434
434
 
435
435
  # List Attempts For Endpoint
436
- # List the message attempts for a particular endpoint. Returning the endpint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
436
+ # List the message attempts for a particular endpoint. Returning the endpoint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
437
437
  # @param msg_id [String]
438
438
  # @param app_id [String]
439
439
  # @param endpoint_id [String]
@@ -450,7 +450,7 @@ module Svix
450
450
  end
451
451
 
452
452
  # List Attempts For Endpoint
453
- # List the message attempts for a particular endpoint. Returning the endpint. The &#x60;before&#x60; parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
453
+ # List the message attempts for a particular endpoint. Returning the endpoint. The &#x60;before&#x60; parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
454
454
  # @param msg_id [String]
455
455
  # @param app_id [String]
456
456
  # @param endpoint_id [String]
@@ -0,0 +1,79 @@
1
+ =begin
2
+ #Svix API
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 of your users. - `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.
5
+
6
+ The version of the OpenAPI document: 1.4
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Svix
16
+ class OrganizationSettingsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Org Settings
23
+ # Get the organization's settings
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [PortalSettingsOut]
26
+ def get_org_settings_api_v1_org_settings_get(opts = {})
27
+ data, _status_code, _headers = get_org_settings_api_v1_org_settings_get_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Get Org Settings
32
+ # Get the organization&#39;s settings
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(PortalSettingsOut, Integer, Hash)>] PortalSettingsOut data, response status code and response headers
35
+ def get_org_settings_api_v1_org_settings_get_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: OrganizationSettingsApi.get_org_settings_api_v1_org_settings_get ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/api/v1/org/settings/'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'PortalSettingsOut'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"OrganizationSettingsApi.get_org_settings_api_v1_org_settings_get",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: OrganizationSettingsApi#get_org_settings_api_v1_org_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,205 @@
1
+ =begin
2
+ #Svix API
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 of your users. - `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.
5
+
6
+ The version of the OpenAPI document: 1.4
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Svix
16
+ class StatisticsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get App Attempt Stats
23
+ # Returns application-level statistics on message attempts
24
+ # @param app_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Time] :start_date
27
+ # @option opts [Time] :end_date
28
+ # @return [AttemptStatisticsResponse]
29
+ def get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get(app_id, opts = {})
30
+ data, _status_code, _headers = get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get_with_http_info(app_id, opts)
31
+ data
32
+ end
33
+
34
+ # Get App Attempt Stats
35
+ # Returns application-level statistics on message attempts
36
+ # @param app_id [String]
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Time] :start_date
39
+ # @option opts [Time] :end_date
40
+ # @return [Array<(AttemptStatisticsResponse, Integer, Hash)>] AttemptStatisticsResponse data, response status code and response headers
41
+ def get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get_with_http_info(app_id, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get ...'
44
+ end
45
+ # verify the required parameter 'app_id' is set
46
+ if @api_client.config.client_side_validation && app_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get"
48
+ end
49
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
50
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get, the character length must be smaller than or equal to 256.'
51
+ end
52
+
53
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
54
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get, the character length must be great than or equal to 1.'
55
+ end
56
+
57
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
58
+ if @api_client.config.client_side_validation && app_id !~ pattern
59
+ fail ArgumentError, "invalid value for 'app_id' when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get, must conform to the pattern #{pattern}."
60
+ end
61
+
62
+ # resource path
63
+ local_var_path = '/api/v1/stats/app/{app_id}/attempt/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
64
+
65
+ # query parameters
66
+ query_params = opts[:query_params] || {}
67
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
68
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
69
+
70
+ # header parameters
71
+ header_params = opts[:header_params] || {}
72
+ # HTTP header 'Accept' (if needed)
73
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
74
+
75
+ # form parameters
76
+ form_params = opts[:form_params] || {}
77
+
78
+ # http body (model)
79
+ post_body = opts[:debug_body]
80
+
81
+ # return_type
82
+ return_type = opts[:debug_return_type] || 'AttemptStatisticsResponse'
83
+
84
+ # auth_names
85
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
86
+
87
+ new_options = opts.merge(
88
+ :operation => :"StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get",
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => return_type
95
+ )
96
+
97
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug "API called: StatisticsApi#get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
+ end
101
+ return data, status_code, headers
102
+ end
103
+
104
+ # Get Ep Stats
105
+ # Returns endpoint-level statistics on message attempts
106
+ # @param endpoint_id [String]
107
+ # @param app_id [String]
108
+ # @param [Hash] opts the optional parameters
109
+ # @option opts [Time] :start_date
110
+ # @option opts [Time] :end_date
111
+ # @return [AttemptStatisticsResponse]
112
+ def get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get(endpoint_id, app_id, opts = {})
113
+ data, _status_code, _headers = get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get_with_http_info(endpoint_id, app_id, opts)
114
+ data
115
+ end
116
+
117
+ # Get Ep Stats
118
+ # Returns endpoint-level statistics on message attempts
119
+ # @param endpoint_id [String]
120
+ # @param app_id [String]
121
+ # @param [Hash] opts the optional parameters
122
+ # @option opts [Time] :start_date
123
+ # @option opts [Time] :end_date
124
+ # @return [Array<(AttemptStatisticsResponse, Integer, Hash)>] AttemptStatisticsResponse data, response status code and response headers
125
+ def get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get_with_http_info(endpoint_id, app_id, opts = {})
126
+ if @api_client.config.debugging
127
+ @api_client.config.logger.debug 'Calling API: StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get ...'
128
+ end
129
+ # verify the required parameter 'endpoint_id' is set
130
+ if @api_client.config.client_side_validation && endpoint_id.nil?
131
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get"
132
+ end
133
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
134
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be smaller than or equal to 256.'
135
+ end
136
+
137
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
138
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be great than or equal to 1.'
139
+ end
140
+
141
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
142
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
143
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, must conform to the pattern #{pattern}."
144
+ end
145
+
146
+ # verify the required parameter 'app_id' is set
147
+ if @api_client.config.client_side_validation && app_id.nil?
148
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get"
149
+ end
150
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
151
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be smaller than or equal to 256.'
152
+ end
153
+
154
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
155
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be great than or equal to 1.'
156
+ end
157
+
158
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
159
+ if @api_client.config.client_side_validation && app_id !~ pattern
160
+ fail ArgumentError, "invalid value for 'app_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, must conform to the pattern #{pattern}."
161
+ end
162
+
163
+ # resource path
164
+ local_var_path = '/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
165
+
166
+ # query parameters
167
+ query_params = opts[:query_params] || {}
168
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
169
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
170
+
171
+ # header parameters
172
+ header_params = opts[:header_params] || {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
175
+
176
+ # form parameters
177
+ form_params = opts[:form_params] || {}
178
+
179
+ # http body (model)
180
+ post_body = opts[:debug_body]
181
+
182
+ # return_type
183
+ return_type = opts[:debug_return_type] || 'AttemptStatisticsResponse'
184
+
185
+ # auth_names
186
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
187
+
188
+ new_options = opts.merge(
189
+ :operation => :"StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get",
190
+ :header_params => header_params,
191
+ :query_params => query_params,
192
+ :form_params => form_params,
193
+ :body => post_body,
194
+ :auth_names => auth_names,
195
+ :return_type => return_type
196
+ )
197
+
198
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
199
+ if @api_client.config.debugging
200
+ @api_client.config.logger.debug "API called: StatisticsApi#get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
201
+ end
202
+ return data, status_code, headers
203
+ end
204
+ end
205
+ end
@@ -6,7 +6,7 @@ module Svix
6
6
  @api = EndpointApi.new(api_client)
7
7
  end
8
8
 
9
- def list(str, options = {})
9
+ def list(app_id, options = {})
10
10
  return @api.list_endpoints_api_v1_app_app_id_endpoint_get(app_id, options)
11
11
  end
12
12
 
@@ -30,5 +30,26 @@ module Svix
30
30
  return @api.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get(endpoint_id, app_id)
31
31
  end
32
32
 
33
+ def rotate_secret(app_id, endpoint_id, endpoint_secret_rotate_in)
34
+ return @api.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post(endpoint_id, app_id, endpoint_secret_rotate_in)
35
+ end
36
+
37
+ def recover(app_id, endpoint_id, recover_in)
38
+ @api.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post(app_id, endpoint_id, recover_in)
39
+ nil
40
+ end
41
+
42
+ def get_headers(app_id, endpoint_id)
43
+ return @api.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get(endpoint_id app_id)
44
+ end
45
+
46
+ def update_headers(app_id, endpoint_id, endpoint_headers_in)
47
+ return @api.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put(app_id, endpoint_id, endpoint_headers_in)
48
+ end
49
+
50
+ def patch_headers(app_id, endpoint_id, endpoint_headers_in)
51
+ return @api.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch(app_id, endpoint_id, endpoint_headers_in)
52
+ end
53
+
33
54
  end
34
55
  end
@@ -14,6 +14,10 @@ module Svix
14
14
  return @api.create_event_type_api_v1_event_type_post(event_type_in)
15
15
  end
16
16
 
17
+ def get(event_type_name)
18
+ return @api.get_event_type_api_v1_event_type_event_type_name_get(event_type_name)
19
+ end
20
+
17
21
  def update(event_type_name, event_type_update)
18
22
  return @api.update_event_type_api_v1_event_type_event_type_name_put(event_type_name, event_type_update)
19
23
  end
@@ -26,6 +26,8 @@ module Svix
26
26
  # Optional unique identifier for the application
27
27
  attr_accessor :uid
28
28
 
29
+ attr_accessor :updated_at
30
+
29
31
  # Attribute mapping from ruby-style variable name to JSON key.
30
32
  def self.attribute_map
31
33
  {
@@ -33,7 +35,8 @@ module Svix
33
35
  :'id' => :'id',
34
36
  :'name' => :'name',
35
37
  :'rate_limit' => :'rateLimit',
36
- :'uid' => :'uid'
38
+ :'uid' => :'uid',
39
+ :'updated_at' => :'updatedAt'
37
40
  }
38
41
  end
39
42
 
@@ -49,7 +52,8 @@ module Svix
49
52
  :'id' => :'String',
50
53
  :'name' => :'String',
51
54
  :'rate_limit' => :'Integer',
52
- :'uid' => :'String'
55
+ :'uid' => :'String',
56
+ :'updated_at' => :'Time'
53
57
  }
54
58
  end
55
59
 
@@ -93,6 +97,10 @@ module Svix
93
97
  if attributes.key?(:'uid')
94
98
  self.uid = attributes[:'uid']
95
99
  end
100
+
101
+ if attributes.key?(:'updated_at')
102
+ self.updated_at = attributes[:'updated_at']
103
+ end
96
104
  end
97
105
 
98
106
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -124,6 +132,10 @@ module Svix
124
132
  invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
125
133
  end
126
134
 
135
+ if @updated_at.nil?
136
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
137
+ end
138
+
127
139
  invalid_properties
128
140
  end
129
141
 
@@ -136,6 +148,7 @@ module Svix
136
148
  return false if !@uid.nil? && @uid.to_s.length > 256
137
149
  return false if !@uid.nil? && @uid.to_s.length < 1
138
150
  return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
151
+ return false if @updated_at.nil?
139
152
  true
140
153
  end
141
154
 
@@ -167,7 +180,8 @@ module Svix
167
180
  id == o.id &&
168
181
  name == o.name &&
169
182
  rate_limit == o.rate_limit &&
170
- uid == o.uid
183
+ uid == o.uid &&
184
+ updated_at == o.updated_at
171
185
  end
172
186
 
173
187
  # @see the `==` method
@@ -179,7 +193,7 @@ module Svix
179
193
  # Calculates hash code according to all attributes.
180
194
  # @return [Integer] Hash code
181
195
  def hash
182
- [created_at, id, name, rate_limit, uid].hash
196
+ [created_at, id, name, rate_limit, uid, updated_at].hash
183
197
  end
184
198
 
185
199
  # Builds the object from hash