svix 1.24.0 → 1.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/svix/api/endpoint_api.rb +277 -2
  4. data/lib/svix/api/message_api.rb +218 -2
  5. data/lib/svix/api/streams_api.rb +185 -0
  6. data/lib/svix/api/transformation_template_api.rb +195 -24
  7. data/lib/svix/models/auth_token_out.rb +272 -0
  8. data/lib/svix/models/create_message_token_in.rb +250 -0
  9. data/lib/svix/models/create_stream_in.rb +225 -0
  10. data/lib/svix/models/endpoint_created_event_data.rb +1 -0
  11. data/lib/svix/models/endpoint_deleted_event_data.rb +1 -0
  12. data/lib/svix/models/endpoint_mtls_config_in.rb +15 -19
  13. data/lib/svix/models/endpoint_oauth_config_in.rb +13 -2
  14. data/lib/svix/models/endpoint_updated_event_data.rb +1 -0
  15. data/lib/svix/models/environment_settings_out.rb +15 -4
  16. data/lib/svix/models/event_in.rb +223 -0
  17. data/lib/svix/models/event_out.rb +223 -0
  18. data/lib/svix/models/event_type_from_open_api.rb +280 -0
  19. data/lib/svix/models/event_type_import_open_api_in.rb +13 -1
  20. data/lib/svix/models/event_type_import_open_api_out_data.rb +16 -4
  21. data/lib/svix/models/hubspot_oauth_config_in.rb +223 -0
  22. data/lib/svix/models/{oauth_payload_out.rb → incoming_webhook_payload_out.rb} +3 -3
  23. data/lib/svix/models/kafka_security_protocol_type.rb +38 -0
  24. data/lib/svix/models/list_response_event_out.rb +259 -0
  25. data/lib/svix/models/list_response_sink_out.rb +259 -0
  26. data/lib/svix/models/message_subscriber_auth_token_out.rb +237 -0
  27. data/lib/svix/models/{oauth_payload_in.rb → o_auth_payload_in.rb} +3 -3
  28. data/lib/svix/models/o_auth_payload_out.rb +239 -0
  29. data/lib/svix/models/{oauth2_grant_type.rb → oauth2_grant_type_in.rb} +4 -3
  30. data/lib/svix/models/settings_in.rb +15 -4
  31. data/lib/svix/models/settings_out.rb +15 -4
  32. data/lib/svix/models/sink_in.rb +107 -0
  33. data/lib/svix/models/sink_in_one_of.rb +285 -0
  34. data/lib/svix/models/sink_in_one_of1.rb +313 -0
  35. data/lib/svix/models/sink_in_one_of2.rb +321 -0
  36. data/lib/svix/models/sink_in_one_of3.rb +271 -0
  37. data/lib/svix/models/sink_out.rb +107 -0
  38. data/lib/svix/version.rb +1 -1
  39. metadata +24 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ccf861a161a61299e676c576187fdf2ecf7a748eba371ced72182b66ab1e5e3
4
- data.tar.gz: 4164060536e9f5f349e9111aed010bb0d2ffec043a036e32239285fea3b3f5bc
3
+ metadata.gz: 9af0966ec6826c9bc23ba8cacfb3463f3b2c62c3842deb31ccd58500bb74a979
4
+ data.tar.gz: d304f7591f15f88cd16264b087442d333bd1f4d373248a6d73efaa933cb0130b
5
5
  SHA512:
