svix 1.60.1 → 1.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +5 -1
- data/Gemfile.lock +35 -21
- data/README.md +0 -7
- data/lib/svix/api/application.rb +96 -0
- data/lib/svix/api/authentication.rb +65 -0
- data/lib/svix/api/background_task.rb +39 -0
- data/lib/svix/api/endpoint.rb +202 -0
- data/lib/svix/api/environment.rb +39 -0
- data/lib/svix/api/event_type.rb +99 -0
- data/lib/svix/api/health.rb +21 -0
- data/lib/svix/api/integration.rb +91 -0
- data/lib/svix/api/message.rb +112 -0
- data/lib/svix/api/message_attempt.rb +123 -0
- data/lib/svix/api/operational_webhook_endpoint.rb +109 -0
- data/lib/svix/api/statistics.rb +36 -0
- data/lib/svix/api_error.rb +7 -17
- data/lib/svix/errors.rb +9 -9
- data/lib/svix/http_error_out.rb +18 -0
- data/lib/svix/http_validation_error.rb +18 -0
- data/lib/svix/internal.rb +0 -9
- data/lib/svix/models/aggregate_event_types_out.rb +32 -292
- data/lib/svix/models/app_portal_access_in.rb +31 -278
- data/lib/svix/models/app_portal_access_out.rb +27 -243
- data/lib/svix/models/app_usage_stats_in.rb +30 -234
- data/lib/svix/models/app_usage_stats_out.rb +31 -320
- data/lib/svix/models/application_in.rb +31 -298
- data/lib/svix/models/application_out.rb +37 -371
- data/lib/svix/models/application_patch.rb +31 -272
- data/lib/svix/models/application_token_expire_in.rb +28 -219
- data/lib/svix/models/background_task_out.rb +31 -307
- data/lib/svix/models/background_task_status.rb +14 -25
- data/lib/svix/models/background_task_type.rb +23 -26
- data/lib/svix/models/connector_in.rb +58 -385
- data/lib/svix/models/connector_kind.rb +28 -26
- data/lib/svix/models/dashboard_access_out.rb +27 -243
- data/lib/svix/models/endpoint_headers_in.rb +25 -202
- data/lib/svix/models/endpoint_headers_out.rb +30 -230
- data/lib/svix/models/endpoint_headers_patch_in.rb +28 -202
- data/lib/svix/models/endpoint_in.rb +61 -449
- data/lib/svix/models/endpoint_message_out.rb +48 -467
- data/lib/svix/models/endpoint_out.rb +67 -528
- data/lib/svix/models/endpoint_patch.rb +61 -383
- data/lib/svix/models/endpoint_secret_out.rb +25 -222
- data/lib/svix/models/endpoint_secret_rotate_in.rb +28 -212
- data/lib/svix/models/endpoint_stats.rb +31 -245
- data/lib/svix/models/endpoint_transformation_in.rb +30 -226
- data/lib/svix/models/endpoint_transformation_out.rb +30 -228
- data/lib/svix/models/endpoint_update.rb +58 -422
- data/lib/svix/models/environment_in.rb +31 -212
- data/lib/svix/models/environment_out.rb +35 -255
- data/lib/svix/models/event_example_in.rb +27 -261
- data/lib/svix/models/event_type_from_open_api.rb +35 -341
- data/lib/svix/models/event_type_import_open_api_in.rb +37 -228
- data/lib/svix/models/event_type_import_open_api_out.rb +28 -200
- data/lib/svix/models/event_type_import_open_api_out_data.rb +31 -211
- data/lib/svix/models/event_type_in.rb +37 -347
- data/lib/svix/models/event_type_out.rb +58 -389
- data/lib/svix/models/event_type_patch.rb +35 -289
- data/lib/svix/models/event_type_update.rb +35 -301
- data/lib/svix/models/expung_all_contents_out.rb +29 -292
- data/lib/svix/models/integration_in.rb +27 -239
- data/lib/svix/models/integration_key_out.rb +25 -200
- data/lib/svix/models/integration_out.rb +33 -324
- data/lib/svix/models/integration_update.rb +27 -239
- data/lib/svix/models/list_response_application_out.rb +34 -237
- data/lib/svix/models/list_response_background_task_out.rb +34 -237
- data/lib/svix/models/list_response_endpoint_message_out.rb +34 -237
- data/lib/svix/models/list_response_endpoint_out.rb +34 -237
- data/lib/svix/models/list_response_event_type_out.rb +34 -237
- data/lib/svix/models/list_response_integration_out.rb +34 -237
- data/lib/svix/models/list_response_message_attempt_out.rb +34 -237
- data/lib/svix/models/list_response_message_endpoint_out.rb +34 -237
- data/lib/svix/models/list_response_message_out.rb +34 -237
- data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +34 -237
- data/lib/svix/models/message_attempt_out.rb +64 -521
- data/lib/svix/models/message_attempt_trigger_type.rb +20 -28
- data/lib/svix/models/message_endpoint_out.rb +70 -557
- data/lib/svix/models/message_in.rb +58 -450
- data/lib/svix/models/message_out.rb +37 -414
- data/lib/svix/models/message_status.rb +24 -30
- data/lib/svix/models/operational_webhook_endpoint_headers_in.rb +28 -202
- data/lib/svix/models/operational_webhook_endpoint_headers_out.rb +30 -229
- data/lib/svix/models/operational_webhook_endpoint_in.rb +42 -380
- data/lib/svix/models/operational_webhook_endpoint_out.rb +64 -458
- data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +28 -212
- data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +28 -222
- data/lib/svix/models/operational_webhook_endpoint_update.rb +40 -353
- data/lib/svix/models/ordering.rb +15 -25
- data/lib/svix/models/recover_in.rb +28 -210
- data/lib/svix/models/recover_out.rb +29 -292
- data/lib/svix/models/replay_in.rb +28 -210
- data/lib/svix/models/replay_out.rb +29 -292
- data/lib/svix/models/status_code_class.rb +28 -32
- data/lib/svix/models/template_out.rb +70 -514
- data/lib/svix/svix.rb +50 -50
- data/lib/svix/svix_http_client.rb +110 -0
- data/lib/svix/util.rb +44 -25
- data/lib/svix/validation_error.rb +28 -0
- data/lib/svix/version.rb +1 -1
- data/lib/svix/webhook.rb +69 -65
- data/lib/svix.rb +51 -37
- data/svix.gemspec +1 -10
- metadata +22 -194
- data/lib/svix/api/application_api.rb +0 -772
- data/lib/svix/api/authentication_api.rb +0 -791
- data/lib/svix/api/background_tasks_api.rb +0 -191
- data/lib/svix/api/broadcast_api.rb +0 -93
- data/lib/svix/api/endpoint_api.rb +0 -2752
- data/lib/svix/api/environment_api.rb +0 -153
- data/lib/svix/api/environment_settings_api.rb +0 -79
- data/lib/svix/api/event_type_api.rb +0 -852
- data/lib/svix/api/events_api.rb +0 -102
- data/lib/svix/api/health_api.rb +0 -79
- data/lib/svix/api/inbound_api.rb +0 -209
- data/lib/svix/api/integration_api.rb +0 -707
- data/lib/svix/api/message_api.rb +0 -1192
- data/lib/svix/api/message_attempt_api.rb +0 -1245
- data/lib/svix/api/statistics_api.rb +0 -333
- data/lib/svix/api/stream_api.rb +0 -659
- data/lib/svix/api/stream_event_types_api.rb +0 -486
- data/lib/svix/api/transformation_template_api.rb +0 -967
- data/lib/svix/api/webhook_endpoint_api.rb +0 -748
- data/lib/svix/api_client.rb +0 -423
- data/lib/svix/application_api.rb +0 -35
- data/lib/svix/authentication_api.rb +0 -21
- data/lib/svix/background_tasks_api.rb +0 -17
- data/lib/svix/configuration.rb +0 -312
- data/lib/svix/endpoint_api.rb +0 -80
- data/lib/svix/event_type_api.rb +0 -37
- data/lib/svix/integration_api.rb +0 -38
- data/lib/svix/message_api.rb +0 -54
- data/lib/svix/message_attempt_api.rb +0 -51
- data/lib/svix/models/active_application_out.rb +0 -373
- data/lib/svix/models/active_endpoint_out.rb +0 -355
- data/lib/svix/models/aggregated_event_types.rb +0 -305
- data/lib/svix/models/application_message_failure.rb +0 -277
- data/lib/svix/models/application_message_id_pair.rb +0 -317
- data/lib/svix/models/application_stats.rb +0 -323
- data/lib/svix/models/application_stats_out.rb +0 -324
- data/lib/svix/models/attempt_statistics_data.rb +0 -229
- data/lib/svix/models/attempt_statistics_response.rb +0 -291
- data/lib/svix/models/auth_token_out.rb +0 -325
- data/lib/svix/models/azure_blob_storage_config.rb +0 -253
- data/lib/svix/models/background_task_finished_event.rb +0 -272
- data/lib/svix/models/background_task_finished_event2.rb +0 -331
- data/lib/svix/models/big_query_config.rb +0 -271
- data/lib/svix/models/border_radius_config.rb +0 -254
- data/lib/svix/models/border_radius_enum.rb +0 -43
- data/lib/svix/models/client_secret_jwt_params_in.rb +0 -297
- data/lib/svix/models/completion_choice.rb +0 -253
- data/lib/svix/models/completion_message.rb +0 -237
- data/lib/svix/models/count_out.rb +0 -258
- data/lib/svix/models/create_stream_in.rb +0 -232
- data/lib/svix/models/create_token_in.rb +0 -248
- data/lib/svix/models/custom_color_palette.rb +0 -295
- data/lib/svix/models/custom_strings_override.rb +0 -235
- data/lib/svix/models/custom_theme_override.rb +0 -223
- data/lib/svix/models/data.rb +0 -108
- data/lib/svix/models/data_any_of.rb +0 -240
- data/lib/svix/models/data_any_of1.rb +0 -223
- data/lib/svix/models/data_any_of2.rb +0 -241
- data/lib/svix/models/data_any_of3.rb +0 -223
- data/lib/svix/models/data_any_of4.rb +0 -240
- data/lib/svix/models/duration.rb +0 -275
- data/lib/svix/models/endpoint_created_event.rb +0 -272
- data/lib/svix/models/endpoint_created_event_data.rb +0 -410
- data/lib/svix/models/endpoint_deleted_event.rb +0 -272
- data/lib/svix/models/endpoint_deleted_event_data.rb +0 -410
- data/lib/svix/models/endpoint_disabled_event.rb +0 -272
- data/lib/svix/models/endpoint_disabled_event_data.rb +0 -451
- data/lib/svix/models/endpoint_disabled_trigger.rb +0 -40
- data/lib/svix/models/endpoint_enabled_event.rb +0 -272
- data/lib/svix/models/endpoint_enabled_event_data.rb +0 -410
- data/lib/svix/models/endpoint_mtls_config_in.rb +0 -233
- data/lib/svix/models/endpoint_mtls_config_out.rb +0 -215
- data/lib/svix/models/endpoint_oauth_config_in.rb +0 -350
- data/lib/svix/models/endpoint_oauth_config_out.rb +0 -315
- data/lib/svix/models/endpoint_transformation_simulate_in.rb +0 -330
- data/lib/svix/models/endpoint_transformation_simulate_out.rb +0 -296
- data/lib/svix/models/endpoint_updated_event.rb +0 -272
- data/lib/svix/models/endpoint_updated_event_data.rb +0 -410
- data/lib/svix/models/environment_settings_out.rb +0 -455
- data/lib/svix/models/event_in.rb +0 -258
- data/lib/svix/models/event_out.rb +0 -274
- data/lib/svix/models/event_stream_out.rb +0 -255
- data/lib/svix/models/event_type_example_out.rb +0 -221
- data/lib/svix/models/event_type_schema_in.rb +0 -221
- data/lib/svix/models/export_event_type_out.rb +0 -315
- data/lib/svix/models/font_size_config.rb +0 -230
- data/lib/svix/models/generate_in.rb +0 -221
- data/lib/svix/models/generate_out.rb +0 -287
- data/lib/svix/models/google_cloud_storage_config.rb +0 -239
- data/lib/svix/models/http_error_out.rb +0 -237
- data/lib/svix/models/http_validation_error.rb +0 -223
- data/lib/svix/models/hubspot_oauth_config_in.rb +0 -221
- data/lib/svix/models/inbound_path_params.rb +0 -277
- data/lib/svix/models/incoming_webhook_payload_out.rb +0 -235
- data/lib/svix/models/kafka_security_protocol_type.rb +0 -41
- data/lib/svix/models/list_response_active_application_out.rb +0 -261
- data/lib/svix/models/list_response_application_stats.rb +0 -261
- data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +0 -261
- data/lib/svix/models/list_response_sink_out.rb +0 -261
- data/lib/svix/models/list_response_stream_event_type_out.rb +0 -261
- data/lib/svix/models/list_response_stream_out.rb +0 -261
- data/lib/svix/models/list_response_stream_sink_out.rb +0 -261
- data/lib/svix/models/list_response_template_out.rb +0 -261
- data/lib/svix/models/message_attempt_endpoint_out.rb +0 -545
- data/lib/svix/models/message_attempt_exhausted_event.rb +0 -272
- data/lib/svix/models/message_attempt_exhausted_event_data.rb +0 -482
- data/lib/svix/models/message_attempt_failed_data.rb +0 -293
- data/lib/svix/models/message_attempt_failing_event.rb +0 -272
- data/lib/svix/models/message_attempt_failing_event_data.rb +0 -482
- data/lib/svix/models/message_attempt_headers_out.rb +0 -263
- data/lib/svix/models/message_attempt_recovered_event.rb +0 -272
- data/lib/svix/models/message_attempt_recovered_event_data.rb +0 -482
- data/lib/svix/models/message_broadcast_in.rb +0 -423
- data/lib/svix/models/message_broadcast_out.rb +0 -315
- data/lib/svix/models/message_events_out.rb +0 -255
- data/lib/svix/models/message_precheck_in.rb +0 -288
- data/lib/svix/models/message_precheck_out.rb +0 -221
- data/lib/svix/models/message_raw_payload_out.rb +0 -221
- data/lib/svix/models/message_subscriber_auth_token_out.rb +0 -237
- data/lib/svix/models/o_auth_payload_in.rb +0 -237
- data/lib/svix/models/o_auth_payload_out.rb +0 -235
- data/lib/svix/models/oauth2_auth_method_in_out.rb +0 -41
- data/lib/svix/models/oauth2_grant_type_in_out.rb +0 -40
- data/lib/svix/models/oauth_jws_signing_algorithm.rb +0 -39
- data/lib/svix/models/one_time_token_in.rb +0 -221
- data/lib/svix/models/one_time_token_out.rb +0 -221
- data/lib/svix/models/polling_endpoint_message_out.rb +0 -454
- data/lib/svix/models/polling_endpoint_out.rb +0 -255
- data/lib/svix/models/redshift_config.rb +0 -317
- data/lib/svix/models/retry_schedule_in_out.rb +0 -216
- data/lib/svix/models/rotate_poller_token_in.rb +0 -280
- data/lib/svix/models/rotated_url_out.rb +0 -221
- data/lib/svix/models/s3_config.rb +0 -269
- data/lib/svix/models/sink_http_config.rb +0 -242
- data/lib/svix/models/sink_in.rb +0 -108
- data/lib/svix/models/sink_in_one_of.rb +0 -287
- data/lib/svix/models/sink_in_one_of1.rb +0 -319
- data/lib/svix/models/sink_in_one_of2.rb +0 -325
- data/lib/svix/models/sink_in_one_of3.rb +0 -271
- data/lib/svix/models/sink_in_one_of4.rb +0 -255
- data/lib/svix/models/sink_otel_v1_config.rb +0 -221
- data/lib/svix/models/sink_out.rb +0 -108
- data/lib/svix/models/sink_payload_format.rb +0 -39
- data/lib/svix/models/sink_secret_out.rb +0 -233
- data/lib/svix/models/sink_status.rb +0 -41
- data/lib/svix/models/sink_status_in.rb +0 -40
- data/lib/svix/models/sink_transform_in.rb +0 -248
- data/lib/svix/models/sink_transformation_out.rb +0 -226
- data/lib/svix/models/snowflake_config.rb +0 -287
- data/lib/svix/models/statistics_period.rb +0 -40
- data/lib/svix/models/stream_event_type_in.rb +0 -262
- data/lib/svix/models/stream_event_type_out.rb +0 -294
- data/lib/svix/models/stream_event_type_patch.rb +0 -254
- data/lib/svix/models/stream_in.rb +0 -287
- data/lib/svix/models/stream_out.rb +0 -350
- data/lib/svix/models/stream_patch.rb +0 -261
- data/lib/svix/models/stream_portal_access_in.rb +0 -293
- data/lib/svix/models/stream_sink_in.rb +0 -111
- data/lib/svix/models/stream_sink_in_one_of.rb +0 -271
- data/lib/svix/models/stream_sink_in_one_of1.rb +0 -271
- data/lib/svix/models/stream_sink_in_one_of2.rb +0 -271
- data/lib/svix/models/stream_sink_in_one_of3.rb +0 -271
- data/lib/svix/models/stream_sink_in_one_of4.rb +0 -271
- data/lib/svix/models/stream_sink_in_one_of5.rb +0 -271
- data/lib/svix/models/stream_sink_in_one_of6.rb +0 -271
- data/lib/svix/models/stream_sink_in_one_of7.rb +0 -271
- data/lib/svix/models/stream_sink_out.rb +0 -111
- data/lib/svix/models/stream_sink_patch.rb +0 -111
- data/lib/svix/models/template_patch.rb +0 -382
- data/lib/svix/models/template_update.rb +0 -402
- data/lib/svix/models/transformation_http_method.rb +0 -41
- data/lib/svix/models/transformation_simulate_in.rb +0 -330
- data/lib/svix/models/transformation_simulate_out.rb +0 -296
- data/lib/svix/models/validation_error.rb +0 -259
- data/lib/svix/statistics_api.rb +0 -17
data/lib/svix/api/message_api.rb
DELETED
@@ -1,1192 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Svix API
|
3
|
-
|
4
|
-
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.1.1
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.9.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'cgi'
|
14
|
-
|
15
|
-
module Svix
|
16
|
-
class MessageApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
# Create Message Attempt For Endpoint
|
23
|
-
# Creates and sends a message to the specified endpoint. The message attempt and response from the endpoint is returned.
|
24
|
-
# @param app_id [String] The Application's ID or UID.
|
25
|
-
# @param endpoint_id [String] The Endpoint's ID or UID.
|
26
|
-
# @param message_in [MessageIn]
|
27
|
-
# @param [Hash] opts the optional parameters
|
28
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
29
|
-
# @return [MessageAttemptOut]
|
30
|
-
def create_message_attempt_for_endpoint(app_id, endpoint_id, message_in, opts = {})
|
31
|
-
data, _status_code, _headers = create_message_attempt_for_endpoint_with_http_info(app_id, endpoint_id, message_in, opts)
|
32
|
-
data
|
33
|
-
end
|
34
|
-
|
35
|
-
# Create Message Attempt For Endpoint
|
36
|
-
# Creates and sends a message to the specified endpoint. The message attempt and response from the endpoint is returned.
|
37
|
-
# @param app_id [String] The Application's ID or UID.
|
38
|
-
# @param endpoint_id [String] The Endpoint's ID or UID.
|
39
|
-
# @param message_in [MessageIn]
|
40
|
-
# @param [Hash] opts the optional parameters
|
41
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
42
|
-
# @return [Array<(MessageAttemptOut, Integer, Hash)>] MessageAttemptOut data, response status code and response headers
|
43
|
-
def create_message_attempt_for_endpoint_with_http_info(app_id, endpoint_id, message_in, opts = {})
|
44
|
-
if @api_client.config.debugging
|
45
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.create_message_attempt_for_endpoint ...'
|
46
|
-
end
|
47
|
-
# verify the required parameter 'app_id' is set
|
48
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
49
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.create_message_attempt_for_endpoint"
|
50
|
-
end
|
51
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
52
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.create_message_attempt_for_endpoint, the character length must be smaller than or equal to 256.'
|
53
|
-
end
|
54
|
-
|
55
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
56
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.create_message_attempt_for_endpoint, the character length must be great than or equal to 1.'
|
57
|
-
end
|
58
|
-
|
59
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
60
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
61
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.create_message_attempt_for_endpoint, must conform to the pattern #{pattern}."
|
62
|
-
end
|
63
|
-
|
64
|
-
# verify the required parameter 'endpoint_id' is set
|
65
|
-
if @api_client.config.client_side_validation && endpoint_id.nil?
|
66
|
-
fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling MessageApi.create_message_attempt_for_endpoint"
|
67
|
-
end
|
68
|
-
if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
|
69
|
-
fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageApi.create_message_attempt_for_endpoint, the character length must be smaller than or equal to 256.'
|
70
|
-
end
|
71
|
-
|
72
|
-
if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
|
73
|
-
fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageApi.create_message_attempt_for_endpoint, the character length must be great than or equal to 1.'
|
74
|
-
end
|
75
|
-
|
76
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
77
|
-
if @api_client.config.client_side_validation && endpoint_id !~ pattern
|
78
|
-
fail ArgumentError, "invalid value for 'endpoint_id' when calling MessageApi.create_message_attempt_for_endpoint, must conform to the pattern #{pattern}."
|
79
|
-
end
|
80
|
-
|
81
|
-
# verify the required parameter 'message_in' is set
|
82
|
-
if @api_client.config.client_side_validation && message_in.nil?
|
83
|
-
fail ArgumentError, "Missing the required parameter 'message_in' when calling MessageApi.create_message_attempt_for_endpoint"
|
84
|
-
end
|
85
|
-
# resource path
|
86
|
-
local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/test-attempt'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
|
87
|
-
|
88
|
-
# query parameters
|
89
|
-
query_params = opts[:query_params] || {}
|
90
|
-
|
91
|
-
# header parameters
|
92
|
-
header_params = opts[:header_params] || {}
|
93
|
-
# HTTP header 'Accept' (if needed)
|
94
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
95
|
-
# HTTP header 'Content-Type'
|
96
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
97
|
-
if !content_type.nil?
|
98
|
-
header_params['Content-Type'] = content_type
|
99
|
-
end
|
100
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
101
|
-
|
102
|
-
# form parameters
|
103
|
-
form_params = opts[:form_params] || {}
|
104
|
-
|
105
|
-
# http body (model)
|
106
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(message_in)
|
107
|
-
|
108
|
-
# return_type
|
109
|
-
return_type = opts[:debug_return_type] || 'MessageAttemptOut'
|
110
|
-
|
111
|
-
# auth_names
|
112
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
113
|
-
|
114
|
-
new_options = opts.merge(
|
115
|
-
:operation => :"MessageApi.create_message_attempt_for_endpoint",
|
116
|
-
:header_params => header_params,
|
117
|
-
:query_params => query_params,
|
118
|
-
:form_params => form_params,
|
119
|
-
:body => post_body,
|
120
|
-
:auth_names => auth_names,
|
121
|
-
:return_type => return_type
|
122
|
-
)
|
123
|
-
|
124
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
125
|
-
if @api_client.config.debugging
|
126
|
-
@api_client.config.logger.debug "API called: MessageApi#create_message_attempt_for_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
127
|
-
end
|
128
|
-
return data, status_code, headers
|
129
|
-
end
|
130
|
-
|
131
|
-
# Public Events
|
132
|
-
# Reads the stream of created messages for an application, filtered on the Sink's event types and Channels.
|
133
|
-
# @param app_id [String] The Application's ID or UID.
|
134
|
-
# @param sink_id [String] The Endpoint's ID or UID.
|
135
|
-
# @param [Hash] opts the optional parameters
|
136
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
137
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
138
|
-
# @option opts [String] :event_type Filters messages sent with this event type (optional).
|
139
|
-
# @option opts [String] :channel Filters messages sent with this channel (optional).
|
140
|
-
# @option opts [Time] :after
|
141
|
-
# @return [PollingEndpointOut]
|
142
|
-
def v1_events_public(app_id, sink_id, opts = {})
|
143
|
-
data, _status_code, _headers = v1_events_public_with_http_info(app_id, sink_id, opts)
|
144
|
-
data
|
145
|
-
end
|
146
|
-
|
147
|
-
# Public Events
|
148
|
-
# Reads the stream of created messages for an application, filtered on the Sink's event types and Channels.
|
149
|
-
# @param app_id [String] The Application's ID or UID.
|
150
|
-
# @param sink_id [String] The Endpoint's ID or UID.
|
151
|
-
# @param [Hash] opts the optional parameters
|
152
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
153
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
154
|
-
# @option opts [String] :event_type Filters messages sent with this event type (optional).
|
155
|
-
# @option opts [String] :channel Filters messages sent with this channel (optional).
|
156
|
-
# @option opts [Time] :after
|
157
|
-
# @return [Array<(PollingEndpointOut, Integer, Hash)>] PollingEndpointOut data, response status code and response headers
|
158
|
-
def v1_events_public_with_http_info(app_id, sink_id, opts = {})
|
159
|
-
if @api_client.config.debugging
|
160
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_events_public ...'
|
161
|
-
end
|
162
|
-
# verify the required parameter 'app_id' is set
|
163
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
164
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_events_public"
|
165
|
-
end
|
166
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
167
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_events_public, the character length must be smaller than or equal to 256.'
|
168
|
-
end
|
169
|
-
|
170
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
171
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_events_public, the character length must be great than or equal to 1.'
|
172
|
-
end
|
173
|
-
|
174
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
175
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
176
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_events_public, must conform to the pattern #{pattern}."
|
177
|
-
end
|
178
|
-
|
179
|
-
# verify the required parameter 'sink_id' is set
|
180
|
-
if @api_client.config.client_side_validation && sink_id.nil?
|
181
|
-
fail ArgumentError, "Missing the required parameter 'sink_id' when calling MessageApi.v1_events_public"
|
182
|
-
end
|
183
|
-
if @api_client.config.client_side_validation && sink_id.to_s.length > 256
|
184
|
-
fail ArgumentError, 'invalid value for "sink_id" when calling MessageApi.v1_events_public, the character length must be smaller than or equal to 256.'
|
185
|
-
end
|
186
|
-
|
187
|
-
if @api_client.config.client_side_validation && sink_id.to_s.length < 1
|
188
|
-
fail ArgumentError, 'invalid value for "sink_id" when calling MessageApi.v1_events_public, the character length must be great than or equal to 1.'
|
189
|
-
end
|
190
|
-
|
191
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
192
|
-
if @api_client.config.client_side_validation && sink_id !~ pattern
|
193
|
-
fail ArgumentError, "invalid value for 'sink_id' when calling MessageApi.v1_events_public, must conform to the pattern #{pattern}."
|
194
|
-
end
|
195
|
-
|
196
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
197
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_events_public, must be smaller than or equal to 250.'
|
198
|
-
end
|
199
|
-
|
200
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
201
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_events_public, must be greater than or equal to 1.'
|
202
|
-
end
|
203
|
-
|
204
|
-
if @api_client.config.client_side_validation && !opts[:'event_type'].nil? && opts[:'event_type'].to_s.length > 256
|
205
|
-
fail ArgumentError, 'invalid value for "opts[:"event_type"]" when calling MessageApi.v1_events_public, the character length must be smaller than or equal to 256.'
|
206
|
-
end
|
207
|
-
|
208
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
209
|
-
if @api_client.config.client_side_validation && !opts[:'event_type'].nil? && opts[:'event_type'] !~ pattern
|
210
|
-
fail ArgumentError, "invalid value for 'opts[:\"event_type\"]' when calling MessageApi.v1_events_public, must conform to the pattern #{pattern}."
|
211
|
-
end
|
212
|
-
|
213
|
-
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
|
214
|
-
fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageApi.v1_events_public, the character length must be smaller than or equal to 128.'
|
215
|
-
end
|
216
|
-
|
217
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.:]+$/)
|
218
|
-
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
|
219
|
-
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.v1_events_public, must conform to the pattern #{pattern}."
|
220
|
-
end
|
221
|
-
|
222
|
-
# resource path
|
223
|
-
local_var_path = '/api/v1/app/{app_id}/poller/{sink_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'sink_id' + '}', CGI.escape(sink_id.to_s))
|
224
|
-
|
225
|
-
# query parameters
|
226
|
-
query_params = opts[:query_params] || {}
|
227
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
228
|
-
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
229
|
-
query_params[:'event_type'] = opts[:'event_type'] if !opts[:'event_type'].nil?
|
230
|
-
query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
|
231
|
-
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
232
|
-
|
233
|
-
# header parameters
|
234
|
-
header_params = opts[:header_params] || {}
|
235
|
-
# HTTP header 'Accept' (if needed)
|
236
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
237
|
-
|
238
|
-
# form parameters
|
239
|
-
form_params = opts[:form_params] || {}
|
240
|
-
|
241
|
-
# http body (model)
|
242
|
-
post_body = opts[:debug_body]
|
243
|
-
|
244
|
-
# return_type
|
245
|
-
return_type = opts[:debug_return_type] || 'PollingEndpointOut'
|
246
|
-
|
247
|
-
# auth_names
|
248
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
249
|
-
|
250
|
-
new_options = opts.merge(
|
251
|
-
:operation => :"MessageApi.v1_events_public",
|
252
|
-
:header_params => header_params,
|
253
|
-
:query_params => query_params,
|
254
|
-
:form_params => form_params,
|
255
|
-
:body => post_body,
|
256
|
-
:auth_names => auth_names,
|
257
|
-
:return_type => return_type
|
258
|
-
)
|
259
|
-
|
260
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
261
|
-
if @api_client.config.debugging
|
262
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_events_public\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
263
|
-
end
|
264
|
-
return data, status_code, headers
|
265
|
-
end
|
266
|
-
|
267
|
-
# Create Message
|
268
|
-
# 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.
|
269
|
-
# @param app_id [String] The Application's ID or UID.
|
270
|
-
# @param message_in [MessageIn]
|
271
|
-
# @param [Hash] opts the optional parameters
|
272
|
-
# @option opts [Boolean] :with_content When `true`, message payloads are included in the response. (default to true)
|
273
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
274
|
-
# @return [MessageOut]
|
275
|
-
def v1_message_create(app_id, message_in, opts = {})
|
276
|
-
data, _status_code, _headers = v1_message_create_with_http_info(app_id, message_in, opts)
|
277
|
-
data
|
278
|
-
end
|
279
|
-
|
280
|
-
# Create Message
|
281
|
-
# 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.
|
282
|
-
# @param app_id [String] The Application's ID or UID.
|
283
|
-
# @param message_in [MessageIn]
|
284
|
-
# @param [Hash] opts the optional parameters
|
285
|
-
# @option opts [Boolean] :with_content When `true`, message payloads are included in the response. (default to true)
|
286
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
287
|
-
# @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
|
288
|
-
def v1_message_create_with_http_info(app_id, message_in, opts = {})
|
289
|
-
if @api_client.config.debugging
|
290
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_create ...'
|
291
|
-
end
|
292
|
-
# verify the required parameter 'app_id' is set
|
293
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
294
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_create"
|
295
|
-
end
|
296
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
297
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_create, the character length must be smaller than or equal to 256.'
|
298
|
-
end
|
299
|
-
|
300
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
301
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_create, the character length must be great than or equal to 1.'
|
302
|
-
end
|
303
|
-
|
304
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
305
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
306
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_create, must conform to the pattern #{pattern}."
|
307
|
-
end
|
308
|
-
|
309
|
-
# verify the required parameter 'message_in' is set
|
310
|
-
if @api_client.config.client_side_validation && message_in.nil?
|
311
|
-
fail ArgumentError, "Missing the required parameter 'message_in' when calling MessageApi.v1_message_create"
|
312
|
-
end
|
313
|
-
# resource path
|
314
|
-
local_var_path = '/api/v1/app/{app_id}/msg'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
315
|
-
|
316
|
-
# query parameters
|
317
|
-
query_params = opts[:query_params] || {}
|
318
|
-
query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
|
319
|
-
|
320
|
-
# header parameters
|
321
|
-
header_params = opts[:header_params] || {}
|
322
|
-
# HTTP header 'Accept' (if needed)
|
323
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
324
|
-
# HTTP header 'Content-Type'
|
325
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
326
|
-
if !content_type.nil?
|
327
|
-
header_params['Content-Type'] = content_type
|
328
|
-
end
|
329
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
330
|
-
|
331
|
-
# form parameters
|
332
|
-
form_params = opts[:form_params] || {}
|
333
|
-
|
334
|
-
# http body (model)
|
335
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(message_in)
|
336
|
-
|
337
|
-
# return_type
|
338
|
-
return_type = opts[:debug_return_type] || 'MessageOut'
|
339
|
-
|
340
|
-
# auth_names
|
341
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
342
|
-
|
343
|
-
new_options = opts.merge(
|
344
|
-
:operation => :"MessageApi.v1_message_create",
|
345
|
-
:header_params => header_params,
|
346
|
-
:query_params => query_params,
|
347
|
-
:form_params => form_params,
|
348
|
-
:body => post_body,
|
349
|
-
:auth_names => auth_names,
|
350
|
-
:return_type => return_type
|
351
|
-
)
|
352
|
-
|
353
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
354
|
-
if @api_client.config.debugging
|
355
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
356
|
-
end
|
357
|
-
return data, status_code, headers
|
358
|
-
end
|
359
|
-
|
360
|
-
# Message Events
|
361
|
-
# Reads the stream of created messages for an application.
|
362
|
-
# @param app_id [String] The Application's ID or UID.
|
363
|
-
# @param [Hash] opts the optional parameters
|
364
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
365
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
366
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
367
|
-
# @option opts [Array<String>] :channels Filter response based on the event type.
|
368
|
-
# @option opts [Time] :after
|
369
|
-
# @return [MessageEventsOut]
|
370
|
-
def v1_message_events(app_id, opts = {})
|
371
|
-
data, _status_code, _headers = v1_message_events_with_http_info(app_id, opts)
|
372
|
-
data
|
373
|
-
end
|
374
|
-
|
375
|
-
# Message Events
|
376
|
-
# Reads the stream of created messages for an application.
|
377
|
-
# @param app_id [String] The Application's ID or UID.
|
378
|
-
# @param [Hash] opts the optional parameters
|
379
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
380
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
381
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
382
|
-
# @option opts [Array<String>] :channels Filter response based on the event type.
|
383
|
-
# @option opts [Time] :after
|
384
|
-
# @return [Array<(MessageEventsOut, Integer, Hash)>] MessageEventsOut data, response status code and response headers
|
385
|
-
def v1_message_events_with_http_info(app_id, opts = {})
|
386
|
-
if @api_client.config.debugging
|
387
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events ...'
|
388
|
-
end
|
389
|
-
# verify the required parameter 'app_id' is set
|
390
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
391
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events"
|
392
|
-
end
|
393
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
394
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events, the character length must be smaller than or equal to 256.'
|
395
|
-
end
|
396
|
-
|
397
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
398
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_events, the character length must be great than or equal to 1.'
|
399
|
-
end
|
400
|
-
|
401
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
402
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
403
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events, must conform to the pattern #{pattern}."
|
404
|
-
end
|
405
|
-
|
406
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
407
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events, must be smaller than or equal to 250.'
|
408
|
-
end
|
409
|
-
|
410
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
411
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events, must be greater than or equal to 1.'
|
412
|
-
end
|
413
|
-
|
414
|
-
# resource path
|
415
|
-
local_var_path = '/api/v1/app/{app_id}/events'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
416
|
-
|
417
|
-
# query parameters
|
418
|
-
query_params = opts[:query_params] || {}
|
419
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
420
|
-
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
421
|
-
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
422
|
-
query_params[:'channels'] = @api_client.build_collection_param(opts[:'channels'], :multi) if !opts[:'channels'].nil?
|
423
|
-
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
424
|
-
|
425
|
-
# header parameters
|
426
|
-
header_params = opts[:header_params] || {}
|
427
|
-
# HTTP header 'Accept' (if needed)
|
428
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
429
|
-
|
430
|
-
# form parameters
|
431
|
-
form_params = opts[:form_params] || {}
|
432
|
-
|
433
|
-
# http body (model)
|
434
|
-
post_body = opts[:debug_body]
|
435
|
-
|
436
|
-
# return_type
|
437
|
-
return_type = opts[:debug_return_type] || 'MessageEventsOut'
|
438
|
-
|
439
|
-
# auth_names
|
440
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
441
|
-
|
442
|
-
new_options = opts.merge(
|
443
|
-
:operation => :"MessageApi.v1_message_events",
|
444
|
-
:header_params => header_params,
|
445
|
-
:query_params => query_params,
|
446
|
-
:form_params => form_params,
|
447
|
-
:body => post_body,
|
448
|
-
:auth_names => auth_names,
|
449
|
-
:return_type => return_type
|
450
|
-
)
|
451
|
-
|
452
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
453
|
-
if @api_client.config.debugging
|
454
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
455
|
-
end
|
456
|
-
return data, status_code, headers
|
457
|
-
end
|
458
|
-
|
459
|
-
# Message Events Subscription
|
460
|
-
# Reads the stream of created messages for an application, but using server-managed iterator tracking.
|
461
|
-
# @param app_id [String] The Application's ID or UID.
|
462
|
-
# @param subscription_id [String] The EventsSubscription's ID or UID.
|
463
|
-
# @param [Hash] opts the optional parameters
|
464
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
465
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
466
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
467
|
-
# @option opts [Array<String>] :channels Filter response based on the event type.
|
468
|
-
# @option opts [Time] :after
|
469
|
-
# @return [MessageEventsOut]
|
470
|
-
def v1_message_events_subscription(app_id, subscription_id, opts = {})
|
471
|
-
data, _status_code, _headers = v1_message_events_subscription_with_http_info(app_id, subscription_id, opts)
|
472
|
-
data
|
473
|
-
end
|
474
|
-
|
475
|
-
# Message Events Subscription
|
476
|
-
# Reads the stream of created messages for an application, but using server-managed iterator tracking.
|
477
|
-
# @param app_id [String] The Application's ID or UID.
|
478
|
-
# @param subscription_id [String] The EventsSubscription's ID or UID.
|
479
|
-
# @param [Hash] opts the optional parameters
|
480
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
481
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
482
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
483
|
-
# @option opts [Array<String>] :channels Filter response based on the event type.
|
484
|
-
# @option opts [Time] :after
|
485
|
-
# @return [Array<(MessageEventsOut, Integer, Hash)>] MessageEventsOut data, response status code and response headers
|
486
|
-
def v1_message_events_subscription_with_http_info(app_id, subscription_id, opts = {})
|
487
|
-
if @api_client.config.debugging
|
488
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events_subscription ...'
|
489
|
-
end
|
490
|
-
# verify the required parameter 'app_id' is set
|
491
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
492
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events_subscription"
|
493
|
-
end
|
494
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
495
|
-
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.'
|
496
|
-
end
|
497
|
-
|
498
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
499
|
-
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.'
|
500
|
-
end
|
501
|
-
|
502
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
503
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
504
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events_subscription, must conform to the pattern #{pattern}."
|
505
|
-
end
|
506
|
-
|
507
|
-
# verify the required parameter 'subscription_id' is set
|
508
|
-
if @api_client.config.client_side_validation && subscription_id.nil?
|
509
|
-
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling MessageApi.v1_message_events_subscription"
|
510
|
-
end
|
511
|
-
if @api_client.config.client_side_validation && subscription_id.to_s.length > 256
|
512
|
-
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.'
|
513
|
-
end
|
514
|
-
|
515
|
-
if @api_client.config.client_side_validation && subscription_id.to_s.length < 1
|
516
|
-
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.'
|
517
|
-
end
|
518
|
-
|
519
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
520
|
-
if @api_client.config.client_side_validation && subscription_id !~ pattern
|
521
|
-
fail ArgumentError, "invalid value for 'subscription_id' when calling MessageApi.v1_message_events_subscription, must conform to the pattern #{pattern}."
|
522
|
-
end
|
523
|
-
|
524
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
525
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events_subscription, must be smaller than or equal to 250.'
|
526
|
-
end
|
527
|
-
|
528
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
529
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_events_subscription, must be greater than or equal to 1.'
|
530
|
-
end
|
531
|
-
|
532
|
-
# resource path
|
533
|
-
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))
|
534
|
-
|
535
|
-
# query parameters
|
536
|
-
query_params = opts[:query_params] || {}
|
537
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
538
|
-
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
539
|
-
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
540
|
-
query_params[:'channels'] = @api_client.build_collection_param(opts[:'channels'], :multi) if !opts[:'channels'].nil?
|
541
|
-
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
542
|
-
|
543
|
-
# header parameters
|
544
|
-
header_params = opts[:header_params] || {}
|
545
|
-
# HTTP header 'Accept' (if needed)
|
546
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
547
|
-
|
548
|
-
# form parameters
|
549
|
-
form_params = opts[:form_params] || {}
|
550
|
-
|
551
|
-
# http body (model)
|
552
|
-
post_body = opts[:debug_body]
|
553
|
-
|
554
|
-
# return_type
|
555
|
-
return_type = opts[:debug_return_type] || 'MessageEventsOut'
|
556
|
-
|
557
|
-
# auth_names
|
558
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
559
|
-
|
560
|
-
new_options = opts.merge(
|
561
|
-
:operation => :"MessageApi.v1_message_events_subscription",
|
562
|
-
:header_params => header_params,
|
563
|
-
:query_params => query_params,
|
564
|
-
:form_params => form_params,
|
565
|
-
:body => post_body,
|
566
|
-
:auth_names => auth_names,
|
567
|
-
:return_type => return_type
|
568
|
-
)
|
569
|
-
|
570
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
571
|
-
if @api_client.config.debugging
|
572
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_events_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
573
|
-
end
|
574
|
-
return data, status_code, headers
|
575
|
-
end
|
576
|
-
|
577
|
-
# Message Events Create Token
|
578
|
-
# Creates an auth token that can be used with the `v1.message.events-subscription` endpoint.
|
579
|
-
# @param app_id [String] The Application's ID or UID.
|
580
|
-
# @param subscription_id [String] The EventsSubscription's ID or UID.
|
581
|
-
# @param [Hash] opts the optional parameters
|
582
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
583
|
-
# @return [MessageSubscriberAuthTokenOut]
|
584
|
-
def v1_message_events_subscription_create_token(app_id, subscription_id, opts = {})
|
585
|
-
data, _status_code, _headers = v1_message_events_subscription_create_token_with_http_info(app_id, subscription_id, opts)
|
586
|
-
data
|
587
|
-
end
|
588
|
-
|
589
|
-
# Message Events Create Token
|
590
|
-
# Creates an auth token that can be used with the `v1.message.events-subscription` endpoint.
|
591
|
-
# @param app_id [String] The Application's ID or UID.
|
592
|
-
# @param subscription_id [String] The EventsSubscription's ID or UID.
|
593
|
-
# @param [Hash] opts the optional parameters
|
594
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
595
|
-
# @return [Array<(MessageSubscriberAuthTokenOut, Integer, Hash)>] MessageSubscriberAuthTokenOut data, response status code and response headers
|
596
|
-
def v1_message_events_subscription_create_token_with_http_info(app_id, subscription_id, opts = {})
|
597
|
-
if @api_client.config.debugging
|
598
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_events_subscription_create_token ...'
|
599
|
-
end
|
600
|
-
# verify the required parameter 'app_id' is set
|
601
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
602
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_events_subscription_create_token"
|
603
|
-
end
|
604
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
605
|
-
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.'
|
606
|
-
end
|
607
|
-
|
608
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
609
|
-
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.'
|
610
|
-
end
|
611
|
-
|
612
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
613
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
614
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_events_subscription_create_token, must conform to the pattern #{pattern}."
|
615
|
-
end
|
616
|
-
|
617
|
-
# verify the required parameter 'subscription_id' is set
|
618
|
-
if @api_client.config.client_side_validation && subscription_id.nil?
|
619
|
-
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling MessageApi.v1_message_events_subscription_create_token"
|
620
|
-
end
|
621
|
-
if @api_client.config.client_side_validation && subscription_id.to_s.length > 256
|
622
|
-
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.'
|
623
|
-
end
|
624
|
-
|
625
|
-
if @api_client.config.client_side_validation && subscription_id.to_s.length < 1
|
626
|
-
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.'
|
627
|
-
end
|
628
|
-
|
629
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
630
|
-
if @api_client.config.client_side_validation && subscription_id !~ pattern
|
631
|
-
fail ArgumentError, "invalid value for 'subscription_id' when calling MessageApi.v1_message_events_subscription_create_token, must conform to the pattern #{pattern}."
|
632
|
-
end
|
633
|
-
|
634
|
-
# resource path
|
635
|
-
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))
|
636
|
-
|
637
|
-
# query parameters
|
638
|
-
query_params = opts[:query_params] || {}
|
639
|
-
|
640
|
-
# header parameters
|
641
|
-
header_params = opts[:header_params] || {}
|
642
|
-
# HTTP header 'Accept' (if needed)
|
643
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
644
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
645
|
-
|
646
|
-
# form parameters
|
647
|
-
form_params = opts[:form_params] || {}
|
648
|
-
|
649
|
-
# http body (model)
|
650
|
-
post_body = opts[:debug_body]
|
651
|
-
|
652
|
-
# return_type
|
653
|
-
return_type = opts[:debug_return_type] || 'MessageSubscriberAuthTokenOut'
|
654
|
-
|
655
|
-
# auth_names
|
656
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
657
|
-
|
658
|
-
new_options = opts.merge(
|
659
|
-
:operation => :"MessageApi.v1_message_events_subscription_create_token",
|
660
|
-
:header_params => header_params,
|
661
|
-
:query_params => query_params,
|
662
|
-
:form_params => form_params,
|
663
|
-
:body => post_body,
|
664
|
-
:auth_names => auth_names,
|
665
|
-
:return_type => return_type
|
666
|
-
)
|
667
|
-
|
668
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
669
|
-
if @api_client.config.debugging
|
670
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_events_subscription_create_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
671
|
-
end
|
672
|
-
return data, status_code, headers
|
673
|
-
end
|
674
|
-
|
675
|
-
# Delete message payload
|
676
|
-
# 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.
|
677
|
-
# @param app_id [String] The Application's ID or UID.
|
678
|
-
# @param msg_id [String] The Message's ID or UID.
|
679
|
-
# @param [Hash] opts the optional parameters
|
680
|
-
# @return [nil]
|
681
|
-
def v1_message_expunge_content(app_id, msg_id, opts = {})
|
682
|
-
v1_message_expunge_content_with_http_info(app_id, msg_id, opts)
|
683
|
-
nil
|
684
|
-
end
|
685
|
-
|
686
|
-
# Delete message payload
|
687
|
-
# 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.
|
688
|
-
# @param app_id [String] The Application's ID or UID.
|
689
|
-
# @param msg_id [String] The Message's ID or UID.
|
690
|
-
# @param [Hash] opts the optional parameters
|
691
|
-
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
692
|
-
def v1_message_expunge_content_with_http_info(app_id, msg_id, opts = {})
|
693
|
-
if @api_client.config.debugging
|
694
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_expunge_content ...'
|
695
|
-
end
|
696
|
-
# verify the required parameter 'app_id' is set
|
697
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
698
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_expunge_content"
|
699
|
-
end
|
700
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
701
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_expunge_content, the character length must be smaller than or equal to 256.'
|
702
|
-
end
|
703
|
-
|
704
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
705
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_expunge_content, the character length must be great than or equal to 1.'
|
706
|
-
end
|
707
|
-
|
708
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
709
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
710
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_expunge_content, must conform to the pattern #{pattern}."
|
711
|
-
end
|
712
|
-
|
713
|
-
# verify the required parameter 'msg_id' is set
|
714
|
-
if @api_client.config.client_side_validation && msg_id.nil?
|
715
|
-
fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageApi.v1_message_expunge_content"
|
716
|
-
end
|
717
|
-
if @api_client.config.client_side_validation && msg_id.to_s.length > 256
|
718
|
-
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_expunge_content, the character length must be smaller than or equal to 256.'
|
719
|
-
end
|
720
|
-
|
721
|
-
if @api_client.config.client_side_validation && msg_id.to_s.length < 1
|
722
|
-
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_expunge_content, the character length must be great than or equal to 1.'
|
723
|
-
end
|
724
|
-
|
725
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
726
|
-
if @api_client.config.client_side_validation && msg_id !~ pattern
|
727
|
-
fail ArgumentError, "invalid value for 'msg_id' when calling MessageApi.v1_message_expunge_content, must conform to the pattern #{pattern}."
|
728
|
-
end
|
729
|
-
|
730
|
-
# resource path
|
731
|
-
local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/content'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s))
|
732
|
-
|
733
|
-
# query parameters
|
734
|
-
query_params = opts[:query_params] || {}
|
735
|
-
|
736
|
-
# header parameters
|
737
|
-
header_params = opts[:header_params] || {}
|
738
|
-
# HTTP header 'Accept' (if needed)
|
739
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
740
|
-
|
741
|
-
# form parameters
|
742
|
-
form_params = opts[:form_params] || {}
|
743
|
-
|
744
|
-
# http body (model)
|
745
|
-
post_body = opts[:debug_body]
|
746
|
-
|
747
|
-
# return_type
|
748
|
-
return_type = opts[:debug_return_type]
|
749
|
-
|
750
|
-
# auth_names
|
751
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
752
|
-
|
753
|
-
new_options = opts.merge(
|
754
|
-
:operation => :"MessageApi.v1_message_expunge_content",
|
755
|
-
:header_params => header_params,
|
756
|
-
:query_params => query_params,
|
757
|
-
:form_params => form_params,
|
758
|
-
:body => post_body,
|
759
|
-
:auth_names => auth_names,
|
760
|
-
:return_type => return_type
|
761
|
-
)
|
762
|
-
|
763
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
764
|
-
if @api_client.config.debugging
|
765
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_expunge_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
766
|
-
end
|
767
|
-
return data, status_code, headers
|
768
|
-
end
|
769
|
-
|
770
|
-
# Get Message
|
771
|
-
# Get a message by its ID or eventID.
|
772
|
-
# @param app_id [String] The Application's ID or UID.
|
773
|
-
# @param msg_id [String] The Message's ID or UID.
|
774
|
-
# @param [Hash] opts the optional parameters
|
775
|
-
# @option opts [Boolean] :with_content When `true` message payloads are included in the response. (default to true)
|
776
|
-
# @return [MessageOut]
|
777
|
-
def v1_message_get(app_id, msg_id, opts = {})
|
778
|
-
data, _status_code, _headers = v1_message_get_with_http_info(app_id, msg_id, opts)
|
779
|
-
data
|
780
|
-
end
|
781
|
-
|
782
|
-
# Get Message
|
783
|
-
# Get a message by its ID or eventID.
|
784
|
-
# @param app_id [String] The Application's ID or UID.
|
785
|
-
# @param msg_id [String] The Message's ID or UID.
|
786
|
-
# @param [Hash] opts the optional parameters
|
787
|
-
# @option opts [Boolean] :with_content When `true` message payloads are included in the response. (default to true)
|
788
|
-
# @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
|
789
|
-
def v1_message_get_with_http_info(app_id, msg_id, opts = {})
|
790
|
-
if @api_client.config.debugging
|
791
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_get ...'
|
792
|
-
end
|
793
|
-
# verify the required parameter 'app_id' is set
|
794
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
795
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_get"
|
796
|
-
end
|
797
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
798
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_get, the character length must be smaller than or equal to 256.'
|
799
|
-
end
|
800
|
-
|
801
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
802
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_get, the character length must be great than or equal to 1.'
|
803
|
-
end
|
804
|
-
|
805
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
806
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
807
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_get, must conform to the pattern #{pattern}."
|
808
|
-
end
|
809
|
-
|
810
|
-
# verify the required parameter 'msg_id' is set
|
811
|
-
if @api_client.config.client_side_validation && msg_id.nil?
|
812
|
-
fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageApi.v1_message_get"
|
813
|
-
end
|
814
|
-
if @api_client.config.client_side_validation && msg_id.to_s.length > 256
|
815
|
-
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_get, the character length must be smaller than or equal to 256.'
|
816
|
-
end
|
817
|
-
|
818
|
-
if @api_client.config.client_side_validation && msg_id.to_s.length < 1
|
819
|
-
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_get, the character length must be great than or equal to 1.'
|
820
|
-
end
|
821
|
-
|
822
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
823
|
-
if @api_client.config.client_side_validation && msg_id !~ pattern
|
824
|
-
fail ArgumentError, "invalid value for 'msg_id' when calling MessageApi.v1_message_get, must conform to the pattern #{pattern}."
|
825
|
-
end
|
826
|
-
|
827
|
-
# resource path
|
828
|
-
local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s))
|
829
|
-
|
830
|
-
# query parameters
|
831
|
-
query_params = opts[:query_params] || {}
|
832
|
-
query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
|
833
|
-
|
834
|
-
# header parameters
|
835
|
-
header_params = opts[:header_params] || {}
|
836
|
-
# HTTP header 'Accept' (if needed)
|
837
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
838
|
-
|
839
|
-
# form parameters
|
840
|
-
form_params = opts[:form_params] || {}
|
841
|
-
|
842
|
-
# http body (model)
|
843
|
-
post_body = opts[:debug_body]
|
844
|
-
|
845
|
-
# return_type
|
846
|
-
return_type = opts[:debug_return_type] || 'MessageOut'
|
847
|
-
|
848
|
-
# auth_names
|
849
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
850
|
-
|
851
|
-
new_options = opts.merge(
|
852
|
-
:operation => :"MessageApi.v1_message_get",
|
853
|
-
:header_params => header_params,
|
854
|
-
:query_params => query_params,
|
855
|
-
:form_params => form_params,
|
856
|
-
:body => post_body,
|
857
|
-
:auth_names => auth_names,
|
858
|
-
:return_type => return_type
|
859
|
-
)
|
860
|
-
|
861
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
862
|
-
if @api_client.config.debugging
|
863
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
864
|
-
end
|
865
|
-
return data, status_code, headers
|
866
|
-
end
|
867
|
-
|
868
|
-
# Get Raw Message Payload
|
869
|
-
# Get a message raw payload by its ID or eventID.
|
870
|
-
# @param app_id [String] The Application's ID or UID.
|
871
|
-
# @param msg_id [String] The Message's ID or UID.
|
872
|
-
# @param [Hash] opts the optional parameters
|
873
|
-
# @return [MessageRawPayloadOut]
|
874
|
-
def v1_message_get_raw_payload(app_id, msg_id, opts = {})
|
875
|
-
data, _status_code, _headers = v1_message_get_raw_payload_with_http_info(app_id, msg_id, opts)
|
876
|
-
data
|
877
|
-
end
|
878
|
-
|
879
|
-
# Get Raw Message Payload
|
880
|
-
# Get a message raw payload by its ID or eventID.
|
881
|
-
# @param app_id [String] The Application's ID or UID.
|
882
|
-
# @param msg_id [String] The Message's ID or UID.
|
883
|
-
# @param [Hash] opts the optional parameters
|
884
|
-
# @return [Array<(MessageRawPayloadOut, Integer, Hash)>] MessageRawPayloadOut data, response status code and response headers
|
885
|
-
def v1_message_get_raw_payload_with_http_info(app_id, msg_id, opts = {})
|
886
|
-
if @api_client.config.debugging
|
887
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_get_raw_payload ...'
|
888
|
-
end
|
889
|
-
# verify the required parameter 'app_id' is set
|
890
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
891
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_get_raw_payload"
|
892
|
-
end
|
893
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
894
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_get_raw_payload, the character length must be smaller than or equal to 256.'
|
895
|
-
end
|
896
|
-
|
897
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
898
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_get_raw_payload, the character length must be great than or equal to 1.'
|
899
|
-
end
|
900
|
-
|
901
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
902
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
903
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_get_raw_payload, must conform to the pattern #{pattern}."
|
904
|
-
end
|
905
|
-
|
906
|
-
# verify the required parameter 'msg_id' is set
|
907
|
-
if @api_client.config.client_side_validation && msg_id.nil?
|
908
|
-
fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageApi.v1_message_get_raw_payload"
|
909
|
-
end
|
910
|
-
if @api_client.config.client_side_validation && msg_id.to_s.length > 256
|
911
|
-
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_get_raw_payload, the character length must be smaller than or equal to 256.'
|
912
|
-
end
|
913
|
-
|
914
|
-
if @api_client.config.client_side_validation && msg_id.to_s.length < 1
|
915
|
-
fail ArgumentError, 'invalid value for "msg_id" when calling MessageApi.v1_message_get_raw_payload, the character length must be great than or equal to 1.'
|
916
|
-
end
|
917
|
-
|
918
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
919
|
-
if @api_client.config.client_side_validation && msg_id !~ pattern
|
920
|
-
fail ArgumentError, "invalid value for 'msg_id' when calling MessageApi.v1_message_get_raw_payload, must conform to the pattern #{pattern}."
|
921
|
-
end
|
922
|
-
|
923
|
-
# resource path
|
924
|
-
local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/raw'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s))
|
925
|
-
|
926
|
-
# query parameters
|
927
|
-
query_params = opts[:query_params] || {}
|
928
|
-
|
929
|
-
# header parameters
|
930
|
-
header_params = opts[:header_params] || {}
|
931
|
-
# HTTP header 'Accept' (if needed)
|
932
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
933
|
-
|
934
|
-
# form parameters
|
935
|
-
form_params = opts[:form_params] || {}
|
936
|
-
|
937
|
-
# http body (model)
|
938
|
-
post_body = opts[:debug_body]
|
939
|
-
|
940
|
-
# return_type
|
941
|
-
return_type = opts[:debug_return_type] || 'MessageRawPayloadOut'
|
942
|
-
|
943
|
-
# auth_names
|
944
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
945
|
-
|
946
|
-
new_options = opts.merge(
|
947
|
-
:operation => :"MessageApi.v1_message_get_raw_payload",
|
948
|
-
:header_params => header_params,
|
949
|
-
:query_params => query_params,
|
950
|
-
:form_params => form_params,
|
951
|
-
:body => post_body,
|
952
|
-
:auth_names => auth_names,
|
953
|
-
:return_type => return_type
|
954
|
-
)
|
955
|
-
|
956
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
957
|
-
if @api_client.config.debugging
|
958
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_get_raw_payload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
959
|
-
end
|
960
|
-
return data, status_code, headers
|
961
|
-
end
|
962
|
-
|
963
|
-
# List Messages
|
964
|
-
# List all of the application's messages. The `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results within a certain window. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.
|
965
|
-
# @param app_id [String] The Application's ID or UID.
|
966
|
-
# @param [Hash] opts the optional parameters
|
967
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
968
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
969
|
-
# @option opts [String] :channel Filter response based on the channel.
|
970
|
-
# @option opts [Time] :before Only include items created before a certain date.
|
971
|
-
# @option opts [Time] :after Only include items created after a certain date.
|
972
|
-
# @option opts [Boolean] :with_content When `true` message payloads are included in the response. (default to true)
|
973
|
-
# @option opts [String] :tag Filter messages matching the provided tag.
|
974
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
975
|
-
# @return [ListResponseMessageOut]
|
976
|
-
def v1_message_list(app_id, opts = {})
|
977
|
-
data, _status_code, _headers = v1_message_list_with_http_info(app_id, opts)
|
978
|
-
data
|
979
|
-
end
|
980
|
-
|
981
|
-
# List Messages
|
982
|
-
# List all of the application's messages. The `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results within a certain window. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.
|
983
|
-
# @param app_id [String] The Application's ID or UID.
|
984
|
-
# @param [Hash] opts the optional parameters
|
985
|
-
# @option opts [Integer] :limit Limit the number of returned items
|
986
|
-
# @option opts [String] :iterator The iterator returned from a prior invocation
|
987
|
-
# @option opts [String] :channel Filter response based on the channel.
|
988
|
-
# @option opts [Time] :before Only include items created before a certain date.
|
989
|
-
# @option opts [Time] :after Only include items created after a certain date.
|
990
|
-
# @option opts [Boolean] :with_content When `true` message payloads are included in the response. (default to true)
|
991
|
-
# @option opts [String] :tag Filter messages matching the provided tag.
|
992
|
-
# @option opts [Array<String>] :event_types Filter response based on the event type
|
993
|
-
# @return [Array<(ListResponseMessageOut, Integer, Hash)>] ListResponseMessageOut data, response status code and response headers
|
994
|
-
def v1_message_list_with_http_info(app_id, opts = {})
|
995
|
-
if @api_client.config.debugging
|
996
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_list ...'
|
997
|
-
end
|
998
|
-
# verify the required parameter 'app_id' is set
|
999
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
1000
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_list"
|
1001
|
-
end
|
1002
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
1003
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_list, the character length must be smaller than or equal to 256.'
|
1004
|
-
end
|
1005
|
-
|
1006
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
1007
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_list, the character length must be great than or equal to 1.'
|
1008
|
-
end
|
1009
|
-
|
1010
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
1011
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
1012
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
1013
|
-
end
|
1014
|
-
|
1015
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
1016
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_list, must be smaller than or equal to 250.'
|
1017
|
-
end
|
1018
|
-
|
1019
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
1020
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_message_list, must be greater than or equal to 1.'
|
1021
|
-
end
|
1022
|
-
|
1023
|
-
if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'].to_s.length > 31
|
1024
|
-
fail ArgumentError, 'invalid value for "opts[:"iterator"]" when calling MessageApi.v1_message_list, the character length must be smaller than or equal to 31.'
|
1025
|
-
end
|
1026
|
-
|
1027
|
-
if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'].to_s.length < 31
|
1028
|
-
fail ArgumentError, 'invalid value for "opts[:"iterator"]" when calling MessageApi.v1_message_list, the character length must be great than or equal to 31.'
|
1029
|
-
end
|
1030
|
-
|
1031
|
-
pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
|
1032
|
-
if @api_client.config.client_side_validation && !opts[:'iterator'].nil? && opts[:'iterator'] !~ pattern
|
1033
|
-
fail ArgumentError, "invalid value for 'opts[:\"iterator\"]' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
1034
|
-
end
|
1035
|
-
|
1036
|
-
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
|
1037
|
-
fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageApi.v1_message_list, the character length must be smaller than or equal to 128.'
|
1038
|
-
end
|
1039
|
-
|
1040
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.:]+$/)
|
1041
|
-
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
|
1042
|
-
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
1043
|
-
end
|
1044
|
-
|
1045
|
-
if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128
|
1046
|
-
fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageApi.v1_message_list, the character length must be smaller than or equal to 128.'
|
1047
|
-
end
|
1048
|
-
|
1049
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
1050
|
-
if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'] !~ pattern
|
1051
|
-
fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
1052
|
-
end
|
1053
|
-
|
1054
|
-
# resource path
|
1055
|
-
local_var_path = '/api/v1/app/{app_id}/msg'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
1056
|
-
|
1057
|
-
# query parameters
|
1058
|
-
query_params = opts[:query_params] || {}
|
1059
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
1060
|
-
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
1061
|
-
query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
|
1062
|
-
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
1063
|
-
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
1064
|
-
query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
|
1065
|
-
query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
|
1066
|
-
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
1067
|
-
|
1068
|
-
# header parameters
|
1069
|
-
header_params = opts[:header_params] || {}
|
1070
|
-
# HTTP header 'Accept' (if needed)
|
1071
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
1072
|
-
|
1073
|
-
# form parameters
|
1074
|
-
form_params = opts[:form_params] || {}
|
1075
|
-
|
1076
|
-
# http body (model)
|
1077
|
-
post_body = opts[:debug_body]
|
1078
|
-
|
1079
|
-
# return_type
|
1080
|
-
return_type = opts[:debug_return_type] || 'ListResponseMessageOut'
|
1081
|
-
|
1082
|
-
# auth_names
|
1083
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
1084
|
-
|
1085
|
-
new_options = opts.merge(
|
1086
|
-
:operation => :"MessageApi.v1_message_list",
|
1087
|
-
:header_params => header_params,
|
1088
|
-
:query_params => query_params,
|
1089
|
-
:form_params => form_params,
|
1090
|
-
:body => post_body,
|
1091
|
-
:auth_names => auth_names,
|
1092
|
-
:return_type => return_type
|
1093
|
-
)
|
1094
|
-
|
1095
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1096
|
-
if @api_client.config.debugging
|
1097
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1098
|
-
end
|
1099
|
-
return data, status_code, headers
|
1100
|
-
end
|
1101
|
-
|
1102
|
-
# Create Message Precheck
|
1103
|
-
# A pre-check call for `create.message` that checks whether endpoints are actively listening to this message.
|
1104
|
-
# @param app_id [String] The Application's ID or UID.
|
1105
|
-
# @param message_precheck_in [MessagePrecheckIn]
|
1106
|
-
# @param [Hash] opts the optional parameters
|
1107
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
1108
|
-
# @return [MessagePrecheckOut]
|
1109
|
-
def v1_message_precheck(app_id, message_precheck_in, opts = {})
|
1110
|
-
data, _status_code, _headers = v1_message_precheck_with_http_info(app_id, message_precheck_in, opts)
|
1111
|
-
data
|
1112
|
-
end
|
1113
|
-
|
1114
|
-
# Create Message Precheck
|
1115
|
-
# A pre-check call for `create.message` that checks whether endpoints are actively listening to this message.
|
1116
|
-
# @param app_id [String] The Application's ID or UID.
|
1117
|
-
# @param message_precheck_in [MessagePrecheckIn]
|
1118
|
-
# @param [Hash] opts the optional parameters
|
1119
|
-
# @option opts [String] :idempotency_key The request's idempotency key
|
1120
|
-
# @return [Array<(MessagePrecheckOut, Integer, Hash)>] MessagePrecheckOut data, response status code and response headers
|
1121
|
-
def v1_message_precheck_with_http_info(app_id, message_precheck_in, opts = {})
|
1122
|
-
if @api_client.config.debugging
|
1123
|
-
@api_client.config.logger.debug 'Calling API: MessageApi.v1_message_precheck ...'
|
1124
|
-
end
|
1125
|
-
# verify the required parameter 'app_id' is set
|
1126
|
-
if @api_client.config.client_side_validation && app_id.nil?
|
1127
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_message_precheck"
|
1128
|
-
end
|
1129
|
-
if @api_client.config.client_side_validation && app_id.to_s.length > 256
|
1130
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_precheck, the character length must be smaller than or equal to 256.'
|
1131
|
-
end
|
1132
|
-
|
1133
|
-
if @api_client.config.client_side_validation && app_id.to_s.length < 1
|
1134
|
-
fail ArgumentError, 'invalid value for "app_id" when calling MessageApi.v1_message_precheck, the character length must be great than or equal to 1.'
|
1135
|
-
end
|
1136
|
-
|
1137
|
-
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
1138
|
-
if @api_client.config.client_side_validation && app_id !~ pattern
|
1139
|
-
fail ArgumentError, "invalid value for 'app_id' when calling MessageApi.v1_message_precheck, must conform to the pattern #{pattern}."
|
1140
|
-
end
|
1141
|
-
|
1142
|
-
# verify the required parameter 'message_precheck_in' is set
|
1143
|
-
if @api_client.config.client_side_validation && message_precheck_in.nil?
|
1144
|
-
fail ArgumentError, "Missing the required parameter 'message_precheck_in' when calling MessageApi.v1_message_precheck"
|
1145
|
-
end
|
1146
|
-
# resource path
|
1147
|
-
local_var_path = '/api/v1/app/{app_id}/msg/precheck/active'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
1148
|
-
|
1149
|
-
# query parameters
|
1150
|
-
query_params = opts[:query_params] || {}
|
1151
|
-
|
1152
|
-
# header parameters
|
1153
|
-
header_params = opts[:header_params] || {}
|
1154
|
-
# HTTP header 'Accept' (if needed)
|
1155
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
1156
|
-
# HTTP header 'Content-Type'
|
1157
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
1158
|
-
if !content_type.nil?
|
1159
|
-
header_params['Content-Type'] = content_type
|
1160
|
-
end
|
1161
|
-
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1162
|
-
|
1163
|
-
# form parameters
|
1164
|
-
form_params = opts[:form_params] || {}
|
1165
|
-
|
1166
|
-
# http body (model)
|
1167
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(message_precheck_in)
|
1168
|
-
|
1169
|
-
# return_type
|
1170
|
-
return_type = opts[:debug_return_type] || 'MessagePrecheckOut'
|
1171
|
-
|
1172
|
-
# auth_names
|
1173
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
1174
|
-
|
1175
|
-
new_options = opts.merge(
|
1176
|
-
:operation => :"MessageApi.v1_message_precheck",
|
1177
|
-
:header_params => header_params,
|
1178
|
-
:query_params => query_params,
|
1179
|
-
:form_params => form_params,
|
1180
|
-
:body => post_body,
|
1181
|
-
:auth_names => auth_names,
|
1182
|
-
:return_type => return_type
|
1183
|
-
)
|
1184
|
-
|
1185
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
1186
|
-
if @api_client.config.debugging
|
1187
|
-
@api_client.config.logger.debug "API called: MessageApi#v1_message_precheck\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1188
|
-
end
|
1189
|
-
return data, status_code, headers
|
1190
|
-
end
|
1191
|
-
end
|
1192
|
-
end
|