svix 0.83.1 → 0.84.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/application_api.rb +247 -181
- data/lib/svix/api/authentication_api.rb +82 -150
- data/lib/svix/api/background_tasks_api.rb +161 -0
- data/lib/svix/api/endpoint_api.rb +561 -485
- data/lib/svix/api/environment_api.rb +16 -16
- data/lib/svix/api/environment_settings_api.rb +7 -10
- data/lib/svix/api/event_type_api.rb +152 -81
- data/lib/svix/api/health_api.rb +6 -9
- data/lib/svix/api/integration_api.rb +123 -134
- data/lib/svix/api/message_api.rb +96 -102
- data/lib/svix/api/message_attempt_api.rb +382 -406
- data/lib/svix/api/statistics_api.rb +107 -45
- data/lib/svix/api_client.rb +0 -1
- data/lib/svix/application_api.rb +22 -22
- data/lib/svix/authentication_api.rb +3 -3
- data/lib/svix/configuration.rb +0 -7
- data/lib/svix/endpoint_api.rb +16 -16
- data/lib/svix/event_type_api.rb +19 -19
- data/lib/svix/integration_api.rb +26 -26
- data/lib/svix/message_api.rb +4 -4
- data/lib/svix/message_attempt_api.rb +8 -8
- data/lib/svix/models/app_portal_access_in.rb +1 -0
- data/lib/svix/models/application_in.rb +34 -1
- data/lib/svix/models/application_out.rb +20 -2
- data/lib/svix/models/application_patch.rb +299 -0
- data/lib/svix/models/application_stats.rb +0 -1
- data/lib/svix/models/{webhook_types.rb → background_task_out.rb} +40 -69
- data/lib/svix/models/background_task_out_common.rb +251 -0
- data/lib/svix/models/background_task_status.rb +38 -0
- data/lib/svix/models/background_task_type.rb +38 -0
- data/lib/svix/models/calculate_app_stats_in.rb +255 -0
- data/lib/svix/models/endpoint_created_event.rb +5 -0
- data/lib/svix/models/endpoint_created_event_data.rb +0 -2
- data/lib/svix/models/endpoint_deleted_event.rb +5 -0
- data/lib/svix/models/endpoint_deleted_event_data.rb +0 -2
- data/lib/svix/models/endpoint_disabled_event.rb +5 -0
- data/lib/svix/models/endpoint_disabled_event_data.rb +1 -2
- data/lib/svix/models/endpoint_in.rb +19 -10
- data/lib/svix/models/endpoint_message_out.rb +1 -0
- data/lib/svix/models/endpoint_out.rb +33 -15
- data/lib/svix/models/endpoint_patch.rb +405 -0
- data/lib/svix/models/endpoint_secret_rotate_in.rb +2 -0
- data/lib/svix/models/endpoint_transformation_in.rb +0 -2
- data/lib/svix/models/endpoint_transformation_simulate_in.rb +6 -0
- data/lib/svix/models/endpoint_update.rb +19 -10
- data/lib/svix/models/endpoint_updated_event.rb +5 -0
- data/lib/svix/models/endpoint_updated_event_data.rb +0 -2
- data/lib/svix/models/event_type_example_out.rb +4 -2
- data/lib/svix/models/event_type_patch.rb +275 -0
- data/lib/svix/models/event_type_schema_in.rb +0 -1
- data/lib/svix/models/http_validation_error.rb +5 -0
- data/lib/svix/models/list_response_application_stats.rb +15 -5
- data/lib/svix/models/list_response_background_task_out.rb +259 -0
- data/lib/svix/models/list_response_integration_out.rb +15 -5
- data/lib/svix/models/list_response_message_endpoint_out.rb +15 -5
- data/lib/svix/models/message_attempt_exhausted_event.rb +5 -0
- data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -2
- data/lib/svix/models/message_attempt_failing_event.rb +5 -0
- data/lib/svix/models/message_attempt_failing_event_data.rb +1 -2
- data/lib/svix/models/message_attempt_headers_out.rb +27 -1
- data/lib/svix/models/message_endpoint_out.rb +45 -29
- data/lib/svix/models/message_in.rb +0 -1
- data/lib/svix/models/{one_time_token_out.rb → recover_out.rb} +41 -13
- data/lib/svix/models/{one_time_token_in.rb → replay_out.rb} +41 -13
- data/lib/svix/models/transformation_http_method.rb +1 -1
- data/lib/svix/models/validation_error.rb +4 -0
- data/lib/svix/version.rb +1 -1
- metadata +14 -5
@@ -19,120 +19,52 @@ module Svix
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
23
|
-
#
|
24
|
-
# @param one_time_token_in [OneTimeTokenIn]
|
25
|
-
# @param [Hash] opts the optional parameters
|
26
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
27
|
-
# @return [OneTimeTokenOut]
|
28
|
-
def exchange_one_time_token_api_v1_auth_one_time_token_post(one_time_token_in, opts = {})
|
29
|
-
data, _status_code, _headers = exchange_one_time_token_api_v1_auth_one_time_token_post_with_http_info(one_time_token_in, opts)
|
30
|
-
data
|
31
|
-
end
|
32
|
-
|
33
|
-
# Exchange One Time Token
|
34
|
-
# Exchange a one-time-token for an application token.
|
35
|
-
# @param one_time_token_in [OneTimeTokenIn]
|
36
|
-
# @param [Hash] opts the optional parameters
|
37
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
38
|
-
# @return [Array<(OneTimeTokenOut, Integer, Hash)>] OneTimeTokenOut data, response status code and response headers
|
39
|
-
def exchange_one_time_token_api_v1_auth_one_time_token_post_with_http_info(one_time_token_in, opts = {})
|
40
|
-
if @api_client.config.debugging
|
41
|
-
@api_client.config.logger.debug 'Calling API: AuthenticationApi.exchange_one_time_token_api_v1_auth_one_time_token_post ...'
|
42
|
-
end
|
43
|
-
# verify the required parameter 'one_time_token_in' is set
|
44
|
-
if @api_client.config.client_side_validation && one_time_token_in.nil?
|
45
|
-
fail ArgumentError, "Missing the required parameter 'one_time_token_in' when calling AuthenticationApi.exchange_one_time_token_api_v1_auth_one_time_token_post"
|
46
|
-
end
|
47
|
-
# resource path
|
48
|
-
local_var_path = '/api/v1/auth/one-time-token/'
|
49
|
-
|
50
|
-
# query parameters
|
51
|
-
query_params = opts[:query_params] || {}
|
52
|
-
|
53
|
-
# header parameters
|
54
|
-
header_params = opts[:header_params] || {}
|
55
|
-
# HTTP header 'Accept' (if needed)
|
56
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
57
|
-
# HTTP header 'Content-Type'
|
58
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
59
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
60
|
-
|
61
|
-
# form parameters
|
62
|
-
form_params = opts[:form_params] || {}
|
63
|
-
|
64
|
-
# http body (model)
|
65
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(one_time_token_in)
|
66
|
-
|
67
|
-
# return_type
|
68
|
-
return_type = opts[:debug_return_type] || 'OneTimeTokenOut'
|
69
|
-
|
70
|
-
# auth_names
|
71
|
-
auth_names = opts[:debug_auth_names] || []
|
72
|
-
|
73
|
-
new_options = opts.merge(
|
74
|
-
:operation => :"AuthenticationApi.exchange_one_time_token_api_v1_auth_one_time_token_post",
|
75
|
-
:header_params => header_params,
|
76
|
-
:query_params => query_params,
|
77
|
-
:form_params => form_params,
|
78
|
-
:body => post_body,
|
79
|
-
:auth_names => auth_names,
|
80
|
-
:return_type => return_type
|
81
|
-
)
|
82
|
-
|
83
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
-
if @api_client.config.debugging
|
85
|
-
@api_client.config.logger.debug "API called: AuthenticationApi#exchange_one_time_token_api_v1_auth_one_time_token_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
-
end
|
87
|
-
return data, status_code, headers
|
88
|
-
end
|
89
|
-
|
90
|
-
# Expire All
|
91
|
-
# Expire all of the tokens associated with a specific Application
|
22
|
+
# App Portal Access
|
23
|
+
# Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
|
92
24
|
# @param app_id [String]
|
93
|
-
# @param
|
25
|
+
# @param app_portal_access_in [AppPortalAccessIn]
|
94
26
|
# @param [Hash] opts the optional parameters
|
95
27
|
# @option opts [String] :idempotency_key The request's idempotency key
|
96
|
-
# @return [
|
97
|
-
def
|
98
|
-
|
99
|
-
|
28
|
+
# @return [AppPortalAccessOut]
|
29
|
+
def v1_authentication_app_portal_access(app_id, app_portal_access_in, opts = {})
|
30
|
+
data, _status_code, _headers = v1_authentication_app_portal_access_with_http_info(app_id, app_portal_access_in, opts)
|
31
|
+
data
|
100
32
|
end
|
101
33
|
|
102
|
-
#
|
103
|
-
#
|
34
|
+
# App Portal Access
|
35
|
+
# Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
|
104
36
|
# @param app_id [String]
|
105
|
-
# @param
|
37
|
+
# @param app_portal_access_in [AppPortalAccessIn]
|
106
38
|
# @param [Hash] opts the optional parameters
|
107
39
|
# @option opts [String] :idempotency_key The request's idempotency key
|
108
|
-
# @return [Array<(
|
109
|
-
def
|
40
|
+
# @return [Array<(AppPortalAccessOut, Integer, Hash)>] AppPortalAccessOut data, response status code and response headers
|
41
|
+
def v1_authentication_app_portal_access_with_http_info(app_id, app_portal_access_in, opts = {})
|
110
42
|
if @api_client.config.debugging
|
111
|
-
@api_client.config.logger.debug 'Calling API: AuthenticationApi.
|
43
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_app_portal_access ...'
|
112
44
|
end
|
113
45
|
# verify the required parameter 'app_id' is set
|
114
46
|
if @api_client.config.client_side_validation && app_id.nil?
|
115
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.
|
47
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.v1_authentication_app_portal_access"
|
116
48
|
end
|
117
49
|
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
118
|
-
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.
|
50
|
+
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_app_portal_access, the character length must be smaller than or equal to 256.'
|
119
51
|
end
|
120
52
|
|
121
53
|
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
122
|
-
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.
|
54
|
+
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_app_portal_access, the character length must be great than or equal to 1.'
|
123
55
|
end
|
124
56
|
|
125
57
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
126
58
|
if @api_client.config.client_side_validation && app_id !~ pattern
|
127
|
-
fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.
|
59
|
+
fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.v1_authentication_app_portal_access, must conform to the pattern #{pattern}."
|
128
60
|
end
|
129
61
|
|
130
|
-
# verify the required parameter '
|
131
|
-
if @api_client.config.client_side_validation &&
|
132
|
-
fail ArgumentError, "Missing the required parameter '
|
62
|
+
# verify the required parameter 'app_portal_access_in' is set
|
63
|
+
if @api_client.config.client_side_validation && app_portal_access_in.nil?
|
64
|
+
fail ArgumentError, "Missing the required parameter 'app_portal_access_in' when calling AuthenticationApi.v1_authentication_app_portal_access"
|
133
65
|
end
|
134
66
|
# resource path
|
135
|
-
local_var_path = '/api/v1/auth/app/{app_id}/
|
67
|
+
local_var_path = '/api/v1/auth/app-portal-access/{app_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
136
68
|
|
137
69
|
# query parameters
|
138
70
|
query_params = opts[:query_params] || {}
|
@@ -149,16 +81,16 @@ module Svix
|
|
149
81
|
form_params = opts[:form_params] || {}
|
150
82
|
|
151
83
|
# http body (model)
|
152
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
84
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(app_portal_access_in)
|
153
85
|
|
154
86
|
# return_type
|
155
|
-
return_type = opts[:debug_return_type]
|
87
|
+
return_type = opts[:debug_return_type] || 'AppPortalAccessOut'
|
156
88
|
|
157
89
|
# auth_names
|
158
|
-
auth_names = opts[:debug_auth_names] || [
|
90
|
+
auth_names = opts[:debug_auth_names] || []
|
159
91
|
|
160
92
|
new_options = opts.merge(
|
161
|
-
:operation => :"AuthenticationApi.
|
93
|
+
:operation => :"AuthenticationApi.v1_authentication_app_portal_access",
|
162
94
|
:header_params => header_params,
|
163
95
|
:query_params => query_params,
|
164
96
|
:form_params => form_params,
|
@@ -169,57 +101,51 @@ module Svix
|
|
169
101
|
|
170
102
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
171
103
|
if @api_client.config.debugging
|
172
|
-
@api_client.config.logger.debug "API called: AuthenticationApi#
|
104
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_app_portal_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
173
105
|
end
|
174
106
|
return data, status_code, headers
|
175
107
|
end
|
176
108
|
|
177
|
-
#
|
178
|
-
# Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
|
109
|
+
# Dashboard Access
|
110
|
+
# DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
|
179
111
|
# @param app_id [String]
|
180
|
-
# @param app_portal_access_in [AppPortalAccessIn]
|
181
112
|
# @param [Hash] opts the optional parameters
|
182
113
|
# @option opts [String] :idempotency_key The request's idempotency key
|
183
|
-
# @return [
|
184
|
-
def
|
185
|
-
data, _status_code, _headers =
|
114
|
+
# @return [DashboardAccessOut]
|
115
|
+
def v1_authentication_dashboard_access(app_id, opts = {})
|
116
|
+
data, _status_code, _headers = v1_authentication_dashboard_access_with_http_info(app_id, opts)
|
186
117
|
data
|
187
118
|
end
|
188
119
|
|
189
|
-
#
|
190
|
-
# Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
|
120
|
+
# Dashboard Access
|
121
|
+
# DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
|
191
122
|
# @param app_id [String]
|
192
|
-
# @param app_portal_access_in [AppPortalAccessIn]
|
193
123
|
# @param [Hash] opts the optional parameters
|
194
124
|
# @option opts [String] :idempotency_key The request's idempotency key
|
195
|
-
# @return [Array<(
|
196
|
-
def
|
125
|
+
# @return [Array<(DashboardAccessOut, Integer, Hash)>] DashboardAccessOut data, response status code and response headers
|
126
|
+
def v1_authentication_dashboard_access_with_http_info(app_id, opts = {})
|
197
127
|
if @api_client.config.debugging
|
198
|
-
@api_client.config.logger.debug 'Calling API: AuthenticationApi.
|
128
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_dashboard_access ...'
|
199
129
|
end
|
200
130
|
# verify the required parameter 'app_id' is set
|
201
131
|
if @api_client.config.client_side_validation && app_id.nil?
|
202
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.
|
132
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.v1_authentication_dashboard_access"
|
203
133
|
end
|
204
134
|
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
205
|
-
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.
|
135
|
+
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_dashboard_access, the character length must be smaller than or equal to 256.'
|
206
136
|
end
|
207
137
|
|
208
138
|
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
209
|
-
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.
|
139
|
+
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_dashboard_access, the character length must be great than or equal to 1.'
|
210
140
|
end
|
211
141
|
|
212
142
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
213
143
|
if @api_client.config.client_side_validation && app_id !~ pattern
|
214
|
-
fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.
|
144
|
+
fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.v1_authentication_dashboard_access, must conform to the pattern #{pattern}."
|
215
145
|
end
|
216
146
|
|
217
|
-
# verify the required parameter 'app_portal_access_in' is set
|
218
|
-
if @api_client.config.client_side_validation && app_portal_access_in.nil?
|
219
|
-
fail ArgumentError, "Missing the required parameter 'app_portal_access_in' when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post"
|
220
|
-
end
|
221
147
|
# resource path
|
222
|
-
local_var_path = '/api/v1/auth/
|
148
|
+
local_var_path = '/api/v1/auth/dashboard-access/{app_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
223
149
|
|
224
150
|
# query parameters
|
225
151
|
query_params = opts[:query_params] || {}
|
@@ -228,24 +154,22 @@ module Svix
|
|
228
154
|
header_params = opts[:header_params] || {}
|
229
155
|
# HTTP header 'Accept' (if needed)
|
230
156
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
231
|
-
# HTTP header 'Content-Type'
|
232
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
233
157
|
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
234
158
|
|
235
159
|
# form parameters
|
236
160
|
form_params = opts[:form_params] || {}
|
237
161
|
|
238
162
|
# http body (model)
|
239
|
-
post_body = opts[:debug_body]
|
163
|
+
post_body = opts[:debug_body]
|
240
164
|
|
241
165
|
# return_type
|
242
|
-
return_type = opts[:debug_return_type] || '
|
166
|
+
return_type = opts[:debug_return_type] || 'DashboardAccessOut'
|
243
167
|
|
244
168
|
# auth_names
|
245
|
-
auth_names = opts[:debug_auth_names] || [
|
169
|
+
auth_names = opts[:debug_auth_names] || []
|
246
170
|
|
247
171
|
new_options = opts.merge(
|
248
|
-
:operation => :"AuthenticationApi.
|
172
|
+
:operation => :"AuthenticationApi.v1_authentication_dashboard_access",
|
249
173
|
:header_params => header_params,
|
250
174
|
:query_params => query_params,
|
251
175
|
:form_params => form_params,
|
@@ -256,51 +180,57 @@ module Svix
|
|
256
180
|
|
257
181
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
258
182
|
if @api_client.config.debugging
|
259
|
-
@api_client.config.logger.debug "API called: AuthenticationApi#
|
183
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_dashboard_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
260
184
|
end
|
261
185
|
return data, status_code, headers
|
262
186
|
end
|
263
187
|
|
264
|
-
#
|
265
|
-
#
|
188
|
+
# Expire All
|
189
|
+
# Expire all of the tokens associated with a specific Application
|
266
190
|
# @param app_id [String]
|
191
|
+
# @param application_token_expire_in [ApplicationTokenExpireIn]
|
267
192
|
# @param [Hash] opts the optional parameters
|
268
193
|
# @option opts [String] :idempotency_key The request's idempotency key
|
269
|
-
# @return [
|
270
|
-
def
|
271
|
-
|
272
|
-
|
194
|
+
# @return [nil]
|
195
|
+
def v1_authentication_expire_all(app_id, application_token_expire_in, opts = {})
|
196
|
+
v1_authentication_expire_all_with_http_info(app_id, application_token_expire_in, opts)
|
197
|
+
nil
|
273
198
|
end
|
274
199
|
|
275
|
-
#
|
276
|
-
#
|
200
|
+
# Expire All
|
201
|
+
# Expire all of the tokens associated with a specific Application
|
277
202
|
# @param app_id [String]
|
203
|
+
# @param application_token_expire_in [ApplicationTokenExpireIn]
|
278
204
|
# @param [Hash] opts the optional parameters
|
279
205
|
# @option opts [String] :idempotency_key The request's idempotency key
|
280
|
-
# @return [Array<(
|
281
|
-
def
|
206
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
207
|
+
def v1_authentication_expire_all_with_http_info(app_id, application_token_expire_in, opts = {})
|
282
208
|
if @api_client.config.debugging
|
283
|
-
@api_client.config.logger.debug 'Calling API: AuthenticationApi.
|
209
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_expire_all ...'
|
284
210
|
end
|
285
211
|
# verify the required parameter 'app_id' is set
|
286
212
|
if @api_client.config.client_side_validation && app_id.nil?
|
287
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.
|
213
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.v1_authentication_expire_all"
|
288
214
|
end
|
289
215
|
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
290
|
-
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.
|
216
|
+
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_expire_all, the character length must be smaller than or equal to 256.'
|
291
217
|
end
|
292
218
|
|
293
219
|
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
294
|
-
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.
|
220
|
+
fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.v1_authentication_expire_all, the character length must be great than or equal to 1.'
|
295
221
|
end
|
296
222
|
|
297
223
|
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
298
224
|
if @api_client.config.client_side_validation && app_id !~ pattern
|
299
|
-
fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.
|
225
|
+
fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.v1_authentication_expire_all, must conform to the pattern #{pattern}."
|
300
226
|
end
|
301
227
|
|
228
|
+
# verify the required parameter 'application_token_expire_in' is set
|
229
|
+
if @api_client.config.client_side_validation && application_token_expire_in.nil?
|
230
|
+
fail ArgumentError, "Missing the required parameter 'application_token_expire_in' when calling AuthenticationApi.v1_authentication_expire_all"
|
231
|
+
end
|
302
232
|
# resource path
|
303
|
-
local_var_path = '/api/v1/auth/
|
233
|
+
local_var_path = '/api/v1/auth/app/{app_id}/expire-all/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
304
234
|
|
305
235
|
# query parameters
|
306
236
|
query_params = opts[:query_params] || {}
|
@@ -309,22 +239,24 @@ module Svix
|
|
309
239
|
header_params = opts[:header_params] || {}
|
310
240
|
# HTTP header 'Accept' (if needed)
|
311
241
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
242
|
+
# HTTP header 'Content-Type'
|
243
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
312
244
|
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
313
245
|
|
314
246
|
# form parameters
|
315
247
|
form_params = opts[:form_params] || {}
|
316
248
|
|
317
249
|
# http body (model)
|
318
|
-
post_body = opts[:debug_body]
|
250
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(application_token_expire_in)
|
319
251
|
|
320
252
|
# return_type
|
321
|
-
return_type = opts[:debug_return_type]
|
253
|
+
return_type = opts[:debug_return_type]
|
322
254
|
|
323
255
|
# auth_names
|
324
|
-
auth_names = opts[:debug_auth_names] || [
|
256
|
+
auth_names = opts[:debug_auth_names] || []
|
325
257
|
|
326
258
|
new_options = opts.merge(
|
327
|
-
:operation => :"AuthenticationApi.
|
259
|
+
:operation => :"AuthenticationApi.v1_authentication_expire_all",
|
328
260
|
:header_params => header_params,
|
329
261
|
:query_params => query_params,
|
330
262
|
:form_params => form_params,
|
@@ -335,7 +267,7 @@ module Svix
|
|
335
267
|
|
336
268
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
337
269
|
if @api_client.config.debugging
|
338
|
-
@api_client.config.logger.debug "API called: AuthenticationApi#
|
270
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_expire_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
339
271
|
end
|
340
272
|
return data, status_code, headers
|
341
273
|
end
|
@@ -345,8 +277,8 @@ module Svix
|
|
345
277
|
# @param [Hash] opts the optional parameters
|
346
278
|
# @option opts [String] :idempotency_key The request's idempotency key
|
347
279
|
# @return [nil]
|
348
|
-
def
|
349
|
-
|
280
|
+
def v1_authentication_logout(opts = {})
|
281
|
+
v1_authentication_logout_with_http_info(opts)
|
350
282
|
nil
|
351
283
|
end
|
352
284
|
|
@@ -355,9 +287,9 @@ module Svix
|
|
355
287
|
# @param [Hash] opts the optional parameters
|
356
288
|
# @option opts [String] :idempotency_key The request's idempotency key
|
357
289
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
358
|
-
def
|
290
|
+
def v1_authentication_logout_with_http_info(opts = {})
|
359
291
|
if @api_client.config.debugging
|
360
|
-
@api_client.config.logger.debug 'Calling API: AuthenticationApi.
|
292
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_logout ...'
|
361
293
|
end
|
362
294
|
# resource path
|
363
295
|
local_var_path = '/api/v1/auth/logout/'
|
@@ -381,10 +313,10 @@ module Svix
|
|
381
313
|
return_type = opts[:debug_return_type]
|
382
314
|
|
383
315
|
# auth_names
|
384
|
-
auth_names = opts[:debug_auth_names] || [
|
316
|
+
auth_names = opts[:debug_auth_names] || []
|
385
317
|
|
386
318
|
new_options = opts.merge(
|
387
|
-
:operation => :"AuthenticationApi.
|
319
|
+
:operation => :"AuthenticationApi.v1_authentication_logout",
|
388
320
|
:header_params => header_params,
|
389
321
|
:query_params => query_params,
|
390
322
|
:form_params => form_params,
|
@@ -395,7 +327,7 @@ module Svix
|
|
395
327
|
|
396
328
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
397
329
|
if @api_client.config.debugging
|
398
|
-
@api_client.config.logger.debug "API called: AuthenticationApi#
|
330
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
399
331
|
end
|
400
332
|
return data, status_code, headers
|
401
333
|
end
|
@@ -0,0 +1,161 @@
|
|
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 user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
|
5
|
+
|
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 BackgroundTasksApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get Background Task
|
23
|
+
# Get a background task by ID.
|
24
|
+
# @param task_id [String]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [BackgroundTaskOut]
|
27
|
+
def get_background_task(task_id, opts = {})
|
28
|
+
data, _status_code, _headers = get_background_task_with_http_info(task_id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get Background Task
|
33
|
+
# Get a background task by ID.
|
34
|
+
# @param task_id [String]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(BackgroundTaskOut, Integer, Hash)>] BackgroundTaskOut data, response status code and response headers
|
37
|
+
def get_background_task_with_http_info(task_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: BackgroundTasksApi.get_background_task ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'task_id' is set
|
42
|
+
if @api_client.config.client_side_validation && task_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'task_id' when calling BackgroundTasksApi.get_background_task"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/api/v1/background-task/{task_id}/'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s))
|
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
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:debug_body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:debug_return_type] || 'BackgroundTaskOut'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:debug_auth_names] || []
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:operation => :"BackgroundTasksApi.get_background_task",
|
70
|
+
:header_params => header_params,
|
71
|
+
:query_params => query_params,
|
72
|
+
:form_params => form_params,
|
73
|
+
:body => post_body,
|
74
|
+
:auth_names => auth_names,
|
75
|
+
:return_type => return_type
|
76
|
+
)
|
77
|
+
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
79
|
+
if @api_client.config.debugging
|
80
|
+
@api_client.config.logger.debug "API called: BackgroundTasksApi#get_background_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
81
|
+
end
|
82
|
+
return data, status_code, headers
|
83
|
+
end
|
84
|
+
|
85
|
+
# List Background Tasks
|
86
|
+
# List background tasks executed in the past 90 days.
|
87
|
+
# @param [Hash] opts the optional parameters
|
88
|
+
# @option opts [BackgroundTaskStatus] :status
|
89
|
+
# @option opts [BackgroundTaskType] :task
|
90
|
+
# @option opts [Integer] :limit
|
91
|
+
# @option opts [String] :iterator
|
92
|
+
# @option opts [Ordering] :order
|
93
|
+
# @return [ListResponseBackgroundTaskOut]
|
94
|
+
def list_background_tasks(opts = {})
|
95
|
+
data, _status_code, _headers = list_background_tasks_with_http_info(opts)
|
96
|
+
data
|
97
|
+
end
|
98
|
+
|
99
|
+
# List Background Tasks
|
100
|
+
# List background tasks executed in the past 90 days.
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @option opts [BackgroundTaskStatus] :status
|
103
|
+
# @option opts [BackgroundTaskType] :task
|
104
|
+
# @option opts [Integer] :limit
|
105
|
+
# @option opts [String] :iterator
|
106
|
+
# @option opts [Ordering] :order
|
107
|
+
# @return [Array<(ListResponseBackgroundTaskOut, Integer, Hash)>] ListResponseBackgroundTaskOut data, response status code and response headers
|
108
|
+
def list_background_tasks_with_http_info(opts = {})
|
109
|
+
if @api_client.config.debugging
|
110
|
+
@api_client.config.logger.debug 'Calling API: BackgroundTasksApi.list_background_tasks ...'
|
111
|
+
end
|
112
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
|
113
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BackgroundTasksApi.list_background_tasks, must be greater than or equal to 0.'
|
114
|
+
end
|
115
|
+
|
116
|
+
# resource path
|
117
|
+
local_var_path = '/api/v1/background-task/'
|
118
|
+
|
119
|
+
# query parameters
|
120
|
+
query_params = opts[:query_params] || {}
|
121
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
122
|
+
query_params[:'task'] = opts[:'task'] if !opts[:'task'].nil?
|
123
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
124
|
+
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
125
|
+
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
|
126
|
+
|
127
|
+
# header parameters
|
128
|
+
header_params = opts[:header_params] || {}
|
129
|
+
# HTTP header 'Accept' (if needed)
|
130
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
131
|
+
|
132
|
+
# form parameters
|
133
|
+
form_params = opts[:form_params] || {}
|
134
|
+
|
135
|
+
# http body (model)
|
136
|
+
post_body = opts[:debug_body]
|
137
|
+
|
138
|
+
# return_type
|
139
|
+
return_type = opts[:debug_return_type] || 'ListResponseBackgroundTaskOut'
|
140
|
+
|
141
|
+
# auth_names
|
142
|
+
auth_names = opts[:debug_auth_names] || []
|
143
|
+
|
144
|
+
new_options = opts.merge(
|
145
|
+
:operation => :"BackgroundTasksApi.list_background_tasks",
|
146
|
+
:header_params => header_params,
|
147
|
+
:query_params => query_params,
|
148
|
+
:form_params => form_params,
|
149
|
+
:body => post_body,
|
150
|
+
:auth_names => auth_names,
|
151
|
+
:return_type => return_type
|
152
|
+
)
|
153
|
+
|
154
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
155
|
+
if @api_client.config.debugging
|
156
|
+
@api_client.config.logger.debug "API called: BackgroundTasksApi#list_background_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
157
|
+
end
|
158
|
+
return data, status_code, headers
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|