6
- metadata.gz: ecc7d97006a0d3f9446377fc096c43fdca661a1c00a96685d8f62a5afbd67e9a18d2e544b0fcca0c1c669997042527942a01a911a3727813d60c8ee72a2c2350
7
- data.tar.gz: 603bcebef98e16a838afed4849d0673f8cffee4c7239a51a90032b6e3b0959223c7140be60679cd165bdc51b4201266f4e01d1781e17ddc9f6cea74e8829daa6
6
+ metadata.gz: 43f98aadaeba601b4528811e5a8953655eff727f7c0883c1172a19f9d305214fa3931e16b5f03f974e5c3e004c6ae37586918342ed910d90fadfd28da72a8e19
7
+ data.tar.gz: a3636186efdc429a63a86b08a15a60749c9508aec61cc7feb5fcd16c8d22d34e17fefe834d8dd6318070d3806220baa7f10e08c479417c5257d2ec5e408f2cf5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (1.24.0)
4
+ svix (1.25.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -10,7 +10,7 @@ GEM
10
10
  diff-lcs (1.4.4)
11
11
  ethon (0.16.0)
12
12
  ffi (>= 1.15.0)
13
- ffi (1.16.3)
13
+ ffi (1.17.0)
14
14
  rake (13.0.6)
15
15
  rspec (3.10.0)
16
16
  rspec-core (~> 3.10.0)
@@ -1395,7 +1395,7 @@ module Svix
1395
1395
  end
1396
1396
 
1397
1397
  # Send Event Type Example Message
1398
- # Send an example message for event
1398
+ # Send an example message for an event
1399
1399
  # @param app_id [String] The app's ID or UID
1400
1400
  # @param endpoint_id [String] The ep's ID or UID
1401
1401
  # @param event_example_in [EventExampleIn]
@@ -1408,7 +1408,7 @@ module Svix
1408
1408
  end
1409
1409
 
1410
1410
  # Send Event Type Example Message
1411
- # Send an example message for event
1411
+ # Send an example message for an event
1412
1412
  # @param app_id [String] The app's ID or UID
1413
1413
  # @param endpoint_id [String] The ep's ID or UID
1414
1414
  # @param event_example_in [EventExampleIn]
@@ -2215,5 +2215,280 @@ module Svix
2215
2215
  end
2216
2216
  return data, status_code, headers
2217
2217
  end
2218
+
2219
+ # Create Sink
2220
+ # Create a new sink for the application.
2221
+ # @param app_id [String] The app's ID or UID
2222
+ # @param sink_in [SinkIn]
2223
+ # @param [Hash] opts the optional parameters
2224
+ # @option opts [String] :idempotency_key The request's idempotency key
2225
+ # @return [SinkOut]
2226
+ def v1_sink_create(app_id, sink_in, opts = {})
2227
+ data, _status_code, _headers = v1_sink_create_with_http_info(app_id, sink_in, opts)
2228
+ data
2229
+ end
2230
+
2231
+ # Create Sink
2232
+ # Create a new sink for the application.
2233
+ # @param app_id [String] The app's ID or UID
2234
+ # @param sink_in [SinkIn]
2235
+ # @param [Hash] opts the optional parameters
2236
+ # @option opts [String] :idempotency_key The request's idempotency key
2237
+ # @return [Array<(SinkOut, Integer, Hash)>] SinkOut data, response status code and response headers
2238
+ def v1_sink_create_with_http_info(app_id, sink_in, opts = {})
2239
+ if @api_client.config.debugging
2240
+ @api_client.config.logger.debug 'Calling API: EndpointApi.v1_sink_create ...'
2241
+ end
2242
+ # verify the required parameter 'app_id' is set
2243
+ if @api_client.config.client_side_validation && app_id.nil?
2244
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.v1_sink_create"
2245
+ end
2246
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
2247
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_create, the character length must be smaller than or equal to 256.'
2248
+ end
2249
+
2250
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
2251
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_create, the character length must be great than or equal to 1.'
2252
+ end
2253
+
2254
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
2255
+ if @api_client.config.client_side_validation && app_id !~ pattern
2256
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.v1_sink_create, must conform to the pattern #{pattern}."
2257
+ end
2258
+
2259
+ # verify the required parameter 'sink_in' is set
2260
+ if @api_client.config.client_side_validation && sink_in.nil?
2261
+ fail ArgumentError, "Missing the required parameter 'sink_in' when calling EndpointApi.v1_sink_create"
2262
+ end
2263
+ # resource path
2264
+ local_var_path = '/api/v1/app/{app_id}/sink'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
2265
+
2266
+ # query parameters
2267
+ query_params = opts[:query_params] || {}
2268
+
2269
+ # header parameters
2270
+ header_params = opts[:header_params] || {}
2271
+ # HTTP header 'Accept' (if needed)
2272
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2273
+ # HTTP header 'Content-Type'
2274
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2275
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2276
+
2277
+ # form parameters
2278
+ form_params = opts[:form_params] || {}
2279
+
2280
+ # http body (model)
2281
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sink_in)
2282
+
2283
+ # return_type
2284
+ return_type = opts[:debug_return_type] || 'SinkOut'
2285
+
2286
+ # auth_names
2287
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
2288
+
2289
+ new_options = opts.merge(
2290
+ :operation => :"EndpointApi.v1_sink_create",
2291
+ :header_params => header_params,
2292
+ :query_params => query_params,
2293
+ :form_params => form_params,
2294
+ :body => post_body,
2295
+ :auth_names => auth_names,
2296
+ :return_type => return_type
2297
+ )
2298
+
2299
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2300
+ if @api_client.config.debugging
2301
+ @api_client.config.logger.debug "API called: EndpointApi#v1_sink_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2302
+ end
2303
+ return data, status_code, headers
2304
+ end
2305
+
2306
+ # Get Sink
2307
+ # Get a sink.
2308
+ # @param app_id [String] The app&#39;s ID or UID
2309
+ # @param sink_id [String] The ep&#39;s ID or UID
2310
+ # @param [Hash] opts the optional parameters
2311
+ # @return [SinkOut]
2312
+ def v1_sink_get(app_id, sink_id, opts = {})
2313
+ data, _status_code, _headers = v1_sink_get_with_http_info(app_id, sink_id, opts)
2314
+ data
2315
+ end
2316
+
2317
+ # Get Sink
2318
+ # Get a sink.
2319
+ # @param app_id [String] The app&#39;s ID or UID
2320
+ # @param sink_id [String] The ep&#39;s ID or UID
2321
+ # @param [Hash] opts the optional parameters
2322
+ # @return [Array<(SinkOut, Integer, Hash)>] SinkOut data, response status code and response headers
2323
+ def v1_sink_get_with_http_info(app_id, sink_id, opts = {})
2324
+ if @api_client.config.debugging
2325
+ @api_client.config.logger.debug 'Calling API: EndpointApi.v1_sink_get ...'
2326
+ end
2327
+ # verify the required parameter 'app_id' is set
2328
+ if @api_client.config.client_side_validation && app_id.nil?
2329
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.v1_sink_get"
2330
+ end
2331
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
2332
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_get, the character length must be smaller than or equal to 256.'
2333
+ end
2334
+
2335
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
2336
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_get, the character length must be great than or equal to 1.'
2337
+ end
2338
+
2339
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
2340
+ if @api_client.config.client_side_validation && app_id !~ pattern
2341
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.v1_sink_get, must conform to the pattern #{pattern}."
2342
+ end
2343
+
2344
+ # verify the required parameter 'sink_id' is set
2345
+ if @api_client.config.client_side_validation && sink_id.nil?
2346
+ fail ArgumentError, "Missing the required parameter 'sink_id' when calling EndpointApi.v1_sink_get"
2347
+ end
2348
+ if @api_client.config.client_side_validation && sink_id.to_s.length > 256
2349
+ fail ArgumentError, 'invalid value for "sink_id" when calling EndpointApi.v1_sink_get, the character length must be smaller than or equal to 256.'
2350
+ end
2351
+
2352
+ if @api_client.config.client_side_validation && sink_id.to_s.length < 1
2353
+ fail ArgumentError, 'invalid value for "sink_id" when calling EndpointApi.v1_sink_get, the character length must be great than or equal to 1.'
2354
+ end
2355
+
2356
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
2357
+ if @api_client.config.client_side_validation && sink_id !~ pattern
2358
+ fail ArgumentError, "invalid value for 'sink_id' when calling EndpointApi.v1_sink_get, must conform to the pattern #{pattern}."
2359
+ end
2360
+
2361
+ # resource path
2362
+ local_var_path = '/api/v1/app/{app_id}/sink/{sink_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'sink_id' + '}', CGI.escape(sink_id.to_s))
2363
+
2364
+ # query parameters
2365
+ query_params = opts[:query_params] || {}
2366
+
2367
+ # header parameters
2368
+ header_params = opts[:header_params] || {}
2369
+ # HTTP header 'Accept' (if needed)
2370
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2371
+
2372
+ # form parameters
2373
+ form_params = opts[:form_params] || {}
2374
+
2375
+ # http body (model)
2376
+ post_body = opts[:debug_body]
2377
+
2378
+ # return_type
2379
+ return_type = opts[:debug_return_type] || 'SinkOut'
2380
+
2381
+ # auth_names
2382
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
2383
+
2384
+ new_options = opts.merge(
2385
+ :operation => :"EndpointApi.v1_sink_get",
2386
+ :header_params => header_params,
2387
+ :query_params => query_params,
2388
+ :form_params => form_params,
2389
+ :body => post_body,
2390
+ :auth_names => auth_names,
2391
+ :return_type => return_type
2392
+ )
2393
+
2394
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2395
+ if @api_client.config.debugging
2396
+ @api_client.config.logger.debug "API called: EndpointApi#v1_sink_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2397
+ end
2398
+ return data, status_code, headers
2399
+ end
2400
+
2401
+ # List Sinks
2402
+ # List the application's sinks.
2403
+ # @param app_id [String] The app&#39;s ID or UID
2404
+ # @param [Hash] opts the optional parameters
2405
+ # @option opts [Integer] :limit Limit the number of returned items
2406
+ # @option opts [String] :iterator The iterator returned from a prior invocation
2407
+ # @option opts [Ordering] :order The sorting order of the returned items
2408
+ # @return [ListResponseSinkOut]
2409
+ def v1_sink_list(app_id, opts = {})
2410
+ data, _status_code, _headers = v1_sink_list_with_http_info(app_id, opts)
2411
+ data
2412
+ end
2413
+
2414
+ # List Sinks
2415
+ # List the application&#39;s sinks.
2416
+ # @param app_id [String] The app&#39;s ID or UID
2417
+ # @param [Hash] opts the optional parameters
2418
+ # @option opts [Integer] :limit Limit the number of returned items
2419
+ # @option opts [String] :iterator The iterator returned from a prior invocation
2420
+ # @option opts [Ordering] :order The sorting order of the returned items
2421
+ # @return [Array<(ListResponseSinkOut, Integer, Hash)>] ListResponseSinkOut data, response status code and response headers
2422
+ def v1_sink_list_with_http_info(app_id, opts = {})
2423
+ if @api_client.config.debugging
2424
+ @api_client.config.logger.debug 'Calling API: EndpointApi.v1_sink_list ...'
2425
+ end
2426
+ # verify the required parameter 'app_id' is set
2427
+ if @api_client.config.client_side_validation && app_id.nil?
2428
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.v1_sink_list"
2429
+ end
2430
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
2431
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_list, the character length must be smaller than or equal to 256.'
2432
+ end
2433
+
2434
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
2435
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.v1_sink_list, the character length must be great than or equal to 1.'
2436
+ end
2437
+
2438
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
2439
+ if @api_client.config.client_side_validation && app_id !~ pattern
2440
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.v1_sink_list, must conform to the pattern #{pattern}."
2441
+ end
2442
+
2443
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
2444
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EndpointApi.v1_sink_list, must be smaller than or equal to 250.'
2445
+ end
2446
+
2447
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
2448
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EndpointApi.v1_sink_list, must be greater than or equal to 1.'
2449
+ end
2450
+
2451
+ # resource path
2452
+ local_var_path = '/api/v1/app/{app_id}/sink'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
2453
+
2454
+ # query parameters
2455
+ query_params = opts[:query_params] || {}
2456
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
2457
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
2458
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
2459
+
2460
+ # header parameters
2461
+ header_params = opts[:header_params] || {}
2462
+ # HTTP header 'Accept' (if needed)
2463
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2464
+
2465
+ # form parameters
2466
+ form_params = opts[:form_params] || {}
2467
+
2468
+ # http body (model)
2469
+ post_body = opts[:debug_body]
2470
+
2471
+ # return_type
2472
+ return_type = opts[:debug_return_type] || 'ListResponseSinkOut'
2473
+
2474
+ # auth_names
2475
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
2476
+
2477
+ new_options = opts.merge(
2478
+ :operation => :"EndpointApi.v1_sink_list",
2479
+ :header_params => header_params,
2480
+ :query_params => query_params,
2481
+ :form_params => form_params,
2482
+ :body => post_body,
2483
+ :auth_names => auth_names,
2484
+ :return_type => return_type
2485
+ )
2486
+
2487
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2488
+ if @api_client.config.debugging
2489
+ @api_client.config.logger.debug "API called: EndpointApi#v1_sink_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2490
+ end
2491
+ return data, status_code, headers
2492
+ end
2218
2493
  end
