svix 0.28.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -1
  3. data/README.md +16 -3
  4. data/lib/svix/api/application_api.rb +386 -0
  5. data/lib/svix/api/authentication_api.rb +155 -0
  6. data/lib/svix/api/endpoint_api.rb +774 -0
  7. data/lib/svix/api/event_type_api.rb +377 -0
  8. data/lib/svix/api/health_api.rb +77 -0
  9. data/lib/svix/api/message_api.rb +289 -0
  10. data/lib/svix/api/message_attempt_api.rb +678 -0
  11. data/lib/svix/api_client.rb +399 -0
  12. data/lib/svix/api_error.rb +57 -0
  13. data/lib/svix/application_api.rb +29 -0
  14. data/lib/svix/authentication_api.rb +17 -0
  15. data/lib/svix/configuration.rb +277 -0
  16. data/lib/svix/endpoint_api.rb +34 -0
  17. data/{src → lib}/svix/errors.rb +0 -0
  18. data/lib/svix/event_type_api.rb +25 -0
  19. data/lib/svix/internal.rb +16 -0
  20. data/lib/svix/message_api.rb +21 -0
  21. data/lib/svix/message_attempt_api.rb +33 -0
  22. data/lib/svix/models/application_in.rb +277 -0
  23. data/lib/svix/models/application_out.rb +305 -0
  24. data/lib/svix/models/dashboard_access_out.rb +265 -0
  25. data/lib/svix/models/endpoint_created_event.rb +269 -0
  26. data/lib/svix/models/endpoint_created_event_data.rb +246 -0
  27. data/lib/svix/models/endpoint_deleted_event.rb +269 -0
  28. data/lib/svix/models/endpoint_deleted_event_data.rb +246 -0
  29. data/lib/svix/models/endpoint_disabled_event.rb +269 -0
  30. data/lib/svix/models/endpoint_disabled_event_data.rb +260 -0
  31. data/lib/svix/models/endpoint_in.rb +368 -0
  32. data/lib/svix/models/endpoint_message_out.rb +363 -0
  33. data/lib/svix/models/endpoint_out.rb +386 -0
  34. data/lib/svix/models/endpoint_secret_out.rb +224 -0
  35. data/lib/svix/models/endpoint_stats.rb +265 -0
  36. data/lib/svix/models/endpoint_update.rb +358 -0
  37. data/lib/svix/models/endpoint_updated_event_data.rb +246 -0
  38. data/lib/svix/models/endpointd_updated_event.rb +269 -0
  39. data/lib/svix/models/event_example_in.rb +253 -0
  40. data/lib/svix/models/event_type_in.rb +279 -0
  41. data/lib/svix/models/event_type_out.rb +279 -0
  42. data/lib/svix/models/event_type_update.rb +235 -0
  43. data/lib/svix/models/http_error_out.rb +237 -0
  44. data/lib/svix/models/http_validation_error.rb +220 -0
  45. data/lib/svix/models/list_response_application_out.rb +248 -0
  46. data/lib/svix/models/list_response_endpoint_message_out.rb +248 -0
  47. data/lib/svix/models/list_response_endpoint_out.rb +248 -0
  48. data/lib/svix/models/list_response_event_type_out.rb +248 -0
  49. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +248 -0
  50. data/lib/svix/models/list_response_message_attempt_out.rb +248 -0
  51. data/lib/svix/models/list_response_message_endpoint_out.rb +248 -0
  52. data/lib/svix/models/list_response_message_out.rb +248 -0
  53. data/lib/svix/models/message_attempt_endpoint_out.rb +293 -0
  54. data/lib/svix/models/message_attempt_exhausted_event.rb +269 -0
  55. data/lib/svix/models/message_attempt_exhausted_event_data.rb +274 -0
  56. data/lib/svix/models/message_attempt_failed_event.rb +251 -0
  57. data/lib/svix/models/message_attempt_out.rb +307 -0
  58. data/lib/svix/models/message_attempt_trigger_type.rb +37 -0
  59. data/lib/svix/models/message_endpoint_out.rb +409 -0
  60. data/lib/svix/models/message_in.rb +312 -0
  61. data/lib/svix/models/message_out.rb +340 -0
  62. data/lib/svix/models/message_status.rb +39 -0
  63. data/lib/svix/models/validation_error.rb +253 -0
  64. data/lib/svix/models/webhook_types.rb +280 -0
  65. data/lib/svix/svix.rb +43 -0
  66. data/{src → lib}/svix/util.rb +1 -1
  67. data/{src → lib}/svix/version.rb +1 -1
  68. data/{src → lib}/svix/webhook.rb +1 -1
  69. data/lib/svix.rb +76 -0
  70. data/svix.gemspec +16 -6
  71. metadata +89 -9
  72. data/.gitignore +0 -9
  73. data/src/svix.rb +0 -8
