svix 1.24.0 → 1.26.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 +2 -2
- data/lib/svix/api/authentication_api.rb +87 -0
- data/lib/svix/api/endpoint_api.rb +277 -2
- data/lib/svix/api/events_api.rb +3 -3
- data/lib/svix/api/message_api.rb +317 -101
- data/lib/svix/api/transformation_template_api.rb +195 -24
- data/lib/svix/models/auth_token_out.rb +284 -0
- data/lib/svix/models/create_message_token_in.rb +250 -0
- data/lib/svix/models/create_stream_in.rb +225 -0
- data/lib/svix/models/endpoint_created_event_data.rb +1 -0
- data/lib/svix/models/endpoint_deleted_event_data.rb +1 -0
- data/lib/svix/models/endpoint_mtls_config_in.rb +15 -19
- data/lib/svix/models/endpoint_oauth_config_in.rb +13 -2
- data/lib/svix/models/endpoint_updated_event_data.rb +1 -0
- data/lib/svix/models/environment_settings_out.rb +15 -4
- data/lib/svix/models/event_in.rb +223 -0
- data/lib/svix/models/event_out.rb +237 -0
- data/lib/svix/models/event_stream_out.rb +253 -0
- data/lib/svix/models/event_type_from_open_api.rb +280 -0
- data/lib/svix/models/event_type_import_open_api_in.rb +13 -1
- data/lib/svix/models/event_type_import_open_api_out_data.rb +16 -4
- data/lib/svix/models/event_type_in.rb +38 -1
- data/lib/svix/models/event_type_out.rb +38 -1
- data/lib/svix/models/event_type_patch.rb +38 -1
- data/lib/svix/models/event_type_update.rb +38 -1
- data/lib/svix/models/hubspot_oauth_config_in.rb +223 -0
- data/lib/svix/models/{oauth_payload_out.rb → incoming_webhook_payload_out.rb} +3 -3
- data/lib/svix/models/kafka_security_protocol_type.rb +38 -0
- data/lib/svix/models/list_response_sink_out.rb +259 -0
- data/lib/svix/models/{message_stream_out.rb → message_events_out.rb} +3 -3
- data/lib/svix/models/message_subscriber_auth_token_out.rb +237 -0
- data/lib/svix/models/{oauth_payload_in.rb → o_auth_payload_in.rb} +3 -3
- data/lib/svix/models/o_auth_payload_out.rb +239 -0
- data/lib/svix/models/{oauth2_grant_type.rb → oauth2_grant_type_in.rb} +4 -3
- data/lib/svix/models/settings_in.rb +15 -4
- data/lib/svix/models/settings_out.rb +15 -4
- data/lib/svix/models/sink_in.rb +107 -0
- data/lib/svix/models/sink_in_one_of.rb +285 -0
- data/lib/svix/models/sink_in_one_of1.rb +313 -0
- data/lib/svix/models/sink_in_one_of2.rb +321 -0
- data/lib/svix/models/sink_in_one_of3.rb +271 -0
- data/lib/svix/models/sink_out.rb +107 -0
- data/lib/svix/version.rb +1 -1
- metadata +24 -6
data/lib/svix/api/message_api.rb
CHANGED
@@ -126,7 +126,7 @@ module Svix
|
|
126
126
|
end
|
127
127
|
|
128
128
|
# Create Message
|
129
|
-
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for
|
129
|
+
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
130
130
|
# @param app_id [String] The app's ID or UID
|
131
131
|
# @param message_in [MessageIn]
|
132
132
|
# @param [Hash] opts the optional parameters
|
@@ -139,7 +139,7 @@ module Svix
|
|
139
139
|
end
|
140
140
|
|
141
141
|
# Create Message
|
142
|
-
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for
|
142
|
+
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
143
143
|
# @param app_id [String] The app's ID or UID
|
144
144
|
# @param message_in [MessageIn]
|
145
145
|
# @param [Hash] opts the optional parameters
|
@@ -215,6 +215,321 @@ module Svix
|
|
215
215
|
return data, status_code, headers
|
216
216
|
end
|
217
217
|
|
218
|
+
# Message Events
|
219
|
+
# Reads the stream of created messages for an application
|
220
|
+
# @param app_id [String] The app's ID or UID
|
221
|
+
# @param [Hash] opts the optional parameters
|
222
|
+
# @option opts [Integer] :limit Limit the number of returned items
|
223
|
+
# @option opts [String] :iterator The iterator returned from a prior invocation
|
224
|
+
# @option opts [Array<String>] :event_types Filter response based on the event type
|
225
|
+
# @option opts [Array<String>] :channels Filter response based on the event type
|
226
|
+
# @option opts [Time] :after
|
227
|
+
# @return [MessageEventsOut]
|
228
|
+
def v1_message_events(app_id, opts = {})
|
229
|
+
data, _status_code, _headers = v1_message_events_with_http_info(app_id, opts)
|
230
|
+
data
|
231
|
+
end
|
232
|
+
|
233
|
+
# Message Events
|
234
|
+
# Reads the stream of created messages for an application
|
235
|
+
# @param app_id [String] The app's ID or UID
|
236
|
+
# @param [Hash] opts the optional parameters
|
237
|
+
# @option opts [Integer] :limit Limit the number of returned items
|
238
|
+
# @option opts [String] :iterator The iterator returned from a prior invocation
|
239
|
+
# @option opts [Array<String>] :event_types Filter response based on the event type
|
240
|
+
# @option opts [Array<String>] :channels Filter response based on the event type
|
241
|
+
# @option opts [Time] :after
|
242
|
+
# @return [Array<(MessageEventsOut, Integer, Hash)>] MessageEventsOut data, response status code and response headers
|
243
|
+
def v1_message_events_with_http_info(app_id, opts = {})
|
244
|
+
if @api_client.config.debugging
|
245
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events ...'
|
246
|
+
end
|
247
|
+
# verify the required parameter 'app_id' is set
|
248
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
249
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events"
|
250
|
+
end
|
251
|
+
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
252
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events, the character length must be smaller than or equal to 256.'
|
253
|
+
end
|
254
|
+
|
255
|
+
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
256
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events, the character length must be great than or equal to 1.'
|
257
|
+
end
|
258
|
+
|
259
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
260
|
+
if @api_client.config.client_side_validation && app_id !~ pattern
|
261
|
+
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events, must conform to the pattern #{pattern}."
|
262
|
+
end
|
263
|
+
|
264
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
265
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events, must be smaller than or equal to 250.'
|
266
|
+
end
|
267
|
+
|
268
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
269
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events, must be greater than or equal to 1.'
|
270
|
+
end
|
271
|
+
|
272
|
+
# resource path
|
273
|
+
local_var_path = '/api/v1/app/{app_id}/events'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
274
|
+
|
275
|
+
# query parameters
|
276
|
+
query_params = opts[:query_params] || {}
|
277
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
278
|
+
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
279
|
+
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
280
|
+
query_params[:'channels'] = @api_client.build_collection_param(opts[:'channels'], :multi) if !opts[:'channels'].nil?
|
281
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
282
|
+
|
283
|
+
# header parameters
|
284
|
+
header_params = opts[:header_params] || {}
|
285
|
+
# HTTP header 'Accept' (if needed)
|
286
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
287
|
+
|
288
|
+
# form parameters
|
289
|
+
form_params = opts[:form_params] || {}
|
290
|
+
|
291
|
+
# http body (model)
|
292
|
+
post_body = opts[:debug_body]
|
293
|
+
|
294
|
+
# return_type
|
295
|
+
return_type = opts[:debug_return_type] || 'MessageEventsOut'
|
296
|
+
|
297
|
+
# auth_names
|
298
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
299
|
+
|
300
|
+
new_options = opts.merge(
|
301
|
+
:operation => :"MessageApi.v1_message_events",
|
302
|
+
:header_params => header_params,
|
303
|
+
:query_params => query_params,
|
304
|
+
:form_params => form_params,
|
305
|
+
:body => post_body,
|
306
|
+
:auth_names => auth_names,
|
307
|
+
:return_type => return_type
|
308
|
+
)
|
309
|
+
|
310
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
311
|
+
if @api_client.config.debugging
|
312
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
313
|
+
end
|
314
|
+
return data, status_code, headers
|
315
|
+
end
|
316
|
+
|
317
|
+
# Message Events Subscription
|
318
|
+
# Reads the stream of created messages for an application, but using server-managed iterator tracking.
|
319
|
+
# @param app_id [String] The app's ID or UID
|
320
|
+
# @param subscription_id [String] The esub's ID or UID
|
321
|
+
# @param [Hash] opts the optional parameters
|
322
|
+
# @option opts [Integer] :limit Limit the number of returned items
|
323
|
+
# @option opts [String] :iterator The iterator returned from a prior invocation
|
324
|
+
# @option opts [Array<String>] :event_types Filter response based on the event type
|
325
|
+
# @option opts [Array<String>] :channels Filter response based on the event type
|
326
|
+
# @option opts [Time] :after
|
327
|
+
# @return [MessageEventsOut]
|
328
|
+
def v1_message_events_subscription(app_id, subscription_id, opts = {})
|
329
|
+
data, _status_code, _headers = v1_message_events_subscription_with_http_info(app_id, subscription_id, opts)
|
330
|
+
data
|
331
|
+
end
|
332
|
+
|
333
|
+
# Message Events Subscription
|
334
|
+
# Reads the stream of created messages for an application, but using server-managed iterator tracking.
|
335
|
+
# @param app_id [String] The app's ID or UID
|
336
|
+
# @param subscription_id [String] The esub's ID or UID
|
337
|
+
# @param [Hash] opts the optional parameters
|
338
|
+
# @option opts [Integer] :limit Limit the number of returned items
|
339
|
+
# @option opts [String] :iterator The iterator returned from a prior invocation
|
340
|
+
# @option opts [Array<String>] :event_types Filter response based on the event type
|
341
|
+
# @option opts [Array<String>] :channels Filter response based on the event type
|
342
|
+
# @option opts [Time] :after
|
343
|
+
# @return [Array<(MessageEventsOut, Integer, Hash)>] MessageEventsOut data, response status code and response headers
|
344
|
+
def v1_message_events_subscription_with_http_info(app_id, subscription_id, opts = {})
|
345
|
+
if @api_client.config.debugging
|
346
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events_subscription ...'
|
347
|
+
end
|
348
|
+
# verify the required parameter 'app_id' is set
|
349
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
350
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events_subscription"
|
351
|
+
end
|
352
|
+
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
353
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events_subscription, the character length must be smaller than or equal to 256.'
|
354
|
+
end
|
355
|
+
|
356
|
+
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
357
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events_subscription, the character length must be great than or equal to 1.'
|
358
|
+
end
|
359
|
+
|
360
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
361
|
+
if @api_client.config.client_side_validation && app_id !~ pattern
|
362
|
+
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events_subscription, must conform to the pattern #{pattern}."
|
363
|
+
end
|
364
|
+
|
365
|
+
# verify the required parameter 'subscription_id' is set
|
366
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
367
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling MessageApi.v1_message_events_subscription"
|
368
|
+
end
|
369
|
+
if @api_client.config.client_side_validation && subscription_id.to_s.length > 256
|
370
|
+
fail ArgumentError, 'invalid value for "subscription_id" when calling MessageApi.v1_message_events_subscription, the character length must be smaller than or equal to 256.'
|
371
|
+
end
|
372
|
+
|
373
|
+
if @api_client.config.client_side_validation && subscription_id.to_s.length < 1
|
374
|
+
fail ArgumentError, 'invalid value for "subscription_id" when calling MessageApi.v1_message_events_subscription, the character length must be great than or equal to 1.'
|
375
|
+
end
|
376
|
+
|
377
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
378
|
+
if @api_client.config.client_side_validation && subscription_id !~ pattern
|
379
|
+
fail ArgumentError, "invalid value for 'subscription_id' when calling MessageApi.v1_message_events_subscription, must conform to the pattern #{pattern}."
|
380
|
+
end
|
381
|
+
|
382
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
383
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events_subscription, must be smaller than or equal to 250.'
|
384
|
+
end
|
385
|
+
|
386
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
387
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events_subscription, must be greater than or equal to 1.'
|
388
|
+
end
|
389
|
+
|
390
|
+
# resource path
|
391
|
+
local_var_path = '/api/v1/app/{app_id}/events/subscription/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
392
|
+
|
393
|
+
# query parameters
|
394
|
+
query_params = opts[:query_params] || {}
|
395
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
396
|
+
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
397
|
+
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
398
|
+
query_params[:'channels'] = @api_client.build_collection_param(opts[:'channels'], :multi) if !opts[:'channels'].nil?
|
399
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
400
|
+
|
401
|
+
# header parameters
|
402
|
+
header_params = opts[:header_params] || {}
|
403
|
+
# HTTP header 'Accept' (if needed)
|
404
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
405
|
+
|
406
|
+
# form parameters
|
407
|
+
form_params = opts[:form_params] || {}
|
408
|
+
|
409
|
+
# http body (model)
|
410
|
+
post_body = opts[:debug_body]
|
411
|
+
|
412
|
+
# return_type
|
413
|
+
return_type = opts[:debug_return_type] || 'MessageEventsOut'
|
414
|
+
|
415
|
+
# auth_names
|
416
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
417
|
+
|
418
|
+
new_options = opts.merge(
|
419
|
+
:operation => :"MessageApi.v1_message_events_subscription",
|
420
|
+
:header_params => header_params,
|
421
|
+
:query_params => query_params,
|
422
|
+
:form_params => form_params,
|
423
|
+
:body => post_body,
|
424
|
+
:auth_names => auth_names,
|
425
|
+
:return_type => return_type
|
426
|
+
)
|
427
|
+
|
428
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
429
|
+
if @api_client.config.debugging
|
430
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_events_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
431
|
+
end
|
432
|
+
return data, status_code, headers
|
433
|
+
end
|
434
|
+
|
435
|
+
# Message Events Create Token
|
436
|
+
# Creates an auth token that can be used with the `v1.message.events-subscription` endpoint
|
437
|
+
# @param app_id [String] The app's ID or UID
|
438
|
+
# @param subscription_id [String] The esub's ID or UID
|
439
|
+
# @param [Hash] opts the optional parameters
|
440
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
441
|
+
# @return [MessageSubscriberAuthTokenOut]
|
442
|
+
def v1_message_events_subscription_create_token(app_id, subscription_id, opts = {})
|
443
|
+
data, _status_code, _headers = v1_message_events_subscription_create_token_with_http_info(app_id, subscription_id, opts)
|
444
|
+
data
|
445
|
+
end
|
446
|
+
|
447
|
+
# Message Events Create Token
|
448
|
+
# Creates an auth token that can be used with the `v1.message.events-subscription` endpoint
|
449
|
+
# @param app_id [String] The app's ID or UID
|
450
|
+
# @param subscription_id [String] The esub's ID or UID
|
451
|
+
# @param [Hash] opts the optional parameters
|
452
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
453
|
+
# @return [Array<(MessageSubscriberAuthTokenOut, Integer, Hash)>] MessageSubscriberAuthTokenOut data, response status code and response headers
|
454
|
+
def v1_message_events_subscription_create_token_with_http_info(app_id, subscription_id, opts = {})
|
455
|
+
if @api_client.config.debugging
|
456
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events_subscription_create_token ...'
|
457
|
+
end
|
458
|
+
# verify the required parameter 'app_id' is set
|
459
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
460
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events_subscription_create_token"
|
461
|
+
end
|
462
|
+
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
463
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events_subscription_create_token, the character length must be smaller than or equal to 256.'
|
464
|
+
end
|
465
|
+
|
466
|
+
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
467
|
+
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events_subscription_create_token, the character length must be great than or equal to 1.'
|
468
|
+
end
|
469
|
+
|
470
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
471
|
+
if @api_client.config.client_side_validation && app_id !~ pattern
|
472
|
+
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events_subscription_create_token, must conform to the pattern #{pattern}."
|
473
|
+
end
|
474
|
+
|
475
|
+
# verify the required parameter 'subscription_id' is set
|
476
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
477
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling MessageApi.v1_message_events_subscription_create_token"
|
478
|
+
end
|
479
|
+
if @api_client.config.client_side_validation && subscription_id.to_s.length > 256
|
480
|
+
fail ArgumentError, 'invalid value for "subscription_id" when calling MessageApi.v1_message_events_subscription_create_token, the character length must be smaller than or equal to 256.'
|
481
|
+
end
|
482
|
+
|
483
|
+
if @api_client.config.client_side_validation && subscription_id.to_s.length < 1
|
484
|
+
fail ArgumentError, 'invalid value for "subscription_id" when calling MessageApi.v1_message_events_subscription_create_token, the character length must be great than or equal to 1.'
|
485
|
+
end
|
486
|
+
|
487
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
488
|
+
if @api_client.config.client_side_validation && subscription_id !~ pattern
|
489
|
+
fail ArgumentError, "invalid value for 'subscription_id' when calling MessageApi.v1_message_events_subscription_create_token, must conform to the pattern #{pattern}."
|
490
|
+
end
|
491
|
+
|
492
|
+
# resource path
|
493
|
+
local_var_path = '/api/v1/app/{app_id}/events/subscription/{subscription_id}/create-token'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
494
|
+
|
495
|
+
# query parameters
|
496
|
+
query_params = opts[:query_params] || {}
|
497
|
+
|
498
|
+
# header parameters
|
499
|
+
header_params = opts[:header_params] || {}
|
500
|
+
# HTTP header 'Accept' (if needed)
|
501
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
502
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
503
|
+
|
504
|
+
# form parameters
|
505
|
+
form_params = opts[:form_params] || {}
|
506
|
+
|
507
|
+
# http body (model)
|
508
|
+
post_body = opts[:debug_body]
|
509
|
+
|
510
|
+
# return_type
|
511
|
+
return_type = opts[:debug_return_type] || 'MessageSubscriberAuthTokenOut'
|
512
|
+
|
513
|
+
# auth_names
|
514
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
515
|
+
|
516
|
+
new_options = opts.merge(
|
517
|
+
:operation => :"MessageApi.v1_message_events_subscription_create_token",
|
518
|
+
:header_params => header_params,
|
519
|
+
:query_params => query_params,
|
520
|
+
:form_params => form_params,
|
521
|
+
:body => post_body,
|
522
|
+
:auth_names => auth_names,
|
523
|
+
:return_type => return_type
|
524
|
+
)
|
525
|
+
|
526
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
527
|
+
if @api_client.config.debugging
|
528
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_message_events_subscription_create_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
529
|
+
end
|
530
|
+
return data, status_code, headers
|
531
|
+
end
|
532
|
+
|
218
533
|
# Delete message payload
|
219
534
|
# Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. The message can't be replayed or resent once its payload has been deleted or expired.
|
220
535
|
# @param app_id [String] The app's ID or UID
|
@@ -628,104 +943,5 @@ module Svix
|
|
628
943
|
end
|
629
944
|
return data, status_code, headers
|
630
945
|
end
|
631
|
-
|
632
|
-
# Stream Events
|
633
|
-
# Reads the stream of created messages for an application
|
634
|
-
# @param app_id [String] The app's ID or UID
|
635
|
-
# @param [Hash] opts the optional parameters
|
636
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
637
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
638
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
639
|
-
# @option opts [Array<String>] :channels Filter response based on the event type
|
640
|
-
# @option opts [Time] :after
|
641
|
-
# @return [MessageStreamOut]
|
642
|
-
def v1_message_stream(app_id, opts = {})
|
643
|
-
data, _status_code, _headers = v1_message_stream_with_http_info(app_id, opts)
|
644
|
-
data
|
645
|
-
end
|
646
|
-
|
647
|
-
# Stream Events
|
648
|
-
# Reads the stream of created messages for an application
|
649
|
-
# @param app_id [String] The app's ID or UID
|
650
|
-
# @param [Hash] opts the optional parameters
|
651
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
652
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
653
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
654
|
-
# @option opts [Array<String>] :channels Filter response based on the event type
|
655
|
-
# @option opts [Time] :after
|
656
|
-
# @return [Array<(MessageStreamOut, Integer, Hash)>] MessageStreamOut data, response status code and response headers
|
657
|
-
def v1_message_stream_with_http_info(app_id, opts = {})
|
658
|
-
if @api_client.config.debugging
|
659
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_stream ...'
|
660
|
-
end
|
661
|
-
# verify the required parameter 'app_id' is set
|
662
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
663
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_stream"
|
664
|
-
end
|
665
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
666
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_stream, the character length must be smaller than or equal to 256.'
|
667
|
-
end
|
668
|
-
|
669
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
670
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_stream, the character length must be great than or equal to 1.'
|
671
|
-
end
|
672
|
-
|
673
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
674
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
675
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_stream, must conform to the pattern #{pattern}."
|
676
|
-
end
|
677
|
-
|
678
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
679
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_stream, must be smaller than or equal to 250.'
|
680
|
-
end
|
681
|
-
|
682
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
683
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_stream, must be greater than or equal to 1.'
|
684
|
-
end
|
685
|
-
|
686
|
-
# resource path
|
687
|
-
local_var_path = '/api/v1/app/{app_id}/events'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
688
|
-
|
689
|
-
# query parameters
|
690
|
-
query_params = opts[:query_params] || {}
|
691
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
692
|
-
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
693
|
-
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
694
|
-
query_params[:'channels'] = @api_client.build_collection_param(opts[:'channels'], :multi) if !opts[:'channels'].nil?
|
695
|
-
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
696
|
-
|
697
|
-
# header parameters
|
698
|
-
header_params = opts[:header_params] || {}
|
699
|
-
# HTTP header 'Accept' (if needed)
|
700
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
701
|
-
|
702
|
-
# form parameters
|
703
|
-
form_params = opts[:form_params] || {}
|
704
|
-
|
705
|
-
# http body (model)
|
706
|
-
post_body = opts[:debug_body]
|
707
|
-
|
708
|
-
# return_type
|
709
|
-
return_type = opts[:debug_return_type] || 'MessageStreamOut'
|
710
|
-
|
711
|
-
# auth_names
|
712
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
713
|
-
|
714
|
-
new_options = opts.merge(
|
715
|
-
:operation => :"MessageApi.v1_message_stream",
|
716
|
-
:header_params => header_params,
|
717
|
-
:query_params => query_params,
|
718
|
-
:form_params => form_params,
|
719
|
-
:body => post_body,
|
720
|
-
:auth_names => auth_names,
|
721
|
-
:return_type => return_type
|
722
|
-
)
|
723
|
-
|
724
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
725
|
-
if @api_client.config.debugging
|
726
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
727
|
-
end
|
728
|
-
return data, status_code, headers
|
729
|
-
end
|
730
946
|
end
|
731
947
|
end
|