2219
2494
  end
@@ -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 any application in your environment, 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.
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&#39;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&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. It&#39;s verified to be unique only up to a day, after that no verification will be made. If a message with the same &#x60;eventId&#x60; already exists for any application in your environment, a 409 conflict error will be returned. The &#x60;eventType&#x60; indicates the type and schema of the event. All messages of a certain &#x60;eventType&#x60; are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have &#x60;channels&#x60;, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don&#39;t imply a specific message content or schema. The &#x60;payload&#x60; property is the webhook&#39;s body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it&#39;s generally a good idea to keep webhook payloads small, probably no larger than 40kb.
142
+ # Creates a new message and dispatches it to all of the application&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. It&#39;s verified to be unique only up to a day, after that no verification will be made. If a message with the same &#x60;eventId&#x60; already exists for the application, a 409 conflict error will be returned. The &#x60;eventType&#x60; indicates the type and schema of the event. All messages of a certain &#x60;eventType&#x60; are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have &#x60;channels&#x60;, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don&#39;t imply a specific message content or schema. The &#x60;payload&#x60; property is the webhook&#39;s body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it&#39;s generally a good idea to keep webhook payloads small, probably no larger than 40kb.
143
143
  # @param app_id [String] The app&#39;s ID or UID
144
144
  # @param message_in [MessageIn]
