svix 0.28.0 → 0.37.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 +7 -1
- data/README.md +16 -3
- data/lib/svix/api/application_api.rb +386 -0
- data/lib/svix/api/authentication_api.rb +155 -0
- data/lib/svix/api/endpoint_api.rb +1281 -0
- data/lib/svix/api/event_type_api.rb +454 -0
- data/lib/svix/api/health_api.rb +77 -0
- data/lib/svix/api/message_api.rb +289 -0
- data/lib/svix/api/message_attempt_api.rb +678 -0
- data/lib/svix/api/statistics_api.rb +205 -0
- data/lib/svix/api_client.rb +399 -0
- data/lib/svix/api_error.rb +57 -0
- data/lib/svix/application_api.rb +29 -0
- data/lib/svix/authentication_api.rb +17 -0
- data/lib/svix/configuration.rb +277 -0
- data/lib/svix/endpoint_api.rb +55 -0
- data/{src → lib}/svix/errors.rb +0 -0
- data/lib/svix/event_type_api.rb +25 -0
- data/lib/svix/internal.rb +16 -0
- data/lib/svix/message_api.rb +21 -0
- data/lib/svix/message_attempt_api.rb +33 -0
- data/lib/svix/models/application_in.rb +277 -0
- data/lib/svix/models/application_out.rb +319 -0
- data/lib/svix/models/attempt_statistics_data.rb +231 -0
- data/lib/svix/models/attempt_statistics_response.rb +265 -0
- data/lib/svix/models/dashboard_access_out.rb +265 -0
- data/lib/svix/models/endpoint_created_event.rb +269 -0
- data/lib/svix/models/endpoint_created_event_data.rb +282 -0
- data/lib/svix/models/endpoint_deleted_event.rb +269 -0
- data/lib/svix/models/endpoint_deleted_event_data.rb +282 -0
- data/lib/svix/models/endpoint_disabled_event.rb +269 -0
- data/lib/svix/models/endpoint_disabled_event_data.rb +296 -0
- data/lib/svix/models/endpoint_headers_in.rb +225 -0
- data/lib/svix/models/endpoint_headers_out.rb +252 -0
- data/lib/svix/models/endpoint_in.rb +394 -0
- data/lib/svix/models/endpoint_message_out.rb +363 -0
- data/lib/svix/models/endpoint_out.rb +409 -0
- data/lib/svix/models/endpoint_secret_out.rb +245 -0
- data/lib/svix/models/endpoint_secret_rotate_in.rb +236 -0
- data/lib/svix/models/endpoint_stats.rb +265 -0
- data/lib/svix/models/endpoint_update.rb +367 -0
- data/lib/svix/models/endpoint_updated_event.rb +269 -0
- data/lib/svix/models/endpoint_updated_event_data.rb +282 -0
- data/lib/svix/models/endpointd_updated_event.rb +269 -0
- data/lib/svix/models/event_example_in.rb +253 -0
- data/lib/svix/models/event_type_example_out.rb +223 -0
- data/lib/svix/models/event_type_in.rb +290 -0
- data/lib/svix/models/event_type_out.rb +318 -0
- data/lib/svix/models/event_type_schema_in.rb +224 -0
- data/lib/svix/models/event_type_update.rb +246 -0
- data/lib/svix/models/http_error_out.rb +237 -0
- data/lib/svix/models/http_validation_error.rb +220 -0
- data/lib/svix/models/list_response_application_out.rb +248 -0
- data/lib/svix/models/list_response_endpoint_message_out.rb +248 -0
- data/lib/svix/models/list_response_endpoint_out.rb +248 -0
- data/lib/svix/models/list_response_event_type_out.rb +248 -0
- data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +248 -0
- data/lib/svix/models/list_response_message_attempt_out.rb +248 -0
- data/lib/svix/models/list_response_message_endpoint_out.rb +248 -0
- data/lib/svix/models/list_response_message_out.rb +248 -0
- data/lib/svix/models/message_attempt_endpoint_out.rb +293 -0
- data/lib/svix/models/message_attempt_exhausted_event.rb +269 -0
- data/lib/svix/models/message_attempt_exhausted_event_data.rb +310 -0
- data/lib/svix/models/message_attempt_failed_event.rb +251 -0
- data/lib/svix/models/message_attempt_out.rb +307 -0
- data/lib/svix/models/message_attempt_trigger_type.rb +37 -0
- data/lib/svix/models/message_endpoint_out.rb +418 -0
- data/lib/svix/models/message_in.rb +312 -0
- data/lib/svix/models/message_out.rb +340 -0
- data/lib/svix/models/message_status.rb +39 -0
- data/lib/svix/models/recover_in.rb +223 -0
- data/lib/svix/models/statistics_period.rb +37 -0
- data/lib/svix/models/validation_error.rb +253 -0
- data/lib/svix/models/webhook_types.rb +280 -0
- data/lib/svix/svix.rb +43 -0
- data/{src → lib}/svix/util.rb +1 -1
- data/{src → lib}/svix/version.rb +1 -1
- data/{src → lib}/svix/webhook.rb +1 -1
- data/lib/svix.rb +80 -0
- data/svix.gemspec +16 -6
- metadata +100 -9
- data/.gitignore +0 -9
- data/src/svix.rb +0 -8
@@ -0,0 +1,454 @@
|
|
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 EventTypeApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create 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
|
+
# @param event_type_in [EventTypeIn]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [EventTypeOut]
|
27
|
+
def create_event_type_api_v1_event_type_post(event_type_in, opts = {})
|
28
|
+
data, _status_code, _headers = create_event_type_api_v1_event_type_post_with_http_info(event_type_in, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create 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
|
+
# @param event_type_in [EventTypeIn]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers
|
37
|
+
def create_event_type_api_v1_event_type_post_with_http_info(event_type_in, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: EventTypeApi.create_event_type_api_v1_event_type_post ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'event_type_in' is set
|
42
|
+
if @api_client.config.client_side_validation && event_type_in.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'event_type_in' when calling EventTypeApi.create_event_type_api_v1_event_type_post"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/api/v1/event-type/'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = opts[:form_params] || {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_in)
|
63
|
+
|
64
|
+
# return_type
|
65
|
+
return_type = opts[:debug_return_type] || 'EventTypeOut'
|
66
|
+
|
67
|
+
# auth_names
|
68
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
69
|
+
|
70
|
+
new_options = opts.merge(
|
71
|
+
:operation => :"EventTypeApi.create_event_type_api_v1_event_type_post",
|
72
|
+
:header_params => header_params,
|
73
|
+
:query_params => query_params,
|
74
|
+
:form_params => form_params,
|
75
|
+
:body => post_body,
|
76
|
+
:auth_names => auth_names,
|
77
|
+
:return_type => return_type
|
78
|
+
)
|
79
|
+
|
80
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
81
|
+
if @api_client.config.debugging
|
82
|
+
@api_client.config.logger.debug "API called: EventTypeApi#create_event_type_api_v1_event_type_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
83
|
+
end
|
84
|
+
return data, status_code, headers
|
85
|
+
end
|
86
|
+
|
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
|
+
# @param event_type_name [String]
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @return [nil]
|
92
|
+
def delete_event_type_api_v1_event_type_event_type_name_delete(event_type_name, opts = {})
|
93
|
+
delete_event_type_api_v1_event_type_event_type_name_delete_with_http_info(event_type_name, opts)
|
94
|
+
nil
|
95
|
+
end
|
96
|
+
|
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
|
+
# @param event_type_name [String]
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
102
|
+
def delete_event_type_api_v1_event_type_event_type_name_delete_with_http_info(event_type_name, opts = {})
|
103
|
+
if @api_client.config.debugging
|
104
|
+
@api_client.config.logger.debug 'Calling API: EventTypeApi.delete_event_type_api_v1_event_type_event_type_name_delete ...'
|
105
|
+
end
|
106
|
+
# verify the required parameter 'event_type_name' is set
|
107
|
+
if @api_client.config.client_side_validation && event_type_name.nil?
|
108
|
+
fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.delete_event_type_api_v1_event_type_event_type_name_delete"
|
109
|
+
end
|
110
|
+
if @api_client.config.client_side_validation && event_type_name.to_s.length > 256
|
111
|
+
fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.delete_event_type_api_v1_event_type_event_type_name_delete, the character length must be smaller than or equal to 256.'
|
112
|
+
end
|
113
|
+
|
114
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
115
|
+
if @api_client.config.client_side_validation && event_type_name !~ pattern
|
116
|
+
fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.delete_event_type_api_v1_event_type_event_type_name_delete, must conform to the pattern #{pattern}."
|
117
|
+
end
|
118
|
+
|
119
|
+
# resource path
|
120
|
+
local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s))
|
121
|
+
|
122
|
+
# query parameters
|
123
|
+
query_params = opts[:query_params] || {}
|
124
|
+
|
125
|
+
# header parameters
|
126
|
+
header_params = opts[:header_params] || {}
|
127
|
+
# HTTP header 'Accept' (if needed)
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
129
|
+
|
130
|
+
# form parameters
|
131
|
+
form_params = opts[:form_params] || {}
|
132
|
+
|
133
|
+
# http body (model)
|
134
|
+
post_body = opts[:debug_body]
|
135
|
+
|
136
|
+
# return_type
|
137
|
+
return_type = opts[:debug_return_type]
|
138
|
+
|
139
|
+
# auth_names
|
140
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
141
|
+
|
142
|
+
new_options = opts.merge(
|
143
|
+
:operation => :"EventTypeApi.delete_event_type_api_v1_event_type_event_type_name_delete",
|
144
|
+
:header_params => header_params,
|
145
|
+
:query_params => query_params,
|
146
|
+
:form_params => form_params,
|
147
|
+
:body => post_body,
|
148
|
+
:auth_names => auth_names,
|
149
|
+
:return_type => return_type
|
150
|
+
)
|
151
|
+
|
152
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
153
|
+
if @api_client.config.debugging
|
154
|
+
@api_client.config.logger.debug "API called: EventTypeApi#delete_event_type_api_v1_event_type_event_type_name_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
155
|
+
end
|
156
|
+
return data, status_code, headers
|
157
|
+
end
|
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
|
+
|
224
|
+
# Get Event Type
|
225
|
+
# Get an event type.
|
226
|
+
# @param event_type_name [String]
|
227
|
+
# @param [Hash] opts the optional parameters
|
228
|
+
# @return [EventTypeOut]
|
229
|
+
def get_event_type_api_v1_event_type_event_type_name_get(event_type_name, opts = {})
|
230
|
+
data, _status_code, _headers = get_event_type_api_v1_event_type_event_type_name_get_with_http_info(event_type_name, opts)
|
231
|
+
data
|
232
|
+
end
|
233
|
+
|
234
|
+
# Get Event Type
|
235
|
+
# Get an event type.
|
236
|
+
# @param event_type_name [String]
|
237
|
+
# @param [Hash] opts the optional parameters
|
238
|
+
# @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers
|
239
|
+
def get_event_type_api_v1_event_type_event_type_name_get_with_http_info(event_type_name, opts = {})
|
240
|
+
if @api_client.config.debugging
|
241
|
+
@api_client.config.logger.debug 'Calling API: EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get ...'
|
242
|
+
end
|
243
|
+
# verify the required parameter 'event_type_name' is set
|
244
|
+
if @api_client.config.client_side_validation && event_type_name.nil?
|
245
|
+
fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get"
|
246
|
+
end
|
247
|
+
if @api_client.config.client_side_validation && event_type_name.to_s.length > 256
|
248
|
+
fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get, the character length must be smaller than or equal to 256.'
|
249
|
+
end
|
250
|
+
|
251
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
252
|
+
if @api_client.config.client_side_validation && event_type_name !~ pattern
|
253
|
+
fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get, must conform to the pattern #{pattern}."
|
254
|
+
end
|
255
|
+
|
256
|
+
# resource path
|
257
|
+
local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s))
|
258
|
+
|
259
|
+
# query parameters
|
260
|
+
query_params = opts[:query_params] || {}
|
261
|
+
|
262
|
+
# header parameters
|
263
|
+
header_params = opts[:header_params] || {}
|
264
|
+
# HTTP header 'Accept' (if needed)
|
265
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
266
|
+
|
267
|
+
# form parameters
|
268
|
+
form_params = opts[:form_params] || {}
|
269
|
+
|
270
|
+
# http body (model)
|
271
|
+
post_body = opts[:debug_body]
|
272
|
+
|
273
|
+
# return_type
|
274
|
+
return_type = opts[:debug_return_type] || 'EventTypeOut'
|
275
|
+
|
276
|
+
# auth_names
|
277
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
278
|
+
|
279
|
+
new_options = opts.merge(
|
280
|
+
:operation => :"EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get",
|
281
|
+
:header_params => header_params,
|
282
|
+
:query_params => query_params,
|
283
|
+
:form_params => form_params,
|
284
|
+
:body => post_body,
|
285
|
+
:auth_names => auth_names,
|
286
|
+
:return_type => return_type
|
287
|
+
)
|
288
|
+
|
289
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
290
|
+
if @api_client.config.debugging
|
291
|
+
@api_client.config.logger.debug "API called: EventTypeApi#get_event_type_api_v1_event_type_event_type_name_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
292
|
+
end
|
293
|
+
return data, status_code, headers
|
294
|
+
end
|
295
|
+
|
296
|
+
# List Event Types
|
297
|
+
# Return the list of event types.
|
298
|
+
# @param [Hash] opts the optional parameters
|
299
|
+
# @option opts [String] :iterator
|
300
|
+
# @option opts [Integer] :limit (default to 50)
|
301
|
+
# @option opts [Boolean] :with_content (default to false)
|
302
|
+
# @option opts [Boolean] :include_archived (default to false)
|
303
|
+
# @return [ListResponseEventTypeOut]
|
304
|
+
def list_event_types_api_v1_event_type_get(opts = {})
|
305
|
+
data, _status_code, _headers = list_event_types_api_v1_event_type_get_with_http_info(opts)
|
306
|
+
data
|
307
|
+
end
|
308
|
+
|
309
|
+
# List Event Types
|
310
|
+
# Return the list of event types.
|
311
|
+
# @param [Hash] opts the optional parameters
|
312
|
+
# @option opts [String] :iterator
|
313
|
+
# @option opts [Integer] :limit
|
314
|
+
# @option opts [Boolean] :with_content
|
315
|
+
# @option opts [Boolean] :include_archived
|
316
|
+
# @return [Array<(ListResponseEventTypeOut, Integer, Hash)>] ListResponseEventTypeOut data, response status code and response headers
|
317
|
+
def list_event_types_api_v1_event_type_get_with_http_info(opts = {})
|
318
|
+
if @api_client.config.debugging
|
319
|
+
@api_client.config.logger.debug 'Calling API: EventTypeApi.list_event_types_api_v1_event_type_get ...'
|
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
|
+
|
330
|
+
# resource path
|
331
|
+
local_var_path = '/api/v1/event-type/'
|
332
|
+
|
333
|
+
# query parameters
|
334
|
+
query_params = opts[:query_params] || {}
|
335
|
+
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
336
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
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?
|
339
|
+
|
340
|
+
# header parameters
|
341
|
+
header_params = opts[:header_params] || {}
|
342
|
+
# HTTP header 'Accept' (if needed)
|
343
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
344
|
+
|
345
|
+
# form parameters
|
346
|
+
form_params = opts[:form_params] || {}
|
347
|
+
|
348
|
+
# http body (model)
|
349
|
+
post_body = opts[:debug_body]
|
350
|
+
|
351
|
+
# return_type
|
352
|
+
return_type = opts[:debug_return_type] || 'ListResponseEventTypeOut'
|
353
|
+
|
354
|
+
# auth_names
|
355
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
356
|
+
|
357
|
+
new_options = opts.merge(
|
358
|
+
:operation => :"EventTypeApi.list_event_types_api_v1_event_type_get",
|
359
|
+
:header_params => header_params,
|
360
|
+
:query_params => query_params,
|
361
|
+
:form_params => form_params,
|
362
|
+
:body => post_body,
|
363
|
+
:auth_names => auth_names,
|
364
|
+
:return_type => return_type
|
365
|
+
)
|
366
|
+
|
367
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
368
|
+
if @api_client.config.debugging
|
369
|
+
@api_client.config.logger.debug "API called: EventTypeApi#list_event_types_api_v1_event_type_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
370
|
+
end
|
371
|
+
return data, status_code, headers
|
372
|
+
end
|
373
|
+
|
374
|
+
# Update Event Type
|
375
|
+
# Update an event type.
|
376
|
+
# @param event_type_name [String]
|
377
|
+
# @param event_type_update [EventTypeUpdate]
|
378
|
+
# @param [Hash] opts the optional parameters
|
379
|
+
# @return [EventTypeOut]
|
380
|
+
def update_event_type_api_v1_event_type_event_type_name_put(event_type_name, event_type_update, opts = {})
|
381
|
+
data, _status_code, _headers = update_event_type_api_v1_event_type_event_type_name_put_with_http_info(event_type_name, event_type_update, opts)
|
382
|
+
data
|
383
|
+
end
|
384
|
+
|
385
|
+
# Update Event Type
|
386
|
+
# Update an event type.
|
387
|
+
# @param event_type_name [String]
|
388
|
+
# @param event_type_update [EventTypeUpdate]
|
389
|
+
# @param [Hash] opts the optional parameters
|
390
|
+
# @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers
|
391
|
+
def update_event_type_api_v1_event_type_event_type_name_put_with_http_info(event_type_name, event_type_update, opts = {})
|
392
|
+
if @api_client.config.debugging
|
393
|
+
@api_client.config.logger.debug 'Calling API: EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put ...'
|
394
|
+
end
|
395
|
+
# verify the required parameter 'event_type_name' is set
|
396
|
+
if @api_client.config.client_side_validation && event_type_name.nil?
|
397
|
+
fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put"
|
398
|
+
end
|
399
|
+
if @api_client.config.client_side_validation && event_type_name.to_s.length > 256
|
400
|
+
fail ArgumentError, 'invalid value for "event_type_name" when calling EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put, the character length must be smaller than or equal to 256.'
|
401
|
+
end
|
402
|
+
|
403
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
404
|
+
if @api_client.config.client_side_validation && event_type_name !~ pattern
|
405
|
+
fail ArgumentError, "invalid value for 'event_type_name' when calling EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put, must conform to the pattern #{pattern}."
|
406
|
+
end
|
407
|
+
|
408
|
+
# verify the required parameter 'event_type_update' is set
|
409
|
+
if @api_client.config.client_side_validation && event_type_update.nil?
|
410
|
+
fail ArgumentError, "Missing the required parameter 'event_type_update' when calling EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put"
|
411
|
+
end
|
412
|
+
# resource path
|
413
|
+
local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s))
|
414
|
+
|
415
|
+
# query parameters
|
416
|
+
query_params = opts[:query_params] || {}
|
417
|
+
|
418
|
+
# header parameters
|
419
|
+
header_params = opts[:header_params] || {}
|
420
|
+
# HTTP header 'Accept' (if needed)
|
421
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
422
|
+
# HTTP header 'Content-Type'
|
423
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
424
|
+
|
425
|
+
# form parameters
|
426
|
+
form_params = opts[:form_params] || {}
|
427
|
+
|
428
|
+
# http body (model)
|
429
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_update)
|
430
|
+
|
431
|
+
# return_type
|
432
|
+
return_type = opts[:debug_return_type] || 'EventTypeOut'
|
433
|
+
|
434
|
+
# auth_names
|
435
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
436
|
+
|
437
|
+
new_options = opts.merge(
|
438
|
+
:operation => :"EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put",
|
439
|
+
:header_params => header_params,
|
440
|
+
:query_params => query_params,
|
441
|
+
:form_params => form_params,
|
442
|
+
:body => post_body,
|
443
|
+
:auth_names => auth_names,
|
444
|
+
:return_type => return_type
|
445
|
+
)
|
446
|
+
|
447
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
448
|
+
if @api_client.config.debugging
|
449
|
+
@api_client.config.logger.debug "API called: EventTypeApi#update_event_type_api_v1_event_type_event_type_name_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
450
|
+
end
|
451
|
+
return data, status_code, headers
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|
@@ -0,0 +1,77 @@
|
|
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 HealthApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Health
|
23
|
+
# Verify the API server is up and running.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [nil]
|
26
|
+
def health_api_v1_health_get(opts = {})
|
27
|
+
health_api_v1_health_get_with_http_info(opts)
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
# Health
|
32
|
+
# Verify the API server is up and running.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
35
|
+
def health_api_v1_health_get_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: HealthApi.health_api_v1_health_get ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/api/v1/health/'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
|
48
|
+
# form parameters
|
49
|
+
form_params = opts[:form_params] || {}
|
50
|
+
|
51
|
+
# http body (model)
|
52
|
+
post_body = opts[:debug_body]
|
53
|
+
|
54
|
+
# return_type
|
55
|
+
return_type = opts[:debug_return_type]
|
56
|
+
|
57
|
+
# auth_names
|
58
|
+
auth_names = opts[:debug_auth_names] || []
|
59
|
+
|
60
|
+
new_options = opts.merge(
|
61
|
+
:operation => :"HealthApi.health_api_v1_health_get",
|
62
|
+
:header_params => header_params,
|
63
|
+
:query_params => query_params,
|
64
|
+
:form_params => form_params,
|
65
|
+
:body => post_body,
|
66
|
+
:auth_names => auth_names,
|
67
|
+
:return_type => return_type
|
68
|
+
)
|
69
|
+
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: HealthApi#health_api_v1_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|