@@ -0,0 +1,377 @@
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 an event type.
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 an event type.
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
+ # Delete Event Type
88
+ # Delete an event type.
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
+ # Delete Event Type
98
+ # Delete an event type.
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
+ # Get Event Type
160
+ # Get an event type.
161
+ # @param event_type_name [String]
162
+ # @param [Hash] opts the optional parameters
163
+ # @return [EventTypeOut]
164
+ def get_event_type_api_v1_event_type_event_type_name_get(event_type_name, opts = {})
165
+ data, _status_code, _headers = get_event_type_api_v1_event_type_event_type_name_get_with_http_info(event_type_name, opts)
166
+ data
167
+ end
168
+
169
+ # Get Event Type
170
+ # Get an event type.
171
+ # @param event_type_name [String]
172
+ # @param [Hash] opts the optional parameters
173
+ # @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers
174
+ def get_event_type_api_v1_event_type_event_type_name_get_with_http_info(event_type_name, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get ...'
177
+ end
178
+ # verify the required parameter 'event_type_name' is set
179
+ if @api_client.config.client_side_validation && event_type_name.nil?
180
+ fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get"
181
+ end
182
+ if @api_client.config.client_side_validation && event_type_name.to_s.length > 256
183
+ 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.'
184
+ end
185
+
186
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
187
+ if @api_client.config.client_side_validation && event_type_name !~ pattern
188
+ 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}."
189
+ end
190
+
191
+ # resource path
192
+ local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s))
193
+
194
+ # query parameters
195
+ query_params = opts[:query_params] || {}
196
+
197
+ # header parameters
198
+ header_params = opts[:header_params] || {}
199
+ # HTTP header 'Accept' (if needed)
200
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
201
+
202
+ # form parameters
203
+ form_params = opts[:form_params] || {}
204
+
205
+ # http body (model)
206
+ post_body = opts[:debug_body]
207
+
208
+ # return_type
209
+ return_type = opts[:debug_return_type] || 'EventTypeOut'
210
+
211
+ # auth_names
212
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
213
+
214
+ new_options = opts.merge(
215
+ :operation => :"EventTypeApi.get_event_type_api_v1_event_type_event_type_name_get",
216
+ :header_params => header_params,
217
+ :query_params => query_params,
218
+ :form_params => form_params,
219
+ :body => post_body,
220
+ :auth_names => auth_names,
221
+ :return_type => return_type
222
+ )
223
+
224
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
225
+ if @api_client.config.debugging
226
+ @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}"
227
+ end
228
+ return data, status_code, headers
229
+ end
230
+
231
+ # List Event Types
232
+ # Return the list of event types.
233
+ # @param [Hash] opts the optional parameters
234
+ # @option opts [String] :iterator
235
+ # @option opts [Integer] :limit (default to 50)
236
+ # @option opts [Boolean] :with_content (default to false)
237
+ # @return [ListResponseEventTypeOut]
238
+ def list_event_types_api_v1_event_type_get(opts = {})
239
+ data, _status_code, _headers = list_event_types_api_v1_event_type_get_with_http_info(opts)
240
+ data
241
+ end
242
+
243
+ # List Event Types
244
+ # Return the list of event types.
245
+ # @param [Hash] opts the optional parameters
246
+ # @option opts [String] :iterator
247
+ # @option opts [Integer] :limit
248
+ # @option opts [Boolean] :with_content
249
+ # @return [Array<(ListResponseEventTypeOut, Integer, Hash)>] ListResponseEventTypeOut data, response status code and response headers
250
+ def list_event_types_api_v1_event_type_get_with_http_info(opts = {})
251
+ if @api_client.config.debugging
252
+ @api_client.config.logger.debug 'Calling API: EventTypeApi.list_event_types_api_v1_event_type_get ...'
253
+ end
254
+ # resource path
255
+ local_var_path = '/api/v1/event-type/'
256
+
257
+ # query parameters
258
+ query_params = opts[:query_params] || {}
259
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
260
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
261
+ query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
262
+
263
+ # header parameters
264
+ header_params = opts[:header_params] || {}
265
+ # HTTP header 'Accept' (if needed)
266
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
267
+
268
+ # form parameters
269
+ form_params = opts[:form_params] || {}
270
+
271
+ # http body (model)
272
+ post_body = opts[:debug_body]
273
+
274
+ # return_type
275
+ return_type = opts[:debug_return_type] || 'ListResponseEventTypeOut'
276
+
277
+ # auth_names
278
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
279
+
280
+ new_options = opts.merge(
281
+ :operation => :"EventTypeApi.list_event_types_api_v1_event_type_get",
282
+ :header_params => header_params,
283
+ :query_params => query_params,
284
+ :form_params => form_params,
285
+ :body => post_body,
286
+ :auth_names => auth_names,
287
+ :return_type => return_type
288
+ )
289
+
290
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
291
+ if @api_client.config.debugging
292
+ @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}"
293
+ end
294
+ return data, status_code, headers
295
+ end
296
+
297
+ # Update Event Type
298
+ # Update an event type.
299
+ # @param event_type_name [String]
300
+ # @param event_type_update [EventTypeUpdate]
301
+ # @param [Hash] opts the optional parameters
302
+ # @return [EventTypeOut]
303
+ def update_event_type_api_v1_event_type_event_type_name_put(event_type_name, event_type_update, opts = {})
304
+ 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)
305
+ data
306
+ end
307
+
308
+ # Update Event Type
309
+ # Update an event type.
310
+ # @param event_type_name [String]
311
+ # @param event_type_update [EventTypeUpdate]
312
+ # @param [Hash] opts the optional parameters
313
+ # @return [Array<(EventTypeOut, Integer, Hash)>] EventTypeOut data, response status code and response headers
314
+ def update_event_type_api_v1_event_type_event_type_name_put_with_http_info(event_type_name, event_type_update, opts = {})
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug 'Calling API: EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put ...'
317
+ end
318
+ # verify the required parameter 'event_type_name' is set
319
+ if @api_client.config.client_side_validation && event_type_name.nil?
320
+ fail ArgumentError, "Missing the required parameter 'event_type_name' when calling EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put"
321
+ end
322
+ if @api_client.config.client_side_validation && event_type_name.to_s.length > 256
323
+ 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.'
324
+ end
325
+
326
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
327
+ if @api_client.config.client_side_validation && event_type_name !~ pattern
328
+ 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}."
329
+ end
330
+
331
+ # verify the required parameter 'event_type_update' is set
332
+ if @api_client.config.client_side_validation && event_type_update.nil?
333
+ fail ArgumentError, "Missing the required parameter 'event_type_update' when calling EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put"
334
+ end
335
+ # resource path
336
+ local_var_path = '/api/v1/event-type/{event_type_name}/'.sub('{' + 'event_type_name' + '}', CGI.escape(event_type_name.to_s))
337
+
338
+ # query parameters
339
+ query_params = opts[:query_params] || {}
340
+
341
+ # header parameters
342
+ header_params = opts[:header_params] || {}
343
+ # HTTP header 'Accept' (if needed)
344
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
345
+ # HTTP header 'Content-Type'
346
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
347
+
348
+ # form parameters
349
+ form_params = opts[:form_params] || {}
350
+
351
+ # http body (model)
352
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(event_type_update)
353
+
354
+ # return_type
355
+ return_type = opts[:debug_return_type] || 'EventTypeOut'
356
+
357
+ # auth_names
358
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
359
+
360
+ new_options = opts.merge(
361
+ :operation => :"EventTypeApi.update_event_type_api_v1_event_type_event_type_name_put",
362
+ :header_params => header_params,
363
+ :query_params => query_params,
364
+ :form_params => form_params,
365
+ :body => post_body,
366
+ :auth_names => auth_names,
367
+ :return_type => return_type
368
+ )
369
+
370
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
371
+ if @api_client.config.debugging
372
+ @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}"
373
+ end
374
+ return data, status_code, headers
375
+ end
376
+ end
377
+ 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