145
145
  # @param [Hash] opts the optional parameters
@@ -215,6 +215,222 @@ module Svix
215
215
  return data, status_code, headers
216
216
  end
217
217
 
218
+ # Stream Events Subscription
219
+ # Reads the stream of created messages for an application, but using server-managed iterator tracking.
220
+ # @param app_id [String] The app&#39;s ID or UID
221
+ # @param subscription_id [String] The esub&#39;s ID or UID
222
+ # @param [Hash] opts the optional parameters
223
+ # @option opts [Integer] :limit Limit the number of returned items
224
+ # @option opts [String] :iterator The iterator returned from a prior invocation
225
+ # @option opts [Array<String>] :event_types Filter response based on the event type
226
+ # @option opts [Array<String>] :channels Filter response based on the event type
227
+ # @option opts [Time] :after
228
+ # @return [MessageStreamOut]
229
+ def v1_message_events_subscription(app_id, subscription_id, opts = {})
230
+ data, _status_code, _headers = v1_message_events_subscription_with_http_info(app_id, subscription_id, opts)
231
+ data
232
+ end
233
+
234
+ # Stream Events Subscription
235
+ # Reads the stream of created messages for an application, but using server-managed iterator tracking.
236
+ # @param app_id [String] The app&#39;s ID or UID
237
+ # @param subscription_id [String] The esub&#39;s ID or UID
238
+ # @param [Hash] opts the optional parameters
239
+ # @option opts [Integer] :limit Limit the number of returned items
240
+ # @option opts [String] :iterator The iterator returned from a prior invocation
241
+ # @option opts [Array<String>] :event_types Filter response based on the event type
242
+ # @option opts [Array<String>] :channels Filter response based on the event type
243
+ # @option opts [Time] :after
244
+ # @return [Array<(MessageStreamOut, Integer, Hash)>] MessageStreamOut data, response status code and response headers
245
+ def v1_message_events_subscription_with_http_info(app_id, subscription_id, opts = {})
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events_subscription ...'
248
+ end
249
+ # verify the required parameter 'app_id' is set
250
+ if @api_client.config.client_side_validation && app_id.nil?
251
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events_subscription"
252
+ end
253
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
254
+ 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.'
255
+ end
256
+
257
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
258
+ 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.'
259
+ end
260
+
261
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
262
+ if @api_client.config.client_side_validation && app_id !~ pattern
263
+ fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events_subscription, must conform to the pattern #{pattern}."
264
+ end
265
+
266
+ # verify the required parameter 'subscription_id' is set
267
+ if @api_client.config.client_side_validation && subscription_id.nil?
268
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling MessageApi.v1_message_events_subscription"
269
+ end
270
+ if @api_client.config.client_side_validation && subscription_id.to_s.length > 256
271
+ 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.'
272
+ end
273
+
274
+ if @api_client.config.client_side_validation && subscription_id.to_s.length < 1
275
+ 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.'
276
+ end
277
+
278
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
279
+ if @api_client.config.client_side_validation && subscription_id !~ pattern
280
+ fail ArgumentError, "invalid value for 'subscription_id' when calling MessageApi.v1_message_events_subscription, must conform to the pattern #{pattern}."
281
+ end
282
+
283
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
284
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events_subscription, must be smaller than or equal to 250.'
285
+ end
286
+
287
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
288
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events_subscription, must be greater than or equal to 1.'
289
+ end
290
+
291
+ # resource path
292
+ 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))
293
+
294
+ # query parameters
295
+ query_params = opts[:query_params] || {}
296
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
297
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
298
+ query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
299
+ query_params[:'channels'] = @api_client.build_collection_param(opts[:'channels'], :multi) if !opts[:'channels'].nil?
300
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
301
+
302
+ # header parameters
303
+ header_params = opts[:header_params] || {}
304
+ # HTTP header 'Accept' (if needed)
305
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
306
+
307
+ # form parameters
308
+ form_params = opts[:form_params] || {}
309
+
310
+ # http body (model)
311
+ post_body = opts[:debug_body]
312
+
313
+ # return_type
314
+ return_type = opts[:debug_return_type] || 'MessageStreamOut'
315
+
316
+ # auth_names
317
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
318
+
319
+ new_options = opts.merge(
320
+ :operation => :"MessageApi.v1_message_events_subscription",
321
+ :header_params => header_params,
322
+ :query_params => query_params,
323
+ :form_params => form_params,
324
+ :body => post_body,
325
+ :auth_names => auth_names,
326
+ :return_type => return_type
327
+ )
328
+
329
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
330
+ if @api_client.config.debugging
331
+ @api_client.config.logger.debug "API called: MessageApi#v1_message_events_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
332
+ end
333
+ return data, status_code, headers
334
+ end
335
+
336
+ # Stream Events Create Token
337
+ # Creates an auth token that can be used with the `v1.message.events-subscription` endpoint
338
+ # @param app_id [String] The app&#39;s ID or UID
339
+ # @param subscription_id [String] The esub&#39;s ID or UID
340
+ # @param [Hash] opts the optional parameters
341
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
342
+ # @return [MessageSubscriberAuthTokenOut]
343
+ def v1_message_events_subscription_create_token(app_id, subscription_id, opts = {})
344
+ data, _status_code, _headers = v1_message_events_subscription_create_token_with_http_info(app_id, subscription_id, opts)
345
+ data
346
+ end
347
+
348
+ # Stream Events Create Token
349
+ # Creates an auth token that can be used with the &#x60;v1.message.events-subscription&#x60; endpoint
350
+ # @param app_id [String] The app&#39;s ID or UID
351
+ # @param subscription_id [String] The esub&#39;s ID or UID
352
+ # @param [Hash] opts the optional parameters
353
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
354
+ # @return [Array<(MessageSubscriberAuthTokenOut, Integer, Hash)>] MessageSubscriberAuthTokenOut data, response status code and response headers
355
+ def v1_message_events_subscription_create_token_with_http_info(app_id, subscription_id, opts = {})
356
+ if @api_client.config.debugging
357
+ @api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events_subscription_create_token ...'
358
+ end
359
+ # verify the required parameter 'app_id' is set
360
+ if @api_client.config.client_side_validation && app_id.nil?
361
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events_subscription_create_token"
362
+ end
363
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
364
+ 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.'
365
+ end
366
+
367
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
368
+ 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.'
369
+ end
370
+
371
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
372
+ if @api_client.config.client_side_validation && app_id !~ pattern
373
+ fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events_subscription_create_token, must conform to the pattern #{pattern}."
374
+ end
375
+
376
+ # verify the required parameter 'subscription_id' is set
377
+ if @api_client.config.client_side_validation && subscription_id.nil?
378
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling MessageApi.v1_message_events_subscription_create_token"
379
+ end
380
+ if @api_client.config.client_side_validation && subscription_id.to_s.length > 256
381
+ 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.'
382
+ end
383
+
384
+ if @api_client.config.client_side_validation && subscription_id.to_s.length < 1
385
+ 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.'
386
+ end
387
+
388
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
389
+ if @api_client.config.client_side_validation && subscription_id !~ pattern
390
+ fail ArgumentError, "invalid value for 'subscription_id' when calling MessageApi.v1_message_events_subscription_create_token, must conform to the pattern #{pattern}."
391
+ end
392
+
393
+ # resource path
394
+ 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))
395
+
396
+ # query parameters
397
+ query_params = opts[:query_params] || {}
398
+
399
+ # header parameters
400
+ header_params = opts[:header_params] || {}
401
+ # HTTP header 'Accept' (if needed)
402
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
403
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
404
+
405
+ # form parameters
406
+ form_params = opts[:form_params] || {}
407
+
408
+ # http body (model)
409
+ post_body = opts[:debug_body]
410
+
411
+ # return_type
412
+ return_type = opts[:debug_return_type] || 'MessageSubscriberAuthTokenOut'
413
+
414
+ # auth_names
415
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
416
+
417
+ new_options = opts.merge(
418
+ :operation => :"MessageApi.v1_message_events_subscription_create_token",
419
+ :header_params => header_params,
420
+ :query_params => query_params,
421
+ :form_params => form_params,
422
+ :body => post_body,
423
+ :auth_names => auth_names,
424
+ :return_type => return_type
425
+ )
426
+
427
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
428
+ if @api_client.config.debugging
429
+ @api_client.config.logger.debug "API called: MessageApi#v1_message_events_subscription_create_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
430
+ end
431
+ return data, status_code, headers
432
+ end
433
+
218
434
  # Delete message payload
219
435
  # 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
436
  # @param app_id [String] The app&#39;s ID or UID