From b730c688ac3f5a0ce6d23793664da14a58a2cc8b Mon Sep 17 00:00:00 2001 From: Owen Nelson Date: Mon, 30 Dec 2024 17:15:27 -0800 Subject: [PATCH] Libs(Rust): track sources produced by codegen in git Motivated by the desire to simplify the build/release for this SDK and the CLI. Additionally, tracking codegen files in the Go SDK has proven helpful for us in the past as our spec has evolved. Having these sources tracked as well can give us a "second opinion" when changes bubble up. A similar problem as seen in the Go SDK exists for any other that tracks their codegen sources in git; stale files have to be explicitly removed. Previously this would happen naturally when starting from a clean working copy, but no longer. To avoid a build up of sources that are orphaned by spec changes, the regen script now deletes files before generating new ones. Svix maintainers take note: action is required in this situation. Look for the removals by checking `git status` then stage the deletions before pushing your commit up! --- regen_openapi.sh | 3 + rust/.gitignore | 2 - rust/src/apis/application_api.rs | 361 ++++++ rust/src/apis/authentication_api.rs | 358 ++++++ rust/src/apis/background_tasks_api.rs | 119 ++ rust/src/apis/broadcast_api.rs | 59 + rust/src/apis/endpoint_api.rs | 1127 +++++++++++++++++ rust/src/apis/environment_api.rs | 97 ++ rust/src/apis/environment_settings_api.rs | 45 + rust/src/apis/event_type_api.rs | 470 +++++++ rust/src/apis/events_api.rs | 84 ++ rust/src/apis/health_api.rs | 46 + rust/src/apis/inbound_api.rs | 114 ++ rust/src/apis/integration_api.rs | 324 +++++ rust/src/apis/message_api.rs | 595 +++++++++ rust/src/apis/message_attempt_api.rs | 882 +++++++++++++ rust/src/apis/mod.rs | 45 + rust/src/apis/statistics_api.rs | 187 +++ rust/src/apis/stream_api.rs | 351 +++++ rust/src/apis/stream_event_types_api.rs | 258 ++++ rust/src/apis/transformation_template_api.rs | 497 ++++++++ rust/src/apis/webhook_endpoint_api.rs | 300 +++++ rust/src/models/aggregate_event_types_out.rs | 35 + rust/src/models/app_portal_access_in.rs | 41 + rust/src/models/app_portal_access_out.rs | 32 + rust/src/models/app_usage_stats_in.rs | 36 + rust/src/models/app_usage_stats_out.rs | 39 + rust/src/models/application_in.rs | 39 + rust/src/models/application_out.rs | 49 + rust/src/models/application_patch.rs | 39 + rust/src/models/application_stats.rs | 37 + .../src/models/application_token_expire_in.rs | 30 + rust/src/models/attempt_statistics_data.rs | 32 + .../src/models/attempt_statistics_response.rs | 38 + rust/src/models/auth_token_out.rs | 45 + rust/src/models/azure_blob_storage_config.rs | 35 + rust/src/models/background_task_out.rs | 38 + rust/src/models/background_task_status.rs | 43 + rust/src/models/background_task_type.rs | 52 + rust/src/models/big_query_config.rs | 41 + rust/src/models/border_radius_config.rs | 35 + rust/src/models/border_radius_enum.rs | 49 + .../src/models/client_secret_jwt_params_in.rs | 41 + rust/src/models/completion_choice.rs | 35 + rust/src/models/completion_message.rs | 32 + rust/src/models/count_out.rs | 34 + rust/src/models/create_stream_in.rs | 32 + rust/src/models/create_token_in.rs | 34 + rust/src/models/custom_color_palette.rs | 53 + rust/src/models/custom_strings_override.rs | 35 + rust/src/models/custom_theme_override.rs | 32 + rust/src/models/dashboard_access_out.rs | 32 + rust/src/models/duration.rs | 32 + rust/src/models/endpoint_created_event.rs | 46 + .../src/models/endpoint_created_event_data.rs | 44 + rust/src/models/endpoint_deleted_event.rs | 46 + .../src/models/endpoint_deleted_event_data.rs | 44 + rust/src/models/endpoint_disabled_event.rs | 46 + .../models/endpoint_disabled_event_data.rs | 47 + rust/src/models/endpoint_headers_in.rs | 29 + rust/src/models/endpoint_headers_out.rs | 34 + rust/src/models/endpoint_headers_patch_in.rs | 29 + rust/src/models/endpoint_in.rs | 59 + rust/src/models/endpoint_message_out.rs | 59 + rust/src/models/endpoint_mtls_config_in.rs | 34 + rust/src/models/endpoint_oauth_config_in.rs | 59 + rust/src/models/endpoint_out.rs | 66 + rust/src/models/endpoint_patch.rs | 58 + rust/src/models/endpoint_secret_out.rs | 30 + rust/src/models/endpoint_secret_rotate_in.rs | 30 + rust/src/models/endpoint_stats.rs | 38 + rust/src/models/endpoint_transformation_in.rs | 32 + .../src/models/endpoint_transformation_out.rs | 32 + .../endpoint_transformation_simulate_in.rs | 39 + .../endpoint_transformation_simulate_out.rs | 35 + rust/src/models/endpoint_update.rs | 55 + rust/src/models/endpoint_updated_event.rs | 46 + .../src/models/endpoint_updated_event_data.rs | 44 + rust/src/models/environment_in.rs | 35 + rust/src/models/environment_out.rs | 41 + rust/src/models/environment_settings_out.rs | 74 ++ rust/src/models/event_example_in.rs | 34 + rust/src/models/event_in.rs | 33 + rust/src/models/event_out.rs | 36 + rust/src/models/event_stream_out.rs | 35 + rust/src/models/event_type_example_out.rs | 29 + rust/src/models/event_type_from_open_api.rs | 46 + .../models/event_type_import_open_api_in.rs | 40 + .../models/event_type_import_open_api_out.rs | 29 + .../event_type_import_open_api_out_data.rs | 32 + rust/src/models/event_type_in.rs | 50 + rust/src/models/event_type_out.rs | 56 + rust/src/models/event_type_patch.rs | 45 + rust/src/models/event_type_schema_in.rs | 29 + rust/src/models/event_type_update.rs | 46 + rust/src/models/export_event_type_out.rs | 35 + rust/src/models/font_size_config.rs | 29 + rust/src/models/generate_in.rs | 29 + rust/src/models/generate_out.rs | 41 + .../src/models/google_cloud_storage_config.rs | 35 + rust/src/models/http_error_out.rs | 32 + rust/src/models/http_validation_error.rs | 29 + rust/src/models/hubspot_oauth_config_in.rs | 29 + rust/src/models/inbound_path_params.rs | 33 + .../models/incoming_webhook_payload_out.rs | 35 + rust/src/models/integration_in.rs | 29 + rust/src/models/integration_key_out.rs | 29 + rust/src/models/integration_out.rs | 39 + rust/src/models/integration_update.rs | 29 + .../models/kafka_security_protocol_type.rs | 43 + .../models/list_response_application_out_.rs | 38 + .../list_response_application_stats_.rs | 38 + .../list_response_background_task_out_.rs | 38 + .../list_response_endpoint_message_out_.rs | 38 + .../src/models/list_response_endpoint_out_.rs | 38 + .../models/list_response_event_type_out_.rs | 38 + .../models/list_response_integration_out_.rs | 38 + ..._response_message_attempt_endpoint_out_.rs | 38 + .../list_response_message_attempt_out_.rs | 38 + .../list_response_message_endpoint_out_.rs | 38 + rust/src/models/list_response_message_out_.rs | 38 + ...ponse_operational_webhook_endpoint_out_.rs | 38 + rust/src/models/list_response_sink_out_.rs | 38 + .../list_response_stream_event_type_out_.rs | 38 + rust/src/models/list_response_stream_out_.rs | 38 + .../models/list_response_stream_sink_out_.rs | 38 + .../src/models/list_response_template_out_.rs | 38 + .../models/message_attempt_endpoint_out.rs | 63 + .../models/message_attempt_exhausted_event.rs | 46 + .../message_attempt_exhausted_event_data.rs | 51 + .../src/models/message_attempt_failed_data.rs | 36 + .../models/message_attempt_failing_event.rs | 46 + .../message_attempt_failing_event_data.rs | 51 + .../src/models/message_attempt_headers_out.rs | 35 + rust/src/models/message_attempt_out.rs | 63 + .../models/message_attempt_recovered_event.rs | 46 + .../message_attempt_recovered_event_data.rs | 51 + .../models/message_attempt_trigger_type.rs | 40 + rust/src/models/message_broadcast_in.rs | 49 + rust/src/models/message_broadcast_out.rs | 35 + rust/src/models/message_endpoint_out.rs | 69 + rust/src/models/message_events_out.rs | 35 + rust/src/models/message_in.rs | 61 + rust/src/models/message_out.rs | 51 + rust/src/models/message_raw_payload_out.rs | 29 + rust/src/models/message_status.rs | 44 + .../message_subscriber_auth_token_out.rs | 32 + rust/src/models/mod.rs | 570 +++++++++ rust/src/models/o_auth_payload_in.rs | 32 + rust/src/models/o_auth_payload_out.rs | 35 + rust/src/models/oauth2_auth_method_in.rs | 44 + rust/src/models/oauth2_grant_type_in.rs | 40 + .../src/models/oauth_jws_signing_algorithm.rs | 37 + rust/src/models/one_time_token_in.rs | 29 + rust/src/models/one_time_token_out.rs | 29 + .../models/operational_webhook_endpoint_in.rs | 52 + .../operational_webhook_endpoint_out.rs | 59 + .../operational_webhook_endpoint_secret_in.rs | 30 + ...operational_webhook_endpoint_secret_out.rs | 30 + .../operational_webhook_endpoint_update.rs | 48 + rust/src/models/ordering.rs | 41 + rust/src/models/recover_in.rs | 32 + rust/src/models/recover_out.rs | 35 + rust/src/models/redshift_config.rs | 55 + rust/src/models/replay_in.rs | 32 + rust/src/models/replay_out.rs | 35 + rust/src/models/retry_schedule_in_out.rs | 29 + rust/src/models/rotate_poller_token_in.rs | 34 + rust/src/models/rotated_url_out.rs | 29 + rust/src/models/s3_config.rs | 38 + rust/src/models/sink_http_config.rs | 35 + rust/src/models/sink_in.rs | 51 + rust/src/models/sink_in_one_of.rs | 47 + rust/src/models/sink_in_one_of_1.rs | 53 + rust/src/models/sink_in_one_of_2.rs | 58 + rust/src/models/sink_in_one_of_3.rs | 44 + rust/src/models/sink_in_one_of_4.rs | 41 + rust/src/models/sink_otel_v1_config.rs | 29 + rust/src/models/sink_out.rs | 51 + rust/src/models/sink_payload_format.rs | 37 + rust/src/models/sink_status.rs | 43 + rust/src/models/sink_status_in.rs | 40 + rust/src/models/sink_transform_in.rs | 32 + rust/src/models/sink_transformation_out.rs | 32 + rust/src/models/snowflake_config.rs | 52 + rust/src/models/statistics_period.rs | 41 + rust/src/models/status_code_class.rs | 48 + rust/src/models/stream_event_type_in.rs | 33 + rust/src/models/stream_event_type_out.rs | 39 + rust/src/models/stream_event_type_patch.rs | 33 + rust/src/models/stream_in.rs | 32 + rust/src/models/stream_out.rs | 41 + rust/src/models/stream_patch.rs | 32 + rust/src/models/stream_sink_in.rs | 60 + rust/src/models/stream_sink_in_one_of.rs | 44 + rust/src/models/stream_sink_in_one_of_1.rs | 44 + rust/src/models/stream_sink_in_one_of_2.rs | 44 + rust/src/models/stream_sink_in_one_of_3.rs | 44 + rust/src/models/stream_sink_in_one_of_4.rs | 44 + rust/src/models/stream_sink_in_one_of_5.rs | 44 + rust/src/models/stream_sink_in_one_of_6.rs | 44 + rust/src/models/stream_sink_in_one_of_7.rs | 44 + rust/src/models/stream_sink_out.rs | 60 + rust/src/models/stream_sink_patch.rs | 60 + rust/src/models/template_in.rs | 53 + rust/src/models/template_out.rs | 65 + rust/src/models/template_patch.rs | 53 + rust/src/models/template_update.rs | 53 + rust/src/models/transformation_http_method.rs | 43 + rust/src/models/transformation_simulate_in.rs | 39 + .../src/models/transformation_simulate_out.rs | 35 + .../models/transformation_template_kind.rs | 70 + rust/src/models/validation_error.rs | 40 + 213 files changed, 14667 insertions(+), 2 deletions(-) create mode 100644 rust/src/apis/application_api.rs create mode 100644 rust/src/apis/authentication_api.rs create mode 100644 rust/src/apis/background_tasks_api.rs create mode 100644 rust/src/apis/broadcast_api.rs create mode 100644 rust/src/apis/endpoint_api.rs create mode 100644 rust/src/apis/environment_api.rs create mode 100644 rust/src/apis/environment_settings_api.rs create mode 100644 rust/src/apis/event_type_api.rs create mode 100644 rust/src/apis/events_api.rs create mode 100644 rust/src/apis/health_api.rs create mode 100644 rust/src/apis/inbound_api.rs create mode 100644 rust/src/apis/integration_api.rs create mode 100644 rust/src/apis/message_api.rs create mode 100644 rust/src/apis/message_attempt_api.rs create mode 100644 rust/src/apis/mod.rs create mode 100644 rust/src/apis/statistics_api.rs create mode 100644 rust/src/apis/stream_api.rs create mode 100644 rust/src/apis/stream_event_types_api.rs create mode 100644 rust/src/apis/transformation_template_api.rs create mode 100644 rust/src/apis/webhook_endpoint_api.rs create mode 100644 rust/src/models/aggregate_event_types_out.rs create mode 100644 rust/src/models/app_portal_access_in.rs create mode 100644 rust/src/models/app_portal_access_out.rs create mode 100644 rust/src/models/app_usage_stats_in.rs create mode 100644 rust/src/models/app_usage_stats_out.rs create mode 100644 rust/src/models/application_in.rs create mode 100644 rust/src/models/application_out.rs create mode 100644 rust/src/models/application_patch.rs create mode 100644 rust/src/models/application_stats.rs create mode 100644 rust/src/models/application_token_expire_in.rs create mode 100644 rust/src/models/attempt_statistics_data.rs create mode 100644 rust/src/models/attempt_statistics_response.rs create mode 100644 rust/src/models/auth_token_out.rs create mode 100644 rust/src/models/azure_blob_storage_config.rs create mode 100644 rust/src/models/background_task_out.rs create mode 100644 rust/src/models/background_task_status.rs create mode 100644 rust/src/models/background_task_type.rs create mode 100644 rust/src/models/big_query_config.rs create mode 100644 rust/src/models/border_radius_config.rs create mode 100644 rust/src/models/border_radius_enum.rs create mode 100644 rust/src/models/client_secret_jwt_params_in.rs create mode 100644 rust/src/models/completion_choice.rs create mode 100644 rust/src/models/completion_message.rs create mode 100644 rust/src/models/count_out.rs create mode 100644 rust/src/models/create_stream_in.rs create mode 100644 rust/src/models/create_token_in.rs create mode 100644 rust/src/models/custom_color_palette.rs create mode 100644 rust/src/models/custom_strings_override.rs create mode 100644 rust/src/models/custom_theme_override.rs create mode 100644 rust/src/models/dashboard_access_out.rs create mode 100644 rust/src/models/duration.rs create mode 100644 rust/src/models/endpoint_created_event.rs create mode 100644 rust/src/models/endpoint_created_event_data.rs create mode 100644 rust/src/models/endpoint_deleted_event.rs create mode 100644 rust/src/models/endpoint_deleted_event_data.rs create mode 100644 rust/src/models/endpoint_disabled_event.rs create mode 100644 rust/src/models/endpoint_disabled_event_data.rs create mode 100644 rust/src/models/endpoint_headers_in.rs create mode 100644 rust/src/models/endpoint_headers_out.rs create mode 100644 rust/src/models/endpoint_headers_patch_in.rs create mode 100644 rust/src/models/endpoint_in.rs create mode 100644 rust/src/models/endpoint_message_out.rs create mode 100644 rust/src/models/endpoint_mtls_config_in.rs create mode 100644 rust/src/models/endpoint_oauth_config_in.rs create mode 100644 rust/src/models/endpoint_out.rs create mode 100644 rust/src/models/endpoint_patch.rs create mode 100644 rust/src/models/endpoint_secret_out.rs create mode 100644 rust/src/models/endpoint_secret_rotate_in.rs create mode 100644 rust/src/models/endpoint_stats.rs create mode 100644 rust/src/models/endpoint_transformation_in.rs create mode 100644 rust/src/models/endpoint_transformation_out.rs create mode 100644 rust/src/models/endpoint_transformation_simulate_in.rs create mode 100644 rust/src/models/endpoint_transformation_simulate_out.rs create mode 100644 rust/src/models/endpoint_update.rs create mode 100644 rust/src/models/endpoint_updated_event.rs create mode 100644 rust/src/models/endpoint_updated_event_data.rs create mode 100644 rust/src/models/environment_in.rs create mode 100644 rust/src/models/environment_out.rs create mode 100644 rust/src/models/environment_settings_out.rs create mode 100644 rust/src/models/event_example_in.rs create mode 100644 rust/src/models/event_in.rs create mode 100644 rust/src/models/event_out.rs create mode 100644 rust/src/models/event_stream_out.rs create mode 100644 rust/src/models/event_type_example_out.rs create mode 100644 rust/src/models/event_type_from_open_api.rs create mode 100644 rust/src/models/event_type_import_open_api_in.rs create mode 100644 rust/src/models/event_type_import_open_api_out.rs create mode 100644 rust/src/models/event_type_import_open_api_out_data.rs create mode 100644 rust/src/models/event_type_in.rs create mode 100644 rust/src/models/event_type_out.rs create mode 100644 rust/src/models/event_type_patch.rs create mode 100644 rust/src/models/event_type_schema_in.rs create mode 100644 rust/src/models/event_type_update.rs create mode 100644 rust/src/models/export_event_type_out.rs create mode 100644 rust/src/models/font_size_config.rs create mode 100644 rust/src/models/generate_in.rs create mode 100644 rust/src/models/generate_out.rs create mode 100644 rust/src/models/google_cloud_storage_config.rs create mode 100644 rust/src/models/http_error_out.rs create mode 100644 rust/src/models/http_validation_error.rs create mode 100644 rust/src/models/hubspot_oauth_config_in.rs create mode 100644 rust/src/models/inbound_path_params.rs create mode 100644 rust/src/models/incoming_webhook_payload_out.rs create mode 100644 rust/src/models/integration_in.rs create mode 100644 rust/src/models/integration_key_out.rs create mode 100644 rust/src/models/integration_out.rs create mode 100644 rust/src/models/integration_update.rs create mode 100644 rust/src/models/kafka_security_protocol_type.rs create mode 100644 rust/src/models/list_response_application_out_.rs create mode 100644 rust/src/models/list_response_application_stats_.rs create mode 100644 rust/src/models/list_response_background_task_out_.rs create mode 100644 rust/src/models/list_response_endpoint_message_out_.rs create mode 100644 rust/src/models/list_response_endpoint_out_.rs create mode 100644 rust/src/models/list_response_event_type_out_.rs create mode 100644 rust/src/models/list_response_integration_out_.rs create mode 100644 rust/src/models/list_response_message_attempt_endpoint_out_.rs create mode 100644 rust/src/models/list_response_message_attempt_out_.rs create mode 100644 rust/src/models/list_response_message_endpoint_out_.rs create mode 100644 rust/src/models/list_response_message_out_.rs create mode 100644 rust/src/models/list_response_operational_webhook_endpoint_out_.rs create mode 100644 rust/src/models/list_response_sink_out_.rs create mode 100644 rust/src/models/list_response_stream_event_type_out_.rs create mode 100644 rust/src/models/list_response_stream_out_.rs create mode 100644 rust/src/models/list_response_stream_sink_out_.rs create mode 100644 rust/src/models/list_response_template_out_.rs create mode 100644 rust/src/models/message_attempt_endpoint_out.rs create mode 100644 rust/src/models/message_attempt_exhausted_event.rs create mode 100644 rust/src/models/message_attempt_exhausted_event_data.rs create mode 100644 rust/src/models/message_attempt_failed_data.rs create mode 100644 rust/src/models/message_attempt_failing_event.rs create mode 100644 rust/src/models/message_attempt_failing_event_data.rs create mode 100644 rust/src/models/message_attempt_headers_out.rs create mode 100644 rust/src/models/message_attempt_out.rs create mode 100644 rust/src/models/message_attempt_recovered_event.rs create mode 100644 rust/src/models/message_attempt_recovered_event_data.rs create mode 100644 rust/src/models/message_attempt_trigger_type.rs create mode 100644 rust/src/models/message_broadcast_in.rs create mode 100644 rust/src/models/message_broadcast_out.rs create mode 100644 rust/src/models/message_endpoint_out.rs create mode 100644 rust/src/models/message_events_out.rs create mode 100644 rust/src/models/message_in.rs create mode 100644 rust/src/models/message_out.rs create mode 100644 rust/src/models/message_raw_payload_out.rs create mode 100644 rust/src/models/message_status.rs create mode 100644 rust/src/models/message_subscriber_auth_token_out.rs create mode 100644 rust/src/models/mod.rs create mode 100644 rust/src/models/o_auth_payload_in.rs create mode 100644 rust/src/models/o_auth_payload_out.rs create mode 100644 rust/src/models/oauth2_auth_method_in.rs create mode 100644 rust/src/models/oauth2_grant_type_in.rs create mode 100644 rust/src/models/oauth_jws_signing_algorithm.rs create mode 100644 rust/src/models/one_time_token_in.rs create mode 100644 rust/src/models/one_time_token_out.rs create mode 100644 rust/src/models/operational_webhook_endpoint_in.rs create mode 100644 rust/src/models/operational_webhook_endpoint_out.rs create mode 100644 rust/src/models/operational_webhook_endpoint_secret_in.rs create mode 100644 rust/src/models/operational_webhook_endpoint_secret_out.rs create mode 100644 rust/src/models/operational_webhook_endpoint_update.rs create mode 100644 rust/src/models/ordering.rs create mode 100644 rust/src/models/recover_in.rs create mode 100644 rust/src/models/recover_out.rs create mode 100644 rust/src/models/redshift_config.rs create mode 100644 rust/src/models/replay_in.rs create mode 100644 rust/src/models/replay_out.rs create mode 100644 rust/src/models/retry_schedule_in_out.rs create mode 100644 rust/src/models/rotate_poller_token_in.rs create mode 100644 rust/src/models/rotated_url_out.rs create mode 100644 rust/src/models/s3_config.rs create mode 100644 rust/src/models/sink_http_config.rs create mode 100644 rust/src/models/sink_in.rs create mode 100644 rust/src/models/sink_in_one_of.rs create mode 100644 rust/src/models/sink_in_one_of_1.rs create mode 100644 rust/src/models/sink_in_one_of_2.rs create mode 100644 rust/src/models/sink_in_one_of_3.rs create mode 100644 rust/src/models/sink_in_one_of_4.rs create mode 100644 rust/src/models/sink_otel_v1_config.rs create mode 100644 rust/src/models/sink_out.rs create mode 100644 rust/src/models/sink_payload_format.rs create mode 100644 rust/src/models/sink_status.rs create mode 100644 rust/src/models/sink_status_in.rs create mode 100644 rust/src/models/sink_transform_in.rs create mode 100644 rust/src/models/sink_transformation_out.rs create mode 100644 rust/src/models/snowflake_config.rs create mode 100644 rust/src/models/statistics_period.rs create mode 100644 rust/src/models/status_code_class.rs create mode 100644 rust/src/models/stream_event_type_in.rs create mode 100644 rust/src/models/stream_event_type_out.rs create mode 100644 rust/src/models/stream_event_type_patch.rs create mode 100644 rust/src/models/stream_in.rs create mode 100644 rust/src/models/stream_out.rs create mode 100644 rust/src/models/stream_patch.rs create mode 100644 rust/src/models/stream_sink_in.rs create mode 100644 rust/src/models/stream_sink_in_one_of.rs create mode 100644 rust/src/models/stream_sink_in_one_of_1.rs create mode 100644 rust/src/models/stream_sink_in_one_of_2.rs create mode 100644 rust/src/models/stream_sink_in_one_of_3.rs create mode 100644 rust/src/models/stream_sink_in_one_of_4.rs create mode 100644 rust/src/models/stream_sink_in_one_of_5.rs create mode 100644 rust/src/models/stream_sink_in_one_of_6.rs create mode 100644 rust/src/models/stream_sink_in_one_of_7.rs create mode 100644 rust/src/models/stream_sink_out.rs create mode 100644 rust/src/models/stream_sink_patch.rs create mode 100644 rust/src/models/template_in.rs create mode 100644 rust/src/models/template_out.rs create mode 100644 rust/src/models/template_patch.rs create mode 100644 rust/src/models/template_update.rs create mode 100644 rust/src/models/transformation_http_method.rs create mode 100644 rust/src/models/transformation_simulate_in.rs create mode 100644 rust/src/models/transformation_simulate_out.rs create mode 100644 rust/src/models/transformation_template_kind.rs create mode 100644 rust/src/models/validation_error.rs diff --git a/regen_openapi.sh b/regen_openapi.sh index 2482513f5..296c4f427 100755 --- a/regen_openapi.sh +++ b/regen_openapi.sh @@ -46,6 +46,9 @@ yarn openapi-generator-cli generate -i openapi.json -g ruby -o ruby -c ruby/open yarn openapi-generator-cli generate -i openapi.json -g csharp -o csharp/ -c csharp/openapi-generator-config.json --global-property apis,models,supportingFiles,apiTests=false,apiDocs=false,modelTests=false,modelDocs=false +# Cleanup previous codegen, allowing us to spot removals. +# If the removals are expected, stage them eg. `git add -u`, then commit them. +rm -rf rust/src/{apis,models} yarn openapi-generator-cli generate -i rust/openapi.json -g rust -o rust/ -c rust/openapi-generator-config.json -t rust/templates echo Note: Python generation is not executed automatically. diff --git a/rust/.gitignore b/rust/.gitignore index 53e1e759c..dc357bdca 100644 --- a/rust/.gitignore +++ b/rust/.gitignore @@ -5,5 +5,3 @@ Cargo.lock /.openapi-generator/ /openapi.json -/src/apis/ -/src/models/ diff --git a/rust/src/apis/application_api.rs b/rust/src/apis/application_api.rs new file mode 100644 index 000000000..521c74356 --- /dev/null +++ b/rust/src/apis/application_api.rs @@ -0,0 +1,361 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`get_app_usage_stats_api_v1_app_stats_usage_get`] +#[derive(Clone, Debug)] +pub struct GetAppUsageStatsApiV1AppStatsUsageGetParams { + /// Filter the range to data after this date. + pub since: String, + /// Filter the range to data before this date. + pub until: String, + /// Limit the number of returned items. + pub limit: Option, + /// The iterator to use (depends on the chosen ordering). + pub iterator: Option +} + +/// struct for passing parameters to the method [`v1_period_application_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodApplicationPeriodCreateParams { + pub application_in: models::ApplicationIn, + /// Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. + pub get_if_exists: Option, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_application_period_delete`] +#[derive(Clone, Debug)] +pub struct V1PeriodApplicationPeriodDeleteParams { + /// The app's ID or UID + pub app_id: String +} + +/// struct for passing parameters to the method [`v1_period_application_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodApplicationPeriodGetParams { + /// The app's ID or UID + pub app_id: String +} + +/// struct for passing parameters to the method [`v1_period_application_period_get_stats`] +#[derive(Clone, Debug)] +pub struct V1PeriodApplicationPeriodGetStatsParams { + /// Filter the range to data starting from this date. + pub since: String, + /// Filter the range to data ending by this date. + pub until: String, + /// The app's ID or UID + pub app_id: String +} + +/// struct for passing parameters to the method [`v1_period_application_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodApplicationPeriodListParams { + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + +/// struct for passing parameters to the method [`v1_period_application_period_patch`] +#[derive(Clone, Debug)] +pub struct V1PeriodApplicationPeriodPatchParams { + /// The app's ID or UID + pub app_id: String, + pub application_patch: models::ApplicationPatch +} + +/// struct for passing parameters to the method [`v1_period_application_period_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodApplicationPeriodUpdateParams { + /// The app's ID or UID + pub app_id: String, + pub application_in: models::ApplicationIn +} + + +/// struct for typed errors of method [`get_app_usage_stats_api_v1_app_stats_usage_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAppUsageStatsApiV1AppStatsUsageGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_application_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodApplicationPeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_application_period_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodApplicationPeriodDeleteError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_application_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodApplicationPeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_application_period_get_stats`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodApplicationPeriodGetStatsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_application_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodApplicationPeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_application_period_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodApplicationPeriodPatchError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_application_period_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodApplicationPeriodUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Get basic statistics for all applications. +pub async fn get_app_usage_stats_api_v1_app_stats_usage_get(configuration: &Configuration, params: GetAppUsageStatsApiV1AppStatsUsageGetParams) -> Result { + // unbox the parameters + let since = params.since; + let until = params.until; + let limit = params.limit; + let iterator = params.iterator; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/stats/usage".to_string()) + ; + req = req.with_query_param("since".to_string(), since.to_string()); + req = req.with_query_param("until".to_string(), until.to_string()); + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + + req.execute(configuration).await +} + +/// Create a new application. +pub async fn v1_period_application_period_create(configuration: &Configuration, params: V1PeriodApplicationPeriodCreateParams) -> Result { + // unbox the parameters + let application_in = params.application_in; + let get_if_exists = params.get_if_exists; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app".to_string()) + ; + if let Some(ref s) = get_if_exists { + let query_value = s.to_string(); + req = req.with_query_param("get_if_exists".to_string(), query_value); + } + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(application_in); + + req.execute(configuration).await +} + +/// Delete an application. +pub async fn v1_period_application_period_delete(configuration: &Configuration, params: V1PeriodApplicationPeriodDeleteParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Get an application. +pub async fn v1_period_application_period_get(configuration: &Configuration, params: V1PeriodApplicationPeriodGetParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + +/// Get basic statistics for the application. +pub async fn v1_period_application_period_get_stats(configuration: &Configuration, params: V1PeriodApplicationPeriodGetStatsParams) -> Result { + // unbox the parameters + let since = params.since; + let until = params.until; + let app_id = params.app_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/stats".to_string()) + ; + req = req.with_query_param("since".to_string(), since.to_string()); + req = req.with_query_param("until".to_string(), until.to_string()); + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + +/// List of all the organization's applications. +pub async fn v1_period_application_period_list(configuration: &Configuration, params: V1PeriodApplicationPeriodListParams) -> Result { + // unbox the parameters + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + + req.execute(configuration).await +} + +/// Partially update an application. +pub async fn v1_period_application_period_patch(configuration: &Configuration, params: V1PeriodApplicationPeriodPatchParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let application_patch = params.application_patch; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/app/{app_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_body_param(application_patch); + + req.execute(configuration).await +} + +/// Update an application. +pub async fn v1_period_application_period_update(configuration: &Configuration, params: V1PeriodApplicationPeriodUpdateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let application_in = params.application_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_body_param(application_in); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/authentication_api.rs b/rust/src/apis/authentication_api.rs new file mode 100644 index 000000000..909be2f07 --- /dev/null +++ b/rust/src/apis/authentication_api.rs @@ -0,0 +1,358 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_authentication_period_app_portal_access`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodAppPortalAccessParams { + /// The app's ID or UID + pub app_id: String, + pub app_portal_access_in: models::AppPortalAccessIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_authentication_period_create_message_token`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodCreateMessageTokenParams { + /// The app's ID or UID + pub app_id: String, + pub create_token_in: models::CreateTokenIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_authentication_period_dashboard_access`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodDashboardAccessParams { + /// The app's ID or UID + pub app_id: String, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_authentication_period_exchange_one_time_token`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodExchangeOneTimeTokenParams { + pub one_time_token_in: models::OneTimeTokenIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_authentication_period_expire_all`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodExpireAllParams { + /// The app's ID or UID + pub app_id: String, + pub application_token_expire_in: models::ApplicationTokenExpireIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_authentication_period_get_poller_token`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodGetPollerTokenParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_authentication_period_logout`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodLogoutParams { + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_authentication_period_rotate_poller_token`] +#[derive(Clone, Debug)] +pub struct V1PeriodAuthenticationPeriodRotatePollerTokenParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub rotate_poller_token_in: models::RotatePollerTokenIn, + /// The request's idempotency key + pub idempotency_key: Option +} + + +/// struct for typed errors of method [`v1_period_authentication_period_app_portal_access`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodAppPortalAccessError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_authentication_period_create_message_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodCreateMessageTokenError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_authentication_period_dashboard_access`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodDashboardAccessError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_authentication_period_exchange_one_time_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodExchangeOneTimeTokenError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_authentication_period_expire_all`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodExpireAllError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_authentication_period_get_poller_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodGetPollerTokenError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_authentication_period_logout`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodLogoutError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_authentication_period_rotate_poller_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodAuthenticationPeriodRotatePollerTokenError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. +pub async fn v1_period_authentication_period_app_portal_access(configuration: &Configuration, params: V1PeriodAuthenticationPeriodAppPortalAccessParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let app_portal_access_in = params.app_portal_access_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/auth/app-portal-access/{app_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(app_portal_access_in); + + req.execute(configuration).await +} + +/// Create a new access token that only allows creating messages inside this application. +pub async fn v1_period_authentication_period_create_message_token(configuration: &Configuration, params: V1PeriodAuthenticationPeriodCreateMessageTokenParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let create_token_in = params.create_token_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/auth/app/{app_id}/create-message-token".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(create_token_in); + + req.execute(configuration).await +} + +/// DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. +pub async fn v1_period_authentication_period_dashboard_access(configuration: &Configuration, params: V1PeriodAuthenticationPeriodDashboardAccessParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/auth/dashboard-access/{app_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + + req.execute(configuration).await +} + +/// This is a one time token. +pub async fn v1_period_authentication_period_exchange_one_time_token(configuration: &Configuration, params: V1PeriodAuthenticationPeriodExchangeOneTimeTokenParams) -> Result { + // unbox the parameters + let one_time_token_in = params.one_time_token_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/auth/one-time-token".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(one_time_token_in); + + req.execute(configuration).await +} + +/// Expire all of the tokens associated with a specific application. +pub async fn v1_period_authentication_period_expire_all(configuration: &Configuration, params: V1PeriodAuthenticationPeriodExpireAllParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let application_token_expire_in = params.application_token_expire_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/auth/app/{app_id}/expire-all".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(application_token_expire_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Get the current auth token for the poller. +pub async fn v1_period_authentication_period_get_poller_token(configuration: &Configuration, params: V1PeriodAuthenticationPeriodGetPollerTokenParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// Logout an app token. Trying to log out other tokens will fail. +pub async fn v1_period_authentication_period_logout(configuration: &Configuration, params: V1PeriodAuthenticationPeriodLogoutParams) -> Result<(), Error> { + // unbox the parameters + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/auth/logout".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Create a new auth token that can for the poller API. +pub async fn v1_period_authentication_period_rotate_poller_token(configuration: &Configuration, params: V1PeriodAuthenticationPeriodRotatePollerTokenParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let rotate_poller_token_in = params.rotate_poller_token_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token/rotate".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(rotate_poller_token_in); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/background_tasks_api.rs b/rust/src/apis/background_tasks_api.rs new file mode 100644 index 000000000..a49b15c21 --- /dev/null +++ b/rust/src/apis/background_tasks_api.rs @@ -0,0 +1,119 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`get_background_task`] +#[derive(Clone, Debug)] +pub struct GetBackgroundTaskParams { + pub task_id: String +} + +/// struct for passing parameters to the method [`list_background_tasks`] +#[derive(Clone, Debug)] +pub struct ListBackgroundTasksParams { + /// Filter the response based on the status. + pub status: Option, + /// Filter the response based on the type. + pub task: Option, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + + +/// struct for typed errors of method [`get_background_task`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBackgroundTaskError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_background_tasks`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBackgroundTasksError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Get a background task by ID. +pub async fn get_background_task(configuration: &Configuration, params: GetBackgroundTaskParams) -> Result { + // unbox the parameters + let task_id = params.task_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/background-task/{task_id}".to_string()) + ; + req = req.with_path_param("task_id".to_string(), task_id.to_string()); + + req.execute(configuration).await +} + +/// List background tasks executed in the past 90 days. +pub async fn list_background_tasks(configuration: &Configuration, params: ListBackgroundTasksParams) -> Result { + // unbox the parameters + let status = params.status; + let task = params.task; + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/background-task".to_string()) + ; + if let Some(ref s) = status { + let query_value = s.to_string(); + req = req.with_query_param("status".to_string(), query_value); + } + if let Some(ref s) = task { + let query_value = s.to_string(); + req = req.with_query_param("task".to_string(), query_value); + } + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + + req.execute(configuration).await +} + diff --git a/rust/src/apis/broadcast_api.rs b/rust/src/apis/broadcast_api.rs new file mode 100644 index 000000000..c3820f174 --- /dev/null +++ b/rust/src/apis/broadcast_api.rs @@ -0,0 +1,59 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`create_broadcast_message`] +#[derive(Clone, Debug)] +pub struct CreateBroadcastMessageParams { + pub message_broadcast_in: models::MessageBroadcastIn, + /// The request's idempotency key + pub idempotency_key: Option +} + + +/// struct for typed errors of method [`create_broadcast_message`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateBroadcastMessageError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Creates a background task to send the same message to each application in your organization. +pub async fn create_broadcast_message(configuration: &Configuration, params: CreateBroadcastMessageParams) -> Result { + // unbox the parameters + let message_broadcast_in = params.message_broadcast_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/msg/broadcast".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(message_broadcast_in); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/endpoint_api.rs b/rust/src/apis/endpoint_api.rs new file mode 100644 index 000000000..4c1c0d28f --- /dev/null +++ b/rust/src/apis/endpoint_api.rs @@ -0,0 +1,1127 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_endpoint_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodCreateParams { + /// The app's ID or UID + pub app_id: String, + pub endpoint_in: models::EndpointIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_delete`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodDeleteParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_delete_mtls_config`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodDeleteMtlsConfigParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_delete_oauth_config`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodDeleteOauthConfigParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodGetParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_get_headers`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodGetHeadersParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_get_secret`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodGetSecretParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_get_stats`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodGetStatsParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + /// Filter the range to data starting from this date. + pub since: Option, + /// Filter the range to data ending by this date. + pub until: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodListParams { + /// The app's ID or UID + pub app_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_patch`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodPatchParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_patch: models::EndpointPatch +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_patch_headers`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodPatchHeadersParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_headers_patch_in: models::EndpointHeadersPatchIn +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_recover`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodRecoverParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub recover_in: models::RecoverIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_replay_missing`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodReplayMissingParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub replay_in: models::ReplayIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_rotate_secret`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodRotateSecretParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_secret_rotate_in: models::EndpointSecretRotateIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_send_example`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodSendExampleParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub event_example_in: models::EventExampleIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_transformation_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodTransformationGetParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_transformation_partial_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodTransformationPartialUpdateParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_transformation_in: models::EndpointTransformationIn +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_transformation_simulate`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodTransformationSimulateParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_transformation_simulate_in: models::EndpointTransformationSimulateIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodUpdateParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_update: models::EndpointUpdate +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_update_headers`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodUpdateHeadersParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_headers_in: models::EndpointHeadersIn +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_update_mtls_config`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodUpdateMtlsConfigParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_mtls_config_in: models::EndpointMtlsConfigIn +} + +/// struct for passing parameters to the method [`v1_period_endpoint_period_update_oauth_config`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodUpdateOauthConfigParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub endpoint_oauth_config_in: models::EndpointOauthConfigIn +} + +/// struct for passing parameters to the method [`v1_period_sink_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodSinkPeriodCreateParams { + /// The app's ID or UID + pub app_id: String, + pub sink_in: models::SinkIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_sink_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodSinkPeriodGetParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub sink_id: String +} + +/// struct for passing parameters to the method [`v1_period_sink_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodSinkPeriodListParams { + /// The app's ID or UID + pub app_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + + +/// struct for typed errors of method [`v1_period_endpoint_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodDeleteError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_delete_mtls_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodDeleteMtlsConfigError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_delete_oauth_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodDeleteOauthConfigError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_get_headers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodGetHeadersError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_get_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodGetSecretError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_get_stats`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodGetStatsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodPatchError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_patch_headers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodPatchHeadersError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_recover`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodRecoverError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_replay_missing`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodReplayMissingError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_rotate_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodRotateSecretError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_send_example`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodSendExampleError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_transformation_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodTransformationGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_transformation_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodTransformationPartialUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_transformation_simulate`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodTransformationSimulateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_update_headers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodUpdateHeadersError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_update_mtls_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodUpdateMtlsConfigError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_endpoint_period_update_oauth_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodUpdateOauthConfigError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_sink_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodSinkPeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_sink_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodSinkPeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_sink_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodSinkPeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Create a new endpoint for the application. When `secret` is `null` the secret is automatically generated (recommended). +pub async fn v1_period_endpoint_period_create(configuration: &Configuration, params: V1PeriodEndpointPeriodCreateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_in = params.endpoint_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(endpoint_in); + + req.execute(configuration).await +} + +/// Delete an endpoint. +pub async fn v1_period_endpoint_period_delete(configuration: &Configuration, params: V1PeriodEndpointPeriodDeleteParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}/endpoint/{endpoint_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Delete endpoint mTLS configuration. +pub async fn v1_period_endpoint_period_delete_mtls_config(configuration: &Configuration, params: V1PeriodEndpointPeriodDeleteMtlsConfigParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Delete endpoint OAuth configuration. +pub async fn v1_period_endpoint_period_delete_oauth_config(configuration: &Configuration, params: V1PeriodEndpointPeriodDeleteOauthConfigParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Get an endpoint. +pub async fn v1_period_endpoint_period_get(configuration: &Configuration, params: V1PeriodEndpointPeriodGetParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// Get the additional headers to be sent with the webhook. +pub async fn v1_period_endpoint_period_get_headers(configuration: &Configuration, params: V1PeriodEndpointPeriodGetHeadersParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// Get the endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). +pub async fn v1_period_endpoint_period_get_secret(configuration: &Configuration, params: V1PeriodEndpointPeriodGetSecretParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// Get basic statistics for the endpoint. +pub async fn v1_period_endpoint_period_get_stats(configuration: &Configuration, params: V1PeriodEndpointPeriodGetStatsParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let since = params.since; + let until = params.until; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats".to_string()) + ; + if let Some(ref s) = since { + let query_value = s.to_string(); + req = req.with_query_param("since".to_string(), query_value); + } + if let Some(ref s) = until { + let query_value = s.to_string(); + req = req.with_query_param("until".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// List the application's endpoints. +pub async fn v1_period_endpoint_period_list(configuration: &Configuration, params: V1PeriodEndpointPeriodListParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + +/// Partially update an endpoint. +pub async fn v1_period_endpoint_period_patch(configuration: &Configuration, params: V1PeriodEndpointPeriodPatchParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_patch = params.endpoint_patch; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/app/{app_id}/endpoint/{endpoint_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(endpoint_patch); + + req.execute(configuration).await +} + +/// Partially set the additional headers to be sent with the webhook. +pub async fn v1_period_endpoint_period_patch_headers(configuration: &Configuration, params: V1PeriodEndpointPeriodPatchHeadersParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_headers_patch_in = params.endpoint_headers_patch_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(endpoint_headers_patch_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Resend all failed messages since a given time. Messages that were sent successfully, even if failed initially, are not resent. +pub async fn v1_period_endpoint_period_recover(configuration: &Configuration, params: V1PeriodEndpointPeriodRecoverParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let recover_in = params.recover_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(recover_in); + + req.execute(configuration).await +} + +/// Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent. +pub async fn v1_period_endpoint_period_replay_missing(configuration: &Configuration, params: V1PeriodEndpointPeriodReplayMissingParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let replay_in = params.replay_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(replay_in); + + req.execute(configuration).await +} + +/// Rotates the endpoint's signing secret. The previous secret will remain valid for the next 24 hours. +pub async fn v1_period_endpoint_period_rotate_secret(configuration: &Configuration, params: V1PeriodEndpointPeriodRotateSecretParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_secret_rotate_in = params.endpoint_secret_rotate_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(endpoint_secret_rotate_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Send an example message for an event. +pub async fn v1_period_endpoint_period_send_example(configuration: &Configuration, params: V1PeriodEndpointPeriodSendExampleParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let event_example_in = params.event_example_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(event_example_in); + + req.execute(configuration).await +} + +/// Get the transformation code associated with this endpoint. +pub async fn v1_period_endpoint_period_transformation_get(configuration: &Configuration, params: V1PeriodEndpointPeriodTransformationGetParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// Set or unset the transformation code associated with this endpoint. +pub async fn v1_period_endpoint_period_transformation_partial_update(configuration: &Configuration, params: V1PeriodEndpointPeriodTransformationPartialUpdateParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_transformation_in = params.endpoint_transformation_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(endpoint_transformation_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Simulate running the transformation on the payload and code. +pub async fn v1_period_endpoint_period_transformation_simulate(configuration: &Configuration, params: V1PeriodEndpointPeriodTransformationSimulateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_transformation_simulate_in = params.endpoint_transformation_simulate_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(endpoint_transformation_simulate_in); + + req.execute(configuration).await +} + +/// Update an endpoint. +pub async fn v1_period_endpoint_period_update(configuration: &Configuration, params: V1PeriodEndpointPeriodUpdateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_update = params.endpoint_update; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}/endpoint/{endpoint_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(endpoint_update); + + req.execute(configuration).await +} + +/// Set the additional headers to be sent with the webhook. +pub async fn v1_period_endpoint_period_update_headers(configuration: &Configuration, params: V1PeriodEndpointPeriodUpdateHeadersParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_headers_in = params.endpoint_headers_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(endpoint_headers_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Create/update endpoint mTLS configuration. +pub async fn v1_period_endpoint_period_update_mtls_config(configuration: &Configuration, params: V1PeriodEndpointPeriodUpdateMtlsConfigParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_mtls_config_in = params.endpoint_mtls_config_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(endpoint_mtls_config_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Create/update endpoint OAuth configuration. +pub async fn v1_period_endpoint_period_update_oauth_config(configuration: &Configuration, params: V1PeriodEndpointPeriodUpdateOauthConfigParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let endpoint_oauth_config_in = params.endpoint_oauth_config_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(endpoint_oauth_config_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Create a new sink for the application. +pub async fn v1_period_sink_period_create(configuration: &Configuration, params: V1PeriodSinkPeriodCreateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let sink_in = params.sink_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/sink".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(sink_in); + + req.execute(configuration).await +} + +/// Get a sink. +pub async fn v1_period_sink_period_get(configuration: &Configuration, params: V1PeriodSinkPeriodGetParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let sink_id = params.sink_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/sink/{sink_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("sink_id".to_string(), sink_id.to_string()); + + req.execute(configuration).await +} + +/// List the application's sinks. +pub async fn v1_period_sink_period_list(configuration: &Configuration, params: V1PeriodSinkPeriodListParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/sink".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/environment_api.rs b/rust/src/apis/environment_api.rs new file mode 100644 index 000000000..174f49d82 --- /dev/null +++ b/rust/src/apis/environment_api.rs @@ -0,0 +1,97 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_environment_period_export`] +#[derive(Clone, Debug)] +pub struct V1PeriodEnvironmentPeriodExportParams { + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_environment_period_import`] +#[derive(Clone, Debug)] +pub struct V1PeriodEnvironmentPeriodImportParams { + pub environment_in: models::EnvironmentIn, + /// The request's idempotency key + pub idempotency_key: Option +} + + +/// struct for typed errors of method [`v1_period_environment_period_export`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEnvironmentPeriodExportError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_environment_period_import`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEnvironmentPeriodImportError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Download a JSON file containing all org-settings and event types. +pub async fn v1_period_environment_period_export(configuration: &Configuration, params: V1PeriodEnvironmentPeriodExportParams) -> Result { + // unbox the parameters + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/environment/export".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + + req.execute(configuration).await +} + +/// Import a configuration into the active organization. It doesn't delete anything, only adds/updates what was passed to it. +pub async fn v1_period_environment_period_import(configuration: &Configuration, params: V1PeriodEnvironmentPeriodImportParams) -> Result<(), Error> { + // unbox the parameters + let environment_in = params.environment_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/environment/import".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(environment_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/environment_settings_api.rs b/rust/src/apis/environment_settings_api.rs new file mode 100644 index 000000000..f43d1474e --- /dev/null +++ b/rust/src/apis/environment_settings_api.rs @@ -0,0 +1,45 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + + +/// struct for typed errors of method [`v1_period_environment_period_get_settings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEnvironmentPeriodGetSettingsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Get the environment's settings. +pub async fn v1_period_environment_period_get_settings(configuration: &Configuration) -> Result { + // unbox the parameters + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/environment/settings".to_string()) + ; + + req.execute(configuration).await +} + diff --git a/rust/src/apis/event_type_api.rs b/rust/src/apis/event_type_api.rs new file mode 100644 index 000000000..224d21d11 --- /dev/null +++ b/rust/src/apis/event_type_api.rs @@ -0,0 +1,470 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_event_type_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodCreateParams { + pub event_type_in: models::EventTypeIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_delete`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodDeleteParams { + /// The event type's name + pub event_type_name: String, + /// By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. + pub expunge: Option +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_export_openapi`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodExportOpenapiParams { + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_generate_example`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodGenerateExampleParams { + pub event_type_schema_in: models::EventTypeSchemaIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodGetParams { + /// The event type's name + pub event_type_name: String +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_get_retry_schedule`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodGetRetryScheduleParams { + /// The event type's name + pub event_type_name: String +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_import_openapi`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodImportOpenapiParams { + /// Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. + pub event_type_import_open_api_in: models::EventTypeImportOpenApiIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodListParams { + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option, + /// When `true` archived (deleted but not expunged) items are included in the response. + pub include_archived: Option, + /// When `true` the full item (including the schema) is included in the response. + pub with_content: Option +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_patch`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodPatchParams { + /// The event type's name + pub event_type_name: String, + pub event_type_patch: models::EventTypePatch +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodUpdateParams { + /// The event type's name + pub event_type_name: String, + pub event_type_update: models::EventTypeUpdate +} + +/// struct for passing parameters to the method [`v1_period_event_type_period_update_retry_schedule`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventTypePeriodUpdateRetryScheduleParams { + /// The event type's name + pub event_type_name: String, + pub retry_schedule_in_out: models::RetryScheduleInOut +} + + +/// struct for typed errors of method [`v1_period_event_type_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodDeleteError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_export_openapi`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodExportOpenapiError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_generate_example`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodGenerateExampleError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_get_retry_schedule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodGetRetryScheduleError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_import_openapi`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodImportOpenapiError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodPatchError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_event_type_period_update_retry_schedule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventTypePeriodUpdateRetryScheduleError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Create new or unarchive existing event type. Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas. +pub async fn v1_period_event_type_period_create(configuration: &Configuration, params: V1PeriodEventTypePeriodCreateParams) -> Result { + // unbox the parameters + let event_type_in = params.event_type_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/event-type".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(event_type_in); + + req.execute(configuration).await +} + +/// Archive an event type. Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post). +pub async fn v1_period_event_type_period_delete(configuration: &Configuration, params: V1PeriodEventTypePeriodDeleteParams) -> Result<(), Error> { + // unbox the parameters + let event_type_name = params.event_type_name; + let expunge = params.expunge; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/event-type/{event_type_name}".to_string()) + ; + if let Some(ref s) = expunge { + let query_value = s.to_string(); + req = req.with_query_param("expunge".to_string(), query_value); + } + req = req.with_path_param("event_type_name".to_string(), event_type_name.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Exports event type definitions based on the OpenAPI schemas associated with each existing event type. +pub async fn v1_period_event_type_period_export_openapi(configuration: &Configuration, params: V1PeriodEventTypePeriodExportOpenapiParams) -> Result { + // unbox the parameters + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/event-type/export/openapi".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + + req.execute(configuration).await +} + +/// Generates a fake example from the given JSONSchema. +pub async fn v1_period_event_type_period_generate_example(configuration: &Configuration, params: V1PeriodEventTypePeriodGenerateExampleParams) -> Result { + // unbox the parameters + let event_type_schema_in = params.event_type_schema_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/event-type/schema/generate-example".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(event_type_schema_in); + + req.execute(configuration).await +} + +/// Get an event type. +pub async fn v1_period_event_type_period_get(configuration: &Configuration, params: V1PeriodEventTypePeriodGetParams) -> Result { + // unbox the parameters + let event_type_name = params.event_type_name; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/event-type/{event_type_name}".to_string()) + ; + req = req.with_path_param("event_type_name".to_string(), event_type_name.to_string()); + + req.execute(configuration).await +} + +/// Gets the retry schedule for messages using the given event type. +pub async fn v1_period_event_type_period_get_retry_schedule(configuration: &Configuration, params: V1PeriodEventTypePeriodGetRetryScheduleParams) -> Result { + // unbox the parameters + let event_type_name = params.event_type_name; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/event-type/{event_type_name}/retry-schedule".to_string()) + ; + req = req.with_path_param("event_type_name".to_string(), event_type_name.to_string()); + + req.execute(configuration).await +} + +/// Given an OpenAPI spec, create new or update existing event types. If an existing `archived` event type is updated, it will be unarchived. The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` top-level. +pub async fn v1_period_event_type_period_import_openapi(configuration: &Configuration, params: V1PeriodEventTypePeriodImportOpenapiParams) -> Result { + // unbox the parameters + let event_type_import_open_api_in = params.event_type_import_open_api_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/event-type/import/openapi".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(event_type_import_open_api_in); + + req.execute(configuration).await +} + +/// Return the list of event types. +pub async fn v1_period_event_type_period_list(configuration: &Configuration, params: V1PeriodEventTypePeriodListParams) -> Result { + // unbox the parameters + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + let include_archived = params.include_archived; + let with_content = params.with_content; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/event-type".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + if let Some(ref s) = include_archived { + let query_value = s.to_string(); + req = req.with_query_param("include_archived".to_string(), query_value); + } + if let Some(ref s) = with_content { + let query_value = s.to_string(); + req = req.with_query_param("with_content".to_string(), query_value); + } + + req.execute(configuration).await +} + +/// Partially update an event type. +pub async fn v1_period_event_type_period_patch(configuration: &Configuration, params: V1PeriodEventTypePeriodPatchParams) -> Result { + // unbox the parameters + let event_type_name = params.event_type_name; + let event_type_patch = params.event_type_patch; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/event-type/{event_type_name}".to_string()) + ; + req = req.with_path_param("event_type_name".to_string(), event_type_name.to_string()); + req = req.with_body_param(event_type_patch); + + req.execute(configuration).await +} + +/// Update an event type. +pub async fn v1_period_event_type_period_update(configuration: &Configuration, params: V1PeriodEventTypePeriodUpdateParams) -> Result { + // unbox the parameters + let event_type_name = params.event_type_name; + let event_type_update = params.event_type_update; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/event-type/{event_type_name}".to_string()) + ; + req = req.with_path_param("event_type_name".to_string(), event_type_name.to_string()); + req = req.with_body_param(event_type_update); + + req.execute(configuration).await +} + +/// Sets a retry schedule for all messages using the given event type. +pub async fn v1_period_event_type_period_update_retry_schedule(configuration: &Configuration, params: V1PeriodEventTypePeriodUpdateRetryScheduleParams) -> Result { + // unbox the parameters + let event_type_name = params.event_type_name; + let retry_schedule_in_out = params.retry_schedule_in_out; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/event-type/{event_type_name}/retry-schedule".to_string()) + ; + req = req.with_path_param("event_type_name".to_string(), event_type_name.to_string()); + req = req.with_body_param(retry_schedule_in_out); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/events_api.rs b/rust/src/apis/events_api.rs new file mode 100644 index 000000000..a099560bc --- /dev/null +++ b/rust/src/apis/events_api.rs @@ -0,0 +1,84 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_events`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventsParams { + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the event type + pub event_types: Option>, + /// Filter response based on the event type. + pub channels: Option>, + pub after: Option +} + + +/// struct for typed errors of method [`v1_period_events`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Reads the stream of operational webhook events for this environment. +pub async fn v1_period_events(configuration: &Configuration, params: V1PeriodEventsParams) -> Result { + // unbox the parameters + let limit = params.limit; + let iterator = params.iterator; + let event_types = params.event_types; + let channels = params.channels; + let after = params.after; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/events".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + if let Some(ref s) = channels { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("channels".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + + req.execute(configuration).await +} + diff --git a/rust/src/apis/health_api.rs b/rust/src/apis/health_api.rs new file mode 100644 index 000000000..f339772f5 --- /dev/null +++ b/rust/src/apis/health_api.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + + +/// struct for typed errors of method [`v1_period_health_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodHealthPeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Verify the API server is up and running. +pub async fn v1_period_health_period_get(configuration: &Configuration) -> Result<(), Error> { + // unbox the parameters + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/health".to_string()) + ; + req = req.returns_nothing(); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/inbound_api.rs b/rust/src/apis/inbound_api.rs new file mode 100644 index 000000000..9034735be --- /dev/null +++ b/rust/src/apis/inbound_api.rs @@ -0,0 +1,114 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_inbound_period_msg`] +#[derive(Clone, Debug)] +pub struct V1PeriodInboundPeriodMsgParams { + /// The app's ID or UID + pub app_id: String, + pub inbound_token: String, + pub body: String, + /// The event type's name + pub event_type: Option, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_inbound_period_rotate_url`] +#[derive(Clone, Debug)] +pub struct V1PeriodInboundPeriodRotateUrlParams { + /// The app's ID or UID + pub app_id: String, + /// The request's idempotency key + pub idempotency_key: Option +} + + +/// struct for typed errors of method [`v1_period_inbound_period_msg`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodInboundPeriodMsgError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_inbound_period_rotate_url`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodInboundPeriodRotateUrlError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Handles a raw inbound webhook for the application. +pub async fn v1_period_inbound_period_msg(configuration: &Configuration, params: V1PeriodInboundPeriodMsgParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let inbound_token = params.inbound_token; + let body = params.body; + let event_type = params.event_type; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/inbound/msg/{inbound_token}".to_string()) + ; + if let Some(ref s) = event_type { + let query_value = s.to_string(); + req = req.with_query_param("event_type".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("inbound_token".to_string(), inbound_token.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(body); + + req.execute(configuration).await +} + +/// Invalidates the previous inbound url (if one exists), producing a new inbound URL for this app. +pub async fn v1_period_inbound_period_rotate_url(configuration: &Configuration, params: V1PeriodInboundPeriodRotateUrlParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/inbound/rotate-url".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + + req.execute(configuration).await +} + diff --git a/rust/src/apis/integration_api.rs b/rust/src/apis/integration_api.rs new file mode 100644 index 000000000..adb5a6d75 --- /dev/null +++ b/rust/src/apis/integration_api.rs @@ -0,0 +1,324 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_integration_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodIntegrationPeriodCreateParams { + /// The app's ID or UID + pub app_id: String, + pub integration_in: models::IntegrationIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_integration_period_delete`] +#[derive(Clone, Debug)] +pub struct V1PeriodIntegrationPeriodDeleteParams { + /// The app's ID or UID + pub app_id: String, + /// The integ's ID + pub integ_id: String +} + +/// struct for passing parameters to the method [`v1_period_integration_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodIntegrationPeriodGetParams { + /// The app's ID or UID + pub app_id: String, + /// The integ's ID + pub integ_id: String +} + +/// struct for passing parameters to the method [`v1_period_integration_period_get_key`] +#[derive(Clone, Debug)] +pub struct V1PeriodIntegrationPeriodGetKeyParams { + /// The app's ID or UID + pub app_id: String, + /// The integ's ID + pub integ_id: String +} + +/// struct for passing parameters to the method [`v1_period_integration_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodIntegrationPeriodListParams { + /// The app's ID or UID + pub app_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + +/// struct for passing parameters to the method [`v1_period_integration_period_rotate_key`] +#[derive(Clone, Debug)] +pub struct V1PeriodIntegrationPeriodRotateKeyParams { + /// The app's ID or UID + pub app_id: String, + /// The integ's ID + pub integ_id: String, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_integration_period_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodIntegrationPeriodUpdateParams { + /// The app's ID or UID + pub app_id: String, + /// The integ's ID + pub integ_id: String, + pub integration_update: models::IntegrationUpdate +} + + +/// struct for typed errors of method [`v1_period_integration_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodIntegrationPeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_integration_period_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodIntegrationPeriodDeleteError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_integration_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodIntegrationPeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_integration_period_get_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodIntegrationPeriodGetKeyError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_integration_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodIntegrationPeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_integration_period_rotate_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodIntegrationPeriodRotateKeyError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_integration_period_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodIntegrationPeriodUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Create an integration. +pub async fn v1_period_integration_period_create(configuration: &Configuration, params: V1PeriodIntegrationPeriodCreateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let integration_in = params.integration_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/integration".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(integration_in); + + req.execute(configuration).await +} + +/// Delete an integration. +pub async fn v1_period_integration_period_delete(configuration: &Configuration, params: V1PeriodIntegrationPeriodDeleteParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let integ_id = params.integ_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}/integration/{integ_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("integ_id".to_string(), integ_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Get an integration. +pub async fn v1_period_integration_period_get(configuration: &Configuration, params: V1PeriodIntegrationPeriodGetParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let integ_id = params.integ_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/integration/{integ_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("integ_id".to_string(), integ_id.to_string()); + + req.execute(configuration).await +} + +/// Get an integration's key. +pub async fn v1_period_integration_period_get_key(configuration: &Configuration, params: V1PeriodIntegrationPeriodGetKeyParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let integ_id = params.integ_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/integration/{integ_id}/key".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("integ_id".to_string(), integ_id.to_string()); + + req.execute(configuration).await +} + +/// List the application's integrations. +pub async fn v1_period_integration_period_list(configuration: &Configuration, params: V1PeriodIntegrationPeriodListParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/integration".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + +/// Rotate the integration's key. The previous key will be immediately revoked. +pub async fn v1_period_integration_period_rotate_key(configuration: &Configuration, params: V1PeriodIntegrationPeriodRotateKeyParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let integ_id = params.integ_id; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/integration/{integ_id}/key/rotate".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("integ_id".to_string(), integ_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + + req.execute(configuration).await +} + +/// Update an integration. +pub async fn v1_period_integration_period_update(configuration: &Configuration, params: V1PeriodIntegrationPeriodUpdateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let integ_id = params.integ_id; + let integration_update = params.integration_update; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}/integration/{integ_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("integ_id".to_string(), integ_id.to_string()); + req = req.with_body_param(integration_update); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/message_api.rs b/rust/src/apis/message_api.rs new file mode 100644 index 000000000..c35ee6777 --- /dev/null +++ b/rust/src/apis/message_api.rs @@ -0,0 +1,595 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`create_message_attempt_for_endpoint`] +#[derive(Clone, Debug)] +pub struct CreateMessageAttemptForEndpointParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub message_in: models::MessageIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_events_public`] +#[derive(Clone, Debug)] +pub struct V1PeriodEventsPublicParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub sink_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filters messages sent with this event type (optional). + pub event_type: Option, + /// Filters messages sent with this channel (optional). + pub channel: Option, + pub after: Option +} + +/// struct for passing parameters to the method [`v1_period_message_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodCreateParams { + /// The app's ID or UID + pub app_id: String, + pub message_in: models::MessageIn, + /// When `true`, message payloads are included in the response. + pub with_content: Option, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_message_period_events`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodEventsParams { + /// The app's ID or UID + pub app_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the event type + pub event_types: Option>, + /// Filter response based on the event type. + pub channels: Option>, + pub after: Option +} + +/// struct for passing parameters to the method [`v1_period_message_period_events_subscription`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodEventsSubscriptionParams { + /// The app's ID or UID + pub app_id: String, + /// The esub's ID or UID + pub subscription_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the event type + pub event_types: Option>, + /// Filter response based on the event type. + pub channels: Option>, + pub after: Option +} + +/// struct for passing parameters to the method [`v1_period_message_period_events_subscription_period_create_token`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodEventsSubscriptionPeriodCreateTokenParams { + /// The app's ID or UID + pub app_id: String, + /// The esub's ID or UID + pub subscription_id: String, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_message_period_expunge_content`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodExpungeContentParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String +} + +/// struct for passing parameters to the method [`v1_period_message_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodGetParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// When `true` message payloads are included in the response. + pub with_content: Option +} + +/// struct for passing parameters to the method [`v1_period_message_period_get_raw_payload`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodGetRawPayloadParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String +} + +/// struct for passing parameters to the method [`v1_period_message_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessagePeriodListParams { + /// The app's ID or UID + pub app_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the channel. + pub channel: Option, + /// Only include items created before a certain date. + pub before: Option, + /// Only include items created after a certain date. + pub after: Option, + /// When `true` message payloads are included in the response. + pub with_content: Option, + /// Filter messages matching the provided tag. + pub tag: Option, + /// Filter response based on the event type + pub event_types: Option> +} + + +/// struct for typed errors of method [`create_message_attempt_for_endpoint`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateMessageAttemptForEndpointError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_events_public`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEventsPublicError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status413(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_events`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodEventsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_events_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodEventsSubscriptionError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_events_subscription_period_create_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodEventsSubscriptionPeriodCreateTokenError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_expunge_content`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodExpungeContentError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_get_raw_payload`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodGetRawPayloadError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessagePeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Creates and sends a message to the specified endpoint. The message attempt and response from the endpoint is returned. +pub async fn create_message_attempt_for_endpoint(configuration: &Configuration, params: CreateMessageAttemptForEndpointParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let message_in = params.message_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/test-attempt".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(message_in); + + req.execute(configuration).await +} + +/// Reads the stream of created messages for an application, filtered on the Sink's event types and Channels. +pub async fn v1_period_events_public(configuration: &Configuration, params: V1PeriodEventsPublicParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let sink_id = params.sink_id; + let limit = params.limit; + let iterator = params.iterator; + let event_type = params.event_type; + let channel = params.channel; + let after = params.after; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/poller/{sink_id}".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = event_type { + let query_value = s.to_string(); + req = req.with_query_param("event_type".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("sink_id".to_string(), sink_id.to_string()); + + req.execute(configuration).await +} + +/// 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. +pub async fn v1_period_message_period_create(configuration: &Configuration, params: V1PeriodMessagePeriodCreateParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let message_in = params.message_in; + let with_content = params.with_content; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/msg".to_string()) + ; + if let Some(ref s) = with_content { + let query_value = s.to_string(); + req = req.with_query_param("with_content".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(message_in); + + req.execute(configuration).await +} + +/// Reads the stream of created messages for an application. +pub async fn v1_period_message_period_events(configuration: &Configuration, params: V1PeriodMessagePeriodEventsParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let limit = params.limit; + let iterator = params.iterator; + let event_types = params.event_types; + let channels = params.channels; + let after = params.after; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/events".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + if let Some(ref s) = channels { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("channels".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + +/// Reads the stream of created messages for an application, but using server-managed iterator tracking. +pub async fn v1_period_message_period_events_subscription(configuration: &Configuration, params: V1PeriodMessagePeriodEventsSubscriptionParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let subscription_id = params.subscription_id; + let limit = params.limit; + let iterator = params.iterator; + let event_types = params.event_types; + let channels = params.channels; + let after = params.after; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/events/subscription/{subscription_id}".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + if let Some(ref s) = channels { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("channels".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("subscription_id".to_string(), subscription_id.to_string()); + + req.execute(configuration).await +} + +/// Creates an auth token that can be used with the `v1.message.events-subscription` endpoint. +pub async fn v1_period_message_period_events_subscription_period_create_token(configuration: &Configuration, params: V1PeriodMessagePeriodEventsSubscriptionPeriodCreateTokenParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let subscription_id = params.subscription_id; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/events/subscription/{subscription_id}/create-token".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("subscription_id".to_string(), subscription_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + + req.execute(configuration).await +} + +/// 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. +pub async fn v1_period_message_period_expunge_content(configuration: &Configuration, params: V1PeriodMessagePeriodExpungeContentParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}/msg/{msg_id}/content".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Get a message by its ID or eventID. +pub async fn v1_period_message_period_get(configuration: &Configuration, params: V1PeriodMessagePeriodGetParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let with_content = params.with_content; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}".to_string()) + ; + if let Some(ref s) = with_content { + let query_value = s.to_string(); + req = req.with_query_param("with_content".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + + req.execute(configuration).await +} + +/// Get a message raw payload by its ID or eventID. +pub async fn v1_period_message_period_get_raw_payload(configuration: &Configuration, params: V1PeriodMessagePeriodGetRawPayloadParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/raw".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + + req.execute(configuration).await +} + +/// 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. +pub async fn v1_period_message_period_list(configuration: &Configuration, params: V1PeriodMessagePeriodListParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let limit = params.limit; + let iterator = params.iterator; + let channel = params.channel; + let before = params.before; + let after = params.after; + let with_content = params.with_content; + let tag = params.tag; + let event_types = params.event_types; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = before { + let query_value = s.to_string(); + req = req.with_query_param("before".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + if let Some(ref s) = with_content { + let query_value = s.to_string(); + req = req.with_query_param("with_content".to_string(), query_value); + } + if let Some(ref s) = tag { + let query_value = s.to_string(); + req = req.with_query_param("tag".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/message_attempt_api.rs b/rust/src/apis/message_attempt_api.rs new file mode 100644 index 000000000..f55611c84 --- /dev/null +++ b/rust/src/apis/message_attempt_api.rs @@ -0,0 +1,882 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_count_by_endpoint`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodCountByEndpointParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + pub status: Option, + /// Filter response based on the HTTP status code + pub status_code_class: Option, + /// Filter response based on the channel + pub channel: Option, + /// Filter response based on the tag + pub tag: Option, + /// Only include items created before a certain date + pub before: Option, + /// Only include items created after a certain date + pub after: Option, + /// Filter response based on the event type + pub event_types: Option> +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_expunge_content`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodExpungeContentParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// The attempt's ID + pub attempt_id: String +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodGetParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// The attempt's ID + pub attempt_id: String +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_get_headers`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodGetHeadersParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// The attempt's ID + pub attempt_id: String +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_list_attempted_destinations`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodListAttemptedDestinationsParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_list_attempted_messages`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodListAttemptedMessagesParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the channel + pub channel: Option, + /// Filter response based on the message tags + pub tag: Option, + /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + pub status: Option, + /// Only include items created before a certain date + pub before: Option, + /// Only include items created after a certain date + pub after: Option, + /// When `true` message payloads are included in the response + pub with_content: Option, + /// Filter response based on the event type + pub event_types: Option> +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_list_by_endpoint`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodListByEndpointParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + pub status: Option, + /// Filter response based on the HTTP status code + pub status_code_class: Option, + /// Filter response based on the channel + pub channel: Option, + /// Filter response based on the tag + pub tag: Option, + /// Only include items created before a certain date + pub before: Option, + /// Only include items created after a certain date + pub after: Option, + /// When `true` attempt content is included in the response + pub with_content: Option, + /// When `true`, the message information is included in the response + pub with_msg: Option, + /// Filter response based on the event type + pub event_types: Option> +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_list_by_endpoint_deprecated`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodListByEndpointDeprecatedParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the channel + pub channel: Option, + /// Filter response based on the tag + pub tag: Option, + /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + pub status: Option, + /// Only include items created before a certain date + pub before: Option, + /// Only include items created after a certain date + pub after: Option, + /// Filter response based on the event type + pub event_types: Option> +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_list_by_msg`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodListByMsgParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + pub status: Option, + /// Filter response based on the HTTP status code + pub status_code_class: Option, + /// Filter response based on the channel + pub channel: Option, + /// Filter response based on the tag + pub tag: Option, + /// Filter the attempts based on the attempted endpoint + pub endpoint_id: Option, + /// Only include items created before a certain date + pub before: Option, + /// Only include items created after a certain date + pub after: Option, + /// When `true` attempt content is included in the response + pub with_content: Option, + /// Filter response based on the event type + pub event_types: Option> +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_list_by_msg_deprecated`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodListByMsgDeprecatedParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// Filter the attempts based on the attempted endpoint + pub endpoint_id: Option, + /// Filter response based on the channel + pub channel: Option, + /// Filter response based on the tag + pub tag: Option, + /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + pub status: Option, + /// Only include items created before a certain date + pub before: Option, + /// Only include items created after a certain date + pub after: Option, + /// Filter response based on the HTTP status code + pub status_code_class: Option, + /// Filter response based on the event type + pub event_types: Option> +} + +/// struct for passing parameters to the method [`v1_period_message_attempt_period_resend`] +#[derive(Clone, Debug)] +pub struct V1PeriodMessageAttemptPeriodResendParams { + /// The app's ID or UID + pub app_id: String, + /// The msg's ID or UID + pub msg_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + /// The request's idempotency key + pub idempotency_key: Option +} + + +/// struct for typed errors of method [`v1_period_message_attempt_period_count_by_endpoint`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodCountByEndpointError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_expunge_content`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodExpungeContentError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_get_headers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodGetHeadersError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_list_attempted_destinations`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodListAttemptedDestinationsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_list_attempted_messages`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodListAttemptedMessagesError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_list_by_endpoint`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodListByEndpointError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_list_by_endpoint_deprecated`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodListByEndpointDeprecatedError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_list_by_msg`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodListByMsgError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_list_by_msg_deprecated`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodListByMsgDeprecatedError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_message_attempt_period_resend`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodMessageAttemptPeriodResendError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Like `v1.message-attempt.list-by-endpoint` but returning a count only. +pub async fn v1_period_message_attempt_period_count_by_endpoint(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodCountByEndpointParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let status = params.status; + let status_code_class = params.status_code_class; + let channel = params.channel; + let tag = params.tag; + let before = params.before; + let after = params.after; + let event_types = params.event_types; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/count".to_string()) + ; + if let Some(ref s) = status { + let query_value = s.to_string(); + req = req.with_query_param("status".to_string(), query_value); + } + if let Some(ref s) = status_code_class { + let query_value = s.to_string(); + req = req.with_query_param("status_code_class".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = tag { + let query_value = s.to_string(); + req = req.with_query_param("tag".to_string(), query_value); + } + if let Some(ref s) = before { + let query_value = s.to_string(); + req = req.with_query_param("before".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content. The message can't be replayed or resent once its payload has been deleted or expired. +pub async fn v1_period_message_attempt_period_expunge_content(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodExpungeContentParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let attempt_id = params.attempt_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + req = req.with_path_param("attempt_id".to_string(), attempt_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// `msg_id`: Use a message id or a message `eventId` +pub async fn v1_period_message_attempt_period_get(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodGetParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let attempt_id = params.attempt_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + req = req.with_path_param("attempt_id".to_string(), attempt_id.to_string()); + + req.execute(configuration).await +} + +/// Calculate and return headers used on a given message attempt +pub async fn v1_period_message_attempt_period_get_headers(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodGetHeadersParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let attempt_id = params.attempt_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + req = req.with_path_param("attempt_id".to_string(), attempt_id.to_string()); + + req.execute(configuration).await +} + +/// List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. By default, endpoints are listed in ascending order by ID. +pub async fn v1_period_message_attempt_period_list_attempted_destinations(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodListAttemptedDestinationsParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let limit = params.limit; + let iterator = params.iterator; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/endpoint".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + + req.execute(configuration).await +} + +/// List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. 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. +pub async fn v1_period_message_attempt_period_list_attempted_messages(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodListAttemptedMessagesParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let limit = params.limit; + let iterator = params.iterator; + let channel = params.channel; + let tag = params.tag; + let status = params.status; + let before = params.before; + let after = params.after; + let with_content = params.with_content; + let event_types = params.event_types; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = tag { + let query_value = s.to_string(); + req = req.with_query_param("tag".to_string(), query_value); + } + if let Some(ref s) = status { + let query_value = s.to_string(); + req = req.with_query_param("status".to_string(), query_value); + } + if let Some(ref s) = before { + let query_value = s.to_string(); + req = req.with_query_param("before".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + if let Some(ref s) = with_content { + let query_value = s.to_string(); + req = req.with_query_param("with_content".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// List attempts by endpoint id 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. +pub async fn v1_period_message_attempt_period_list_by_endpoint(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodListByEndpointParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let limit = params.limit; + let iterator = params.iterator; + let status = params.status; + let status_code_class = params.status_code_class; + let channel = params.channel; + let tag = params.tag; + let before = params.before; + let after = params.after; + let with_content = params.with_content; + let with_msg = params.with_msg; + let event_types = params.event_types; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = status { + let query_value = s.to_string(); + req = req.with_query_param("status".to_string(), query_value); + } + if let Some(ref s) = status_code_class { + let query_value = s.to_string(); + req = req.with_query_param("status_code_class".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = tag { + let query_value = s.to_string(); + req = req.with_query_param("tag".to_string(), query_value); + } + if let Some(ref s) = before { + let query_value = s.to_string(); + req = req.with_query_param("before".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + if let Some(ref s) = with_content { + let query_value = s.to_string(); + req = req.with_query_param("with_content".to_string(), query_value); + } + if let Some(ref s) = with_msg { + let query_value = s.to_string(); + req = req.with_query_param("with_msg".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. List the message attempts for a particular endpoint. Returning the endpoint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. 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. +pub async fn v1_period_message_attempt_period_list_by_endpoint_deprecated(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodListByEndpointDeprecatedParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let endpoint_id = params.endpoint_id; + let limit = params.limit; + let iterator = params.iterator; + let channel = params.channel; + let tag = params.tag; + let status = params.status; + let before = params.before; + let after = params.after; + let event_types = params.event_types; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = tag { + let query_value = s.to_string(); + req = req.with_query_param("tag".to_string(), query_value); + } + if let Some(ref s) = status { + let query_value = s.to_string(); + req = req.with_query_param("status".to_string(), query_value); + } + if let Some(ref s) = before { + let query_value = s.to_string(); + req = req.with_query_param("before".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// List attempts by message ID. 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. +pub async fn v1_period_message_attempt_period_list_by_msg(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodListByMsgParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let limit = params.limit; + let iterator = params.iterator; + let status = params.status; + let status_code_class = params.status_code_class; + let channel = params.channel; + let tag = params.tag; + let endpoint_id = params.endpoint_id; + let before = params.before; + let after = params.after; + let with_content = params.with_content; + let event_types = params.event_types; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/attempt/msg/{msg_id}".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = status { + let query_value = s.to_string(); + req = req.with_query_param("status".to_string(), query_value); + } + if let Some(ref s) = status_code_class { + let query_value = s.to_string(); + req = req.with_query_param("status_code_class".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = tag { + let query_value = s.to_string(); + req = req.with_query_param("tag".to_string(), query_value); + } + if let Some(ref s) = endpoint_id { + let query_value = s.to_string(); + req = req.with_query_param("endpoint_id".to_string(), query_value); + } + if let Some(ref s) = before { + let query_value = s.to_string(); + req = req.with_query_param("before".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + if let Some(ref s) = with_content { + let query_value = s.to_string(); + req = req.with_query_param("with_content".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + + req.execute(configuration).await +} + +/// Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead. 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. `msg_id`: Use a message id or a message `eventId` +pub async fn v1_period_message_attempt_period_list_by_msg_deprecated(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodListByMsgDeprecatedParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let limit = params.limit; + let iterator = params.iterator; + let endpoint_id = params.endpoint_id; + let channel = params.channel; + let tag = params.tag; + let status = params.status; + let before = params.before; + let after = params.after; + let status_code_class = params.status_code_class; + let event_types = params.event_types; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/attempt".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = endpoint_id { + let query_value = s.to_string(); + req = req.with_query_param("endpoint_id".to_string(), query_value); + } + if let Some(ref s) = channel { + let query_value = s.to_string(); + req = req.with_query_param("channel".to_string(), query_value); + } + if let Some(ref s) = tag { + let query_value = s.to_string(); + req = req.with_query_param("tag".to_string(), query_value); + } + if let Some(ref s) = status { + let query_value = s.to_string(); + req = req.with_query_param("status".to_string(), query_value); + } + if let Some(ref s) = before { + let query_value = s.to_string(); + req = req.with_query_param("before".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + if let Some(ref s) = status_code_class { + let query_value = s.to_string(); + req = req.with_query_param("status_code_class".to_string(), query_value); + } + if let Some(ref s) = event_types { + let query_value = s.iter().map(|s| s.to_string()).collect::>().join(","); + req = req.with_query_param("event_types".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + + req.execute(configuration).await +} + +/// Resend a message to the specified endpoint. +pub async fn v1_period_message_attempt_period_resend(configuration: &Configuration, params: V1PeriodMessageAttemptPeriodResendParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let msg_id = params.msg_id; + let endpoint_id = params.endpoint_id; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("msg_id".to_string(), msg_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.returns_nothing(); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/mod.rs b/rust/src/apis/mod.rs new file mode 100644 index 000000000..6a81a91cf --- /dev/null +++ b/rust/src/apis/mod.rs @@ -0,0 +1,45 @@ +#[derive(Debug, Clone)] +pub(crate) struct ResponseContent { + pub status: http02::StatusCode, + pub content: String, + pub entity: Option, +} + +pub(crate) mod application_api; +//pub use self::application_api::{ ApplicationApi, ApplicationApiClient }; +pub(crate) mod authentication_api; +//pub use self::authentication_api::{ AuthenticationApi, AuthenticationApiClient }; +pub(crate) mod background_tasks_api; +//pub use self::background_tasks_api::{ BackgroundTasksApi, BackgroundTasksApiClient }; +pub(crate) mod broadcast_api; +//pub use self::broadcast_api::{ BroadcastApi, BroadcastApiClient }; +pub(crate) mod endpoint_api; +//pub use self::endpoint_api::{ EndpointApi, EndpointApiClient }; +pub(crate) mod environment_api; +//pub use self::environment_api::{ EnvironmentApi, EnvironmentApiClient }; +pub(crate) mod environment_settings_api; +//pub use self::environment_settings_api::{ EnvironmentSettingsApi, EnvironmentSettingsApiClient }; +pub(crate) mod event_type_api; +//pub use self::event_type_api::{ EventTypeApi, EventTypeApiClient }; +pub(crate) mod events_api; +//pub use self::events_api::{ EventsApi, EventsApiClient }; +pub(crate) mod health_api; +//pub use self::health_api::{ HealthApi, HealthApiClient }; +pub(crate) mod inbound_api; +//pub use self::inbound_api::{ InboundApi, InboundApiClient }; +pub(crate) mod integration_api; +//pub use self::integration_api::{ IntegrationApi, IntegrationApiClient }; +pub(crate) mod message_api; +//pub use self::message_api::{ MessageApi, MessageApiClient }; +pub(crate) mod message_attempt_api; +//pub use self::message_attempt_api::{ MessageAttemptApi, MessageAttemptApiClient }; +pub(crate) mod statistics_api; +//pub use self::statistics_api::{ StatisticsApi, StatisticsApiClient }; +pub(crate) mod stream_api; +//pub use self::stream_api::{ StreamApi, StreamApiClient }; +pub(crate) mod stream_event_types_api; +//pub use self::stream_event_types_api::{ StreamEventTypesApi, StreamEventTypesApiClient }; +pub(crate) mod transformation_template_api; +//pub use self::transformation_template_api::{ TransformationTemplateApi, TransformationTemplateApiClient }; +pub(crate) mod webhook_endpoint_api; +//pub use self::webhook_endpoint_api::{ WebhookEndpointApi, WebhookEndpointApiClient }; diff --git a/rust/src/apis/statistics_api.rs b/rust/src/apis/statistics_api.rs new file mode 100644 index 000000000..7416fb15e --- /dev/null +++ b/rust/src/apis/statistics_api.rs @@ -0,0 +1,187 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_statistics_period_aggregate_app_stats`] +#[derive(Clone, Debug)] +pub struct V1PeriodStatisticsPeriodAggregateAppStatsParams { + pub app_usage_stats_in: models::AppUsageStatsIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_stats_period_app_attempts`] +#[derive(Clone, Debug)] +pub struct V1PeriodStatsPeriodAppAttemptsParams { + /// The app's ID or UID + pub app_id: String, + /// Filter the range to data starting from this date. + pub start_date: Option, + /// Filter the range to data ending by this date. + pub end_date: Option +} + +/// struct for passing parameters to the method [`v1_period_stats_period_endpoint_attempts`] +#[derive(Clone, Debug)] +pub struct V1PeriodStatsPeriodEndpointAttemptsParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + /// Filter the range to data starting from this date. + pub start_date: Option, + /// Filter the range to data ending by this date. + pub end_date: Option +} + + +/// struct for typed errors of method [`v1_period_statistics_period_aggregate_app_stats`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStatisticsPeriodAggregateAppStatsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_statistics_period_aggregate_event_types`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStatisticsPeriodAggregateEventTypesError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stats_period_app_attempts`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStatsPeriodAppAttemptsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stats_period_endpoint_attempts`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStatsPeriodEndpointAttemptsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Creates a background task to calculate the message destinations for all applications in the environment. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation. +pub async fn v1_period_statistics_period_aggregate_app_stats(configuration: &Configuration, params: V1PeriodStatisticsPeriodAggregateAppStatsParams) -> Result { + // unbox the parameters + let app_usage_stats_in = params.app_usage_stats_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/stats/usage/app".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(app_usage_stats_in); + + req.execute(configuration).await +} + +/// Creates a background task to calculate the listed event types for all apps in the organization. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation. +pub async fn v1_period_statistics_period_aggregate_event_types(configuration: &Configuration) -> Result { + // unbox the parameters + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/stats/usage/event-types".to_string()) + ; + + req.execute(configuration).await +} + +/// Returns application-level statistics on message attempts +pub async fn v1_period_stats_period_app_attempts(configuration: &Configuration, params: V1PeriodStatsPeriodAppAttemptsParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let start_date = params.start_date; + let end_date = params.end_date; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/stats/app/{app_id}/attempt".to_string()) + ; + if let Some(ref s) = start_date { + let query_value = s.to_string(); + req = req.with_query_param("startDate".to_string(), query_value); + } + if let Some(ref s) = end_date { + let query_value = s.to_string(); + req = req.with_query_param("endDate".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + + req.execute(configuration).await +} + +/// Returns endpoint-level statistics on message attempts. +pub async fn v1_period_stats_period_endpoint_attempts(configuration: &Configuration, params: V1PeriodStatsPeriodEndpointAttemptsParams) -> Result { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let start_date = params.start_date; + let end_date = params.end_date; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt".to_string()) + ; + if let Some(ref s) = start_date { + let query_value = s.to_string(); + req = req.with_query_param("startDate".to_string(), query_value); + } + if let Some(ref s) = end_date { + let query_value = s.to_string(); + req = req.with_query_param("endDate".to_string(), query_value); + } + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/stream_api.rs b/rust/src/apis/stream_api.rs new file mode 100644 index 000000000..4069ac036 --- /dev/null +++ b/rust/src/apis/stream_api.rs @@ -0,0 +1,351 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_stream_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodCreateParams { + pub stream_in: models::StreamIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_stream_period_create_events`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodCreateEventsParams { + pub stream_id: String, + pub create_stream_in: models::CreateStreamIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_stream_period_delete`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodDeleteParams { + pub stream_id: String +} + +/// struct for passing parameters to the method [`v1_period_stream_period_events_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodEventsGetParams { + pub stream_id: String, + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + pub after: Option +} + +/// struct for passing parameters to the method [`v1_period_stream_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodGetParams { + pub stream_id: String +} + +/// struct for passing parameters to the method [`v1_period_stream_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodListParams { + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + +/// struct for passing parameters to the method [`v1_period_stream_period_patch`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodPatchParams { + pub stream_id: String, + pub stream_patch: models::StreamPatch +} + +/// struct for passing parameters to the method [`v1_period_stream_period_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodUpdateParams { + pub stream_id: String, + pub stream_in: models::StreamIn +} + + +/// struct for typed errors of method [`v1_period_stream_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_create_events`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodCreateEventsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodDeleteError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_events_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodEventsGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodPatchError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Creates a new stream. +pub async fn v1_period_stream_period_create(configuration: &Configuration, params: V1PeriodStreamPeriodCreateParams) -> Result { + // unbox the parameters + let stream_in = params.stream_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/stream".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(stream_in); + + req.execute(configuration).await +} + +/// Creates events on the Stream. +pub async fn v1_period_stream_period_create_events(configuration: &Configuration, params: V1PeriodStreamPeriodCreateEventsParams) -> Result { + // unbox the parameters + let stream_id = params.stream_id; + let create_stream_in = params.create_stream_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/stream/{stream_id}/events".to_string()) + ; + req = req.with_path_param("stream_id".to_string(), stream_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(create_stream_in); + + req.execute(configuration).await +} + +/// Delete a stream. +pub async fn v1_period_stream_period_delete(configuration: &Configuration, params: V1PeriodStreamPeriodDeleteParams) -> Result<(), Error> { + // unbox the parameters + let stream_id = params.stream_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/stream/{stream_id}".to_string()) + ; + req = req.with_path_param("stream_id".to_string(), stream_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Iterate over a stream of events. +pub async fn v1_period_stream_period_events_get(configuration: &Configuration, params: V1PeriodStreamPeriodEventsGetParams) -> Result { + // unbox the parameters + let stream_id = params.stream_id; + let limit = params.limit; + let iterator = params.iterator; + let after = params.after; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/stream/{stream_id}/events".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = after { + let query_value = s.to_string(); + req = req.with_query_param("after".to_string(), query_value); + } + req = req.with_path_param("stream_id".to_string(), stream_id.to_string()); + + req.execute(configuration).await +} + +/// Get a stream by id or uid. +pub async fn v1_period_stream_period_get(configuration: &Configuration, params: V1PeriodStreamPeriodGetParams) -> Result { + // unbox the parameters + let stream_id = params.stream_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/stream/{stream_id}".to_string()) + ; + req = req.with_path_param("stream_id".to_string(), stream_id.to_string()); + + req.execute(configuration).await +} + +/// List of all the organization's streams. +pub async fn v1_period_stream_period_list(configuration: &Configuration, params: V1PeriodStreamPeriodListParams) -> Result { + // unbox the parameters + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/stream".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + + req.execute(configuration).await +} + +/// Partially update a stream. +pub async fn v1_period_stream_period_patch(configuration: &Configuration, params: V1PeriodStreamPeriodPatchParams) -> Result { + // unbox the parameters + let stream_id = params.stream_id; + let stream_patch = params.stream_patch; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/stream/{stream_id}".to_string()) + ; + req = req.with_path_param("stream_id".to_string(), stream_id.to_string()); + req = req.with_body_param(stream_patch); + + req.execute(configuration).await +} + +/// Update a stream. +pub async fn v1_period_stream_period_update(configuration: &Configuration, params: V1PeriodStreamPeriodUpdateParams) -> Result { + // unbox the parameters + let stream_id = params.stream_id; + let stream_in = params.stream_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/stream/{stream_id}".to_string()) + ; + req = req.with_path_param("stream_id".to_string(), stream_id.to_string()); + req = req.with_body_param(stream_in); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/stream_event_types_api.rs b/rust/src/apis/stream_event_types_api.rs new file mode 100644 index 000000000..27c0d583e --- /dev/null +++ b/rust/src/apis/stream_event_types_api.rs @@ -0,0 +1,258 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_stream_period_event_type_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodEventTypePeriodCreateParams { + pub stream_event_type_in: models::StreamEventTypeIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_stream_period_event_type_period_delete`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodEventTypePeriodDeleteParams { + /// The event type's name + pub name: String +} + +/// struct for passing parameters to the method [`v1_period_stream_period_event_type_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodEventTypePeriodGetParams { + /// The event type's name + pub name: String +} + +/// struct for passing parameters to the method [`v1_period_stream_period_event_type_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodEventTypePeriodListParams { + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + +/// struct for passing parameters to the method [`v1_period_stream_period_event_type_period_patch`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodEventTypePeriodPatchParams { + /// The event type's name + pub name: String, + pub stream_event_type_patch: models::StreamEventTypePatch +} + +/// struct for passing parameters to the method [`v1_period_stream_period_event_type_period_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodStreamPeriodEventTypePeriodUpdateParams { + /// The event type's name + pub name: String, + pub stream_event_type_in: models::StreamEventTypeIn +} + + +/// struct for typed errors of method [`v1_period_stream_period_event_type_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodEventTypePeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_event_type_period_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodEventTypePeriodDeleteError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_event_type_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodEventTypePeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_event_type_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodEventTypePeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_event_type_period_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodEventTypePeriodPatchError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_stream_period_event_type_period_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodStreamPeriodEventTypePeriodUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Create an event type for Streams. +pub async fn v1_period_stream_period_event_type_period_create(configuration: &Configuration, params: V1PeriodStreamPeriodEventTypePeriodCreateParams) -> Result { + // unbox the parameters + let stream_event_type_in = params.stream_event_type_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/stream/event-type".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(stream_event_type_in); + + req.execute(configuration).await +} + +/// Delete an event type. +pub async fn v1_period_stream_period_event_type_period_delete(configuration: &Configuration, params: V1PeriodStreamPeriodEventTypePeriodDeleteParams) -> Result<(), Error> { + // unbox the parameters + let name = params.name; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/stream/event-type/{name}".to_string()) + ; + req = req.with_path_param("name".to_string(), name.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Get an event type. +pub async fn v1_period_stream_period_event_type_period_get(configuration: &Configuration, params: V1PeriodStreamPeriodEventTypePeriodGetParams) -> Result { + // unbox the parameters + let name = params.name; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/stream/event-type/{name}".to_string()) + ; + req = req.with_path_param("name".to_string(), name.to_string()); + + req.execute(configuration).await +} + +/// List of all the organization's event types for streaming. +pub async fn v1_period_stream_period_event_type_period_list(configuration: &Configuration, params: V1PeriodStreamPeriodEventTypePeriodListParams) -> Result { + // unbox the parameters + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/stream/event-type".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + + req.execute(configuration).await +} + +/// Patch an event type for Streams. +pub async fn v1_period_stream_period_event_type_period_patch(configuration: &Configuration, params: V1PeriodStreamPeriodEventTypePeriodPatchParams) -> Result { + // unbox the parameters + let name = params.name; + let stream_event_type_patch = params.stream_event_type_patch; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/stream/event-type/{name}".to_string()) + ; + req = req.with_path_param("name".to_string(), name.to_string()); + req = req.with_body_param(stream_event_type_patch); + + req.execute(configuration).await +} + +/// Update or create a event type for Streams. +pub async fn v1_period_stream_period_event_type_period_update(configuration: &Configuration, params: V1PeriodStreamPeriodEventTypePeriodUpdateParams) -> Result { + // unbox the parameters + let name = params.name; + let stream_event_type_in = params.stream_event_type_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/stream/event-type/{name}".to_string()) + ; + req = req.with_path_param("name".to_string(), name.to_string()); + req = req.with_body_param(stream_event_type_in); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/transformation_template_api.rs b/rust/src/apis/transformation_template_api.rs new file mode 100644 index 000000000..ae4a86cd8 --- /dev/null +++ b/rust/src/apis/transformation_template_api.rs @@ -0,0 +1,497 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`v1_period_endpoint_period_update_hubspot_oauth_config`] +#[derive(Clone, Debug)] +pub struct V1PeriodEndpointPeriodUpdateHubspotOauthConfigParams { + /// The app's ID or UID + pub app_id: String, + /// The ep's ID or UID + pub endpoint_id: String, + pub hubspot_oauth_config_in: models::HubspotOauthConfigIn +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_create`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodCreateParams { + pub template_in: models::TemplateIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_delete`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodDeleteParams { + pub transformation_template_id: String +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_generate`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodGenerateParams { + pub generate_in: models::GenerateIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_get`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodGetParams { + pub transformation_template_id: String +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_list`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodListParams { + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_oauth_period_discord`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodOauthPeriodDiscordParams { + pub o_auth_payload_in: models::OAuthPayloadIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_oauth_period_hubspot`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodOauthPeriodHubspotParams { + pub o_auth_payload_in: models::OAuthPayloadIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_oauth_period_slack`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodOauthPeriodSlackParams { + pub o_auth_payload_in: models::OAuthPayloadIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_patch`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodPatchParams { + pub transformation_template_id: String, + pub template_patch: models::TemplatePatch +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_simulate`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodSimulateParams { + pub transformation_simulate_in: models::TransformationSimulateIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`v1_period_transformation_template_period_update`] +#[derive(Clone, Debug)] +pub struct V1PeriodTransformationTemplatePeriodUpdateParams { + pub transformation_template_id: String, + pub template_update: models::TemplateUpdate +} + + +/// struct for typed errors of method [`v1_period_endpoint_period_update_hubspot_oauth_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodEndpointPeriodUpdateHubspotOauthConfigError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodCreateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodDeleteError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_generate`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodGenerateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodGetError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodListError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_oauth_period_discord`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodOauthPeriodDiscordError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_oauth_period_hubspot`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodOauthPeriodHubspotError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_oauth_period_slack`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodOauthPeriodSlackError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodPatchError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_simulate`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodSimulateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`v1_period_transformation_template_period_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum V1PeriodTransformationTemplatePeriodUpdateError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Create/update endpoint Hubspot OAuth configuration Specific private endpoint just for us, to avoid exposing the Hubspot secret to the client. +pub async fn v1_period_endpoint_period_update_hubspot_oauth_config(configuration: &Configuration, params: V1PeriodEndpointPeriodUpdateHubspotOauthConfigParams) -> Result<(), Error> { + // unbox the parameters + let app_id = params.app_id; + let endpoint_id = params.endpoint_id; + let hubspot_oauth_config_in = params.hubspot_oauth_config_in; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot".to_string()) + ; + req = req.with_path_param("app_id".to_string(), app_id.to_string()); + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(hubspot_oauth_config_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Create a new transformation template. +pub async fn v1_period_transformation_template_period_create(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodCreateParams) -> Result { + // unbox the parameters + let template_in = params.template_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/transformation-template".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(template_in); + + req.execute(configuration).await +} + +/// Delete a transformation template. +pub async fn v1_period_transformation_template_period_delete(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodDeleteParams) -> Result<(), Error> { + // unbox the parameters + let transformation_template_id = params.transformation_template_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/transformation-template/{transformation_template_id}".to_string()) + ; + req = req.with_path_param("transformation_template_id".to_string(), transformation_template_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Use OpenAI's Completion API to generate code for a transformation template. +pub async fn v1_period_transformation_template_period_generate(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodGenerateParams) -> Result { + // unbox the parameters + let generate_in = params.generate_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/transformation-template/generate".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(generate_in); + + req.execute(configuration).await +} + +/// Get a transformation template. +pub async fn v1_period_transformation_template_period_get(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodGetParams) -> Result { + // unbox the parameters + let transformation_template_id = params.transformation_template_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/transformation-template/{transformation_template_id}".to_string()) + ; + req = req.with_path_param("transformation_template_id".to_string(), transformation_template_id.to_string()); + + req.execute(configuration).await +} + +/// List all transformation templates for an application. +pub async fn v1_period_transformation_template_period_list(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodListParams) -> Result { + // unbox the parameters + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/transformation-template".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + + req.execute(configuration).await +} + +/// Get Discord Incoming webhook URL. +pub async fn v1_period_transformation_template_period_oauth_period_discord(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodOauthPeriodDiscordParams) -> Result { + // unbox the parameters + let o_auth_payload_in = params.o_auth_payload_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/transformation-template/oauth/discord".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(o_auth_payload_in); + + req.execute(configuration).await +} + +/// Get Hubspot access token using authorization code. +pub async fn v1_period_transformation_template_period_oauth_period_hubspot(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodOauthPeriodHubspotParams) -> Result { + // unbox the parameters + let o_auth_payload_in = params.o_auth_payload_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/transformation-template/oauth/hubspot".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(o_auth_payload_in); + + req.execute(configuration).await +} + +/// Get Slack Incoming webhook URL. +pub async fn v1_period_transformation_template_period_oauth_period_slack(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodOauthPeriodSlackParams) -> Result { + // unbox the parameters + let o_auth_payload_in = params.o_auth_payload_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/transformation-template/oauth/slack".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(o_auth_payload_in); + + req.execute(configuration).await +} + +/// Partially update a transformation template. +pub async fn v1_period_transformation_template_period_patch(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodPatchParams) -> Result { + // unbox the parameters + let transformation_template_id = params.transformation_template_id; + let template_patch = params.template_patch; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PATCH, "/api/v1/transformation-template/{transformation_template_id}".to_string()) + ; + req = req.with_path_param("transformation_template_id".to_string(), transformation_template_id.to_string()); + req = req.with_body_param(template_patch); + + req.execute(configuration).await +} + +/// Simulate running the transformation on the payload and code. +pub async fn v1_period_transformation_template_period_simulate(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodSimulateParams) -> Result { + // unbox the parameters + let transformation_simulate_in = params.transformation_simulate_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/transformation-template/simulate".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(transformation_simulate_in); + + req.execute(configuration).await +} + +/// Update a transformation template. +pub async fn v1_period_transformation_template_period_update(configuration: &Configuration, params: V1PeriodTransformationTemplatePeriodUpdateParams) -> Result { + // unbox the parameters + let transformation_template_id = params.transformation_template_id; + let template_update = params.template_update; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/transformation-template/{transformation_template_id}".to_string()) + ; + req = req.with_path_param("transformation_template_id".to_string(), transformation_template_id.to_string()); + req = req.with_body_param(template_update); + + req.execute(configuration).await +} + diff --git a/rust/src/apis/webhook_endpoint_api.rs b/rust/src/apis/webhook_endpoint_api.rs new file mode 100644 index 000000000..5aa25e5dd --- /dev/null +++ b/rust/src/apis/webhook_endpoint_api.rs @@ -0,0 +1,300 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::Configuration; +use crate::models; +use crate::error::Error; +#[allow(unused_imports)] +use crate::models::*; + +/// struct for passing parameters to the method [`create_operational_webhook_endpoint`] +#[derive(Clone, Debug)] +pub struct CreateOperationalWebhookEndpointParams { + pub operational_webhook_endpoint_in: models::OperationalWebhookEndpointIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`delete_operational_webhook_endpoint`] +#[derive(Clone, Debug)] +pub struct DeleteOperationalWebhookEndpointParams { + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`get_operational_webhook_endpoint`] +#[derive(Clone, Debug)] +pub struct GetOperationalWebhookEndpointParams { + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`get_operational_webhook_endpoint_secret`] +#[derive(Clone, Debug)] +pub struct GetOperationalWebhookEndpointSecretParams { + /// The ep's ID or UID + pub endpoint_id: String +} + +/// struct for passing parameters to the method [`list_operational_webhook_endpoints`] +#[derive(Clone, Debug)] +pub struct ListOperationalWebhookEndpointsParams { + /// Limit the number of returned items + pub limit: Option, + /// The iterator returned from a prior invocation + pub iterator: Option, + /// The sorting order of the returned items + pub order: Option +} + +/// struct for passing parameters to the method [`rotate_operational_webhook_endpoint_secret`] +#[derive(Clone, Debug)] +pub struct RotateOperationalWebhookEndpointSecretParams { + /// The ep's ID or UID + pub endpoint_id: String, + pub operational_webhook_endpoint_secret_in: models::OperationalWebhookEndpointSecretIn, + /// The request's idempotency key + pub idempotency_key: Option +} + +/// struct for passing parameters to the method [`update_operational_webhook_endpoint`] +#[derive(Clone, Debug)] +pub struct UpdateOperationalWebhookEndpointParams { + /// The ep's ID or UID + pub endpoint_id: String, + pub operational_webhook_endpoint_update: models::OperationalWebhookEndpointUpdate +} + + +/// struct for typed errors of method [`create_operational_webhook_endpoint`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateOperationalWebhookEndpointError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_operational_webhook_endpoint`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteOperationalWebhookEndpointError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_operational_webhook_endpoint`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetOperationalWebhookEndpointError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_operational_webhook_endpoint_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetOperationalWebhookEndpointSecretError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_operational_webhook_endpoints`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListOperationalWebhookEndpointsError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rotate_operational_webhook_endpoint_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RotateOperationalWebhookEndpointSecretError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_operational_webhook_endpoint`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateOperationalWebhookEndpointError { + Status400(models::HttpErrorOut), + Status401(models::HttpErrorOut), + Status403(models::HttpErrorOut), + Status404(models::HttpErrorOut), + Status409(models::HttpErrorOut), + Status422(models::HttpValidationError), + Status429(models::HttpErrorOut), + UnknownValue(serde_json::Value), +} + + +/// Create an operational webhook endpoint. +pub async fn create_operational_webhook_endpoint(configuration: &Configuration, params: CreateOperationalWebhookEndpointParams) -> Result { + // unbox the parameters + let operational_webhook_endpoint_in = params.operational_webhook_endpoint_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/operational-webhook/endpoint".to_string()) + ; + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(operational_webhook_endpoint_in); + + req.execute(configuration).await +} + +/// Delete an operational webhook endpoint. +pub async fn delete_operational_webhook_endpoint(configuration: &Configuration, params: DeleteOperationalWebhookEndpointParams) -> Result<(), Error> { + // unbox the parameters + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::DELETE, "/api/v1/operational-webhook/endpoint/{endpoint_id}".to_string()) + ; + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Get an operational webhook endpoint. +pub async fn get_operational_webhook_endpoint(configuration: &Configuration, params: GetOperationalWebhookEndpointParams) -> Result { + // unbox the parameters + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/operational-webhook/endpoint/{endpoint_id}".to_string()) + ; + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// Get an operational webhook endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). +pub async fn get_operational_webhook_endpoint_secret(configuration: &Configuration, params: GetOperationalWebhookEndpointSecretParams) -> Result { + // unbox the parameters + let endpoint_id = params.endpoint_id; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret".to_string()) + ; + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + + req.execute(configuration).await +} + +/// List operational webhook endpoints. +pub async fn list_operational_webhook_endpoints(configuration: &Configuration, params: ListOperationalWebhookEndpointsParams) -> Result { + // unbox the parameters + let limit = params.limit; + let iterator = params.iterator; + let order = params.order; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::GET, "/api/v1/operational-webhook/endpoint".to_string()) + ; + if let Some(ref s) = limit { + let query_value = s.to_string(); + req = req.with_query_param("limit".to_string(), query_value); + } + if let Some(ref s) = iterator { + let query_value = s.to_string(); + req = req.with_query_param("iterator".to_string(), query_value); + } + if let Some(ref s) = order { + let query_value = s.to_string(); + req = req.with_query_param("order".to_string(), query_value); + } + + req.execute(configuration).await +} + +/// Rotates an operational webhook endpoint's signing secret. The previous secret will remain valid for the next 24 hours. +pub async fn rotate_operational_webhook_endpoint_secret(configuration: &Configuration, params: RotateOperationalWebhookEndpointSecretParams) -> Result<(), Error> { + // unbox the parameters + let endpoint_id = params.endpoint_id; + let operational_webhook_endpoint_secret_in = params.operational_webhook_endpoint_secret_in; + let idempotency_key = params.idempotency_key; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::POST, "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate".to_string()) + ; + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + if let Some(param_value) = idempotency_key { + req = req.with_header_param("idempotency-key".to_string(), param_value.to_string()); + } + req = req.with_body_param(operational_webhook_endpoint_secret_in); + req = req.returns_nothing(); + + req.execute(configuration).await +} + +/// Update an operational webhook endpoint. +pub async fn update_operational_webhook_endpoint(configuration: &Configuration, params: UpdateOperationalWebhookEndpointParams) -> Result { + // unbox the parameters + let endpoint_id = params.endpoint_id; + let operational_webhook_endpoint_update = params.operational_webhook_endpoint_update; + + + #[allow(unused_mut)] + let mut req = crate::request::Request::new(http1::Method::PUT, "/api/v1/operational-webhook/endpoint/{endpoint_id}".to_string()) + ; + req = req.with_path_param("endpoint_id".to_string(), endpoint_id.to_string()); + req = req.with_body_param(operational_webhook_endpoint_update); + + req.execute(configuration).await +} + diff --git a/rust/src/models/aggregate_event_types_out.rs b/rust/src/models/aggregate_event_types_out.rs new file mode 100644 index 000000000..5431fb0c9 --- /dev/null +++ b/rust/src/models/aggregate_event_types_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AggregateEventTypesOut { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: models::BackgroundTaskStatus, + #[serde(rename = "task")] + pub task: models::BackgroundTaskType, + } + + impl AggregateEventTypesOut { + pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType) -> AggregateEventTypesOut { + AggregateEventTypesOut { + id, + status, + task, + } + } + } + diff --git a/rust/src/models/app_portal_access_in.rs b/rust/src/models/app_portal_access_in.rs new file mode 100644 index 000000000..e15e1357f --- /dev/null +++ b/rust/src/models/app_portal_access_in.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AppPortalAccessIn { + #[serde(rename = "application", skip_serializing_if = "Option::is_none")] + pub application: Option>, + /// How long the token will be valid for, in seconds. Valid values are between 1 hour and 7 days. The default is 7 days. + #[serde(rename = "expiry", skip_serializing_if = "Option::is_none")] + pub expiry: Option, + /// The set of feature flags the created token will have access to. + #[serde(rename = "featureFlags", skip_serializing_if = "Option::is_none")] + pub feature_flags: Option>, + /// Whether the app portal should be in read-only mode. + #[serde(rename = "readOnly", skip_serializing_if = "Option::is_none")] + pub read_only: Option, + } + + impl AppPortalAccessIn { + pub fn new() -> AppPortalAccessIn { + AppPortalAccessIn { + application: None, + expiry: None, + feature_flags: None, + read_only: None, + } + } + } + diff --git a/rust/src/models/app_portal_access_out.rs b/rust/src/models/app_portal_access_out.rs new file mode 100644 index 000000000..3607e448a --- /dev/null +++ b/rust/src/models/app_portal_access_out.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AppPortalAccessOut { + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "url")] + pub url: String, + } + + impl AppPortalAccessOut { + pub fn new(token: String, url: String) -> AppPortalAccessOut { + AppPortalAccessOut { + token, + url, + } + } + } + diff --git a/rust/src/models/app_usage_stats_in.rs b/rust/src/models/app_usage_stats_in.rs new file mode 100644 index 000000000..956eb450e --- /dev/null +++ b/rust/src/models/app_usage_stats_in.rs @@ -0,0 +1,36 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AppUsageStatsIn { + /// Specific app IDs or UIDs to aggregate stats for. Note that if none of the given IDs or UIDs are resolved, a 422 response will be given. + #[serde(rename = "appIds", skip_serializing_if = "Option::is_none")] + pub app_ids: Option>, + #[serde(rename = "since")] + pub since: String, + #[serde(rename = "until")] + pub until: String, + } + + impl AppUsageStatsIn { + pub fn new(since: String, until: String) -> AppUsageStatsIn { + AppUsageStatsIn { + app_ids: None, + since, + until, + } + } + } + diff --git a/rust/src/models/app_usage_stats_out.rs b/rust/src/models/app_usage_stats_out.rs new file mode 100644 index 000000000..3fd517051 --- /dev/null +++ b/rust/src/models/app_usage_stats_out.rs @@ -0,0 +1,39 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AppUsageStatsOut { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: models::BackgroundTaskStatus, + #[serde(rename = "task")] + pub task: models::BackgroundTaskType, + /// Any app IDs or UIDs received in the request that weren't found. Stats will be produced for all the others. + #[serde(rename = "unresolvedAppIds")] + pub unresolved_app_ids: Vec, + } + + impl AppUsageStatsOut { + pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType, unresolved_app_ids: Vec) -> AppUsageStatsOut { + AppUsageStatsOut { + id, + status, + task, + unresolved_app_ids, + } + } + } + diff --git a/rust/src/models/application_in.rs b/rust/src/models/application_in.rs new file mode 100644 index 000000000..aac8f4fb4 --- /dev/null +++ b/rust/src/models/application_in.rs @@ -0,0 +1,39 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ApplicationIn { + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// Optional unique identifier for the application. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + } + + impl ApplicationIn { + pub fn new(name: String) -> ApplicationIn { + ApplicationIn { + metadata: None, + name, + rate_limit: None, + uid: None, + } + } + } + diff --git a/rust/src/models/application_out.rs b/rust/src/models/application_out.rs new file mode 100644 index 000000000..97255d7a1 --- /dev/null +++ b/rust/src/models/application_out.rs @@ -0,0 +1,49 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ApplicationOut { + #[serde(rename = "createdAt")] + pub created_at: String, + /// The app's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "metadata")] + pub metadata: std::collections::HashMap, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// The app's UID + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "updatedAt")] + pub updated_at: String, + } + + impl ApplicationOut { + pub fn new(created_at: String, id: String, metadata: std::collections::HashMap, name: String, updated_at: String) -> ApplicationOut { + ApplicationOut { + created_at, + id, + metadata, + name, + rate_limit: None, + uid: None, + updated_at, + } + } + } + diff --git a/rust/src/models/application_patch.rs b/rust/src/models/application_patch.rs new file mode 100644 index 000000000..5b97ea7e0 --- /dev/null +++ b/rust/src/models/application_patch.rs @@ -0,0 +1,39 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ApplicationPatch { + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "rateLimit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option>, + /// The app's UID + #[serde(rename = "uid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub uid: Option>, + } + + impl ApplicationPatch { + pub fn new() -> ApplicationPatch { + ApplicationPatch { + metadata: None, + name: None, + rate_limit: None, + uid: None, + } + } + } + diff --git a/rust/src/models/application_stats.rs b/rust/src/models/application_stats.rs new file mode 100644 index 000000000..2a22c301a --- /dev/null +++ b/rust/src/models/application_stats.rs @@ -0,0 +1,37 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ApplicationStats { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + #[serde(rename = "messageDestinations")] + pub message_destinations: i32, + } + + impl ApplicationStats { + pub fn new(app_id: String, message_destinations: i32) -> ApplicationStats { + ApplicationStats { + app_id, + app_uid: None, + message_destinations, + } + } + } + diff --git a/rust/src/models/application_token_expire_in.rs b/rust/src/models/application_token_expire_in.rs new file mode 100644 index 000000000..592c4d07e --- /dev/null +++ b/rust/src/models/application_token_expire_in.rs @@ -0,0 +1,30 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ApplicationTokenExpireIn { + /// How many seconds until the old key is expired. + #[serde(rename = "expiry", skip_serializing_if = "Option::is_none")] + pub expiry: Option, + } + + impl ApplicationTokenExpireIn { + pub fn new() -> ApplicationTokenExpireIn { + ApplicationTokenExpireIn { + expiry: None, + } + } + } + diff --git a/rust/src/models/attempt_statistics_data.rs b/rust/src/models/attempt_statistics_data.rs new file mode 100644 index 000000000..c240d29ce --- /dev/null +++ b/rust/src/models/attempt_statistics_data.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AttemptStatisticsData { + #[serde(rename = "failureCount", skip_serializing_if = "Option::is_none")] + pub failure_count: Option>, + #[serde(rename = "successCount", skip_serializing_if = "Option::is_none")] + pub success_count: Option>, + } + + impl AttemptStatisticsData { + pub fn new() -> AttemptStatisticsData { + AttemptStatisticsData { + failure_count: None, + success_count: None, + } + } + } + diff --git a/rust/src/models/attempt_statistics_response.rs b/rust/src/models/attempt_statistics_response.rs new file mode 100644 index 000000000..671cb517a --- /dev/null +++ b/rust/src/models/attempt_statistics_response.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AttemptStatisticsResponse { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "endDate")] + pub end_date: String, + #[serde(rename = "period")] + pub period: models::StatisticsPeriod, + #[serde(rename = "startDate")] + pub start_date: String, + } + + impl AttemptStatisticsResponse { + pub fn new(data: models::AttemptStatisticsData, end_date: String, period: models::StatisticsPeriod, start_date: String) -> AttemptStatisticsResponse { + AttemptStatisticsResponse { + data: Box::new(data), + end_date, + period, + start_date, + } + } + } + diff --git a/rust/src/models/auth_token_out.rs b/rust/src/models/auth_token_out.rs new file mode 100644 index 000000000..f12ea1585 --- /dev/null +++ b/rust/src/models/auth_token_out.rs @@ -0,0 +1,45 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AuthTokenOut { + #[serde(rename = "createdAt")] + pub created_at: String, + #[serde(rename = "expiresAt", skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// The key's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] + pub scopes: Option>, + #[serde(rename = "token")] + pub token: String, + } + + impl AuthTokenOut { + pub fn new(created_at: String, id: String, token: String) -> AuthTokenOut { + AuthTokenOut { + created_at, + expires_at: None, + id, + name: None, + scopes: None, + token, + } + } + } + diff --git a/rust/src/models/azure_blob_storage_config.rs b/rust/src/models/azure_blob_storage_config.rs new file mode 100644 index 000000000..bcf8c7871 --- /dev/null +++ b/rust/src/models/azure_blob_storage_config.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct AzureBlobStorageConfig { + #[serde(rename = "accessKey")] + pub access_key: String, + #[serde(rename = "account")] + pub account: String, + #[serde(rename = "container")] + pub container: String, + } + + impl AzureBlobStorageConfig { + pub fn new(access_key: String, account: String, container: String) -> AzureBlobStorageConfig { + AzureBlobStorageConfig { + access_key, + account, + container, + } + } + } + diff --git a/rust/src/models/background_task_out.rs b/rust/src/models/background_task_out.rs new file mode 100644 index 000000000..29ae750ad --- /dev/null +++ b/rust/src/models/background_task_out.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct BackgroundTaskOut { + #[serde(rename = "data")] + pub data: serde_json::Value, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: models::BackgroundTaskStatus, + #[serde(rename = "task")] + pub task: models::BackgroundTaskType, + } + + impl BackgroundTaskOut { + pub fn new(data: serde_json::Value, id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType) -> BackgroundTaskOut { + BackgroundTaskOut { + data, + id, + status, + task, + } + } + } + diff --git a/rust/src/models/background_task_status.rs b/rust/src/models/background_task_status.rs new file mode 100644 index 000000000..84d71b290 --- /dev/null +++ b/rust/src/models/background_task_status.rs @@ -0,0 +1,43 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum BackgroundTaskStatus { + #[serde(rename = "running")] + Running, + #[serde(rename = "finished")] + Finished, + #[serde(rename = "failed")] + Failed, + + } + + impl std::fmt::Display for BackgroundTaskStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Running => write!(f, "running"), + Self::Finished => write!(f, "finished"), + Self::Failed => write!(f, "failed"), + } + } + } + + impl Default for BackgroundTaskStatus { + fn default() -> BackgroundTaskStatus { + Self::Running + } + } + diff --git a/rust/src/models/background_task_type.rs b/rust/src/models/background_task_type.rs new file mode 100644 index 000000000..89b2770fa --- /dev/null +++ b/rust/src/models/background_task_type.rs @@ -0,0 +1,52 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum BackgroundTaskType { + #[serde(rename = "endpoint.replay")] + EndpointPeriodReplay, + #[serde(rename = "endpoint.recover")] + EndpointPeriodRecover, + #[serde(rename = "application.stats")] + ApplicationPeriodStats, + #[serde(rename = "message.broadcast")] + MessagePeriodBroadcast, + #[serde(rename = "sdk.generate")] + SdkPeriodGenerate, + #[serde(rename = "event-type.aggregate")] + EventTypePeriodAggregate, + + } + + impl std::fmt::Display for BackgroundTaskType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::EndpointPeriodReplay => write!(f, "endpoint.replay"), + Self::EndpointPeriodRecover => write!(f, "endpoint.recover"), + Self::ApplicationPeriodStats => write!(f, "application.stats"), + Self::MessagePeriodBroadcast => write!(f, "message.broadcast"), + Self::SdkPeriodGenerate => write!(f, "sdk.generate"), + Self::EventTypePeriodAggregate => write!(f, "event-type.aggregate"), + } + } + } + + impl Default for BackgroundTaskType { + fn default() -> BackgroundTaskType { + Self::EndpointPeriodReplay + } + } + diff --git a/rust/src/models/big_query_config.rs b/rust/src/models/big_query_config.rs new file mode 100644 index 000000000..75ee5fecd --- /dev/null +++ b/rust/src/models/big_query_config.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// BigQueryConfig : Configuration for a Google Cloud BigQuery sink. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct BigQueryConfig { + /// Google Cloud Credentials JSON Object as a string. + #[serde(rename = "credentials")] + pub credentials: String, + #[serde(rename = "datasetId")] + pub dataset_id: String, + #[serde(rename = "projectId")] + pub project_id: String, + #[serde(rename = "tableId")] + pub table_id: String, + } + + impl BigQueryConfig { + /// Configuration for a Google Cloud BigQuery sink. + pub fn new(credentials: String, dataset_id: String, project_id: String, table_id: String) -> BigQueryConfig { + BigQueryConfig { + credentials, + dataset_id, + project_id, + table_id, + } + } + } + diff --git a/rust/src/models/border_radius_config.rs b/rust/src/models/border_radius_config.rs new file mode 100644 index 000000000..c429a1387 --- /dev/null +++ b/rust/src/models/border_radius_config.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct BorderRadiusConfig { + #[serde(rename = "button", skip_serializing_if = "Option::is_none")] + pub button: Option, + #[serde(rename = "card", skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(rename = "input", skip_serializing_if = "Option::is_none")] + pub input: Option, + } + + impl BorderRadiusConfig { + pub fn new() -> BorderRadiusConfig { + BorderRadiusConfig { + button: None, + card: None, + input: None, + } + } + } + diff --git a/rust/src/models/border_radius_enum.rs b/rust/src/models/border_radius_enum.rs new file mode 100644 index 000000000..31b02997e --- /dev/null +++ b/rust/src/models/border_radius_enum.rs @@ -0,0 +1,49 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum BorderRadiusEnum { + #[serde(rename = "none")] + None, + #[serde(rename = "lg")] + Lg, + #[serde(rename = "md")] + Md, + #[serde(rename = "sm")] + Sm, + #[serde(rename = "full")] + Full, + + } + + impl std::fmt::Display for BorderRadiusEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::None => write!(f, "none"), + Self::Lg => write!(f, "lg"), + Self::Md => write!(f, "md"), + Self::Sm => write!(f, "sm"), + Self::Full => write!(f, "full"), + } + } + } + + impl Default for BorderRadiusEnum { + fn default() -> BorderRadiusEnum { + Self::None + } + } + diff --git a/rust/src/models/client_secret_jwt_params_in.rs b/rust/src/models/client_secret_jwt_params_in.rs new file mode 100644 index 000000000..d6e613312 --- /dev/null +++ b/rust/src/models/client_secret_jwt_params_in.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ClientSecretJwtParamsIn { + /// The base64-encoded secret used for signing the JWT. + #[serde(rename = "secretBase64")] + pub secret_base64: String, + /// Optional secret identifier. If supplied, this will be populated in the JWT header in the `kid` field. + #[serde(rename = "secretId", skip_serializing_if = "Option::is_none")] + pub secret_id: Option, + #[serde(rename = "signingAlgorithm")] + pub signing_algorithm: models::OauthJwsSigningAlgorithm, + /// Optional number of seconds after which the JWT should expire. Defaults to 300 seconds. + #[serde(rename = "tokenExpirySecs", skip_serializing_if = "Option::is_none")] + pub token_expiry_secs: Option, + } + + impl ClientSecretJwtParamsIn { + pub fn new(secret_base64: String, signing_algorithm: models::OauthJwsSigningAlgorithm) -> ClientSecretJwtParamsIn { + ClientSecretJwtParamsIn { + secret_base64, + secret_id: None, + signing_algorithm, + token_expiry_secs: None, + } + } + } + diff --git a/rust/src/models/completion_choice.rs b/rust/src/models/completion_choice.rs new file mode 100644 index 000000000..6829a81a0 --- /dev/null +++ b/rust/src/models/completion_choice.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CompletionChoice { + #[serde(rename = "finish_reason")] + pub finish_reason: String, + #[serde(rename = "index")] + pub index: i64, + #[serde(rename = "message")] + pub message: Box, + } + + impl CompletionChoice { + pub fn new(finish_reason: String, index: i64, message: models::CompletionMessage) -> CompletionChoice { + CompletionChoice { + finish_reason, + index, + message: Box::new(message), + } + } + } + diff --git a/rust/src/models/completion_message.rs b/rust/src/models/completion_message.rs new file mode 100644 index 000000000..0ac2a1ed7 --- /dev/null +++ b/rust/src/models/completion_message.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CompletionMessage { + #[serde(rename = "content")] + pub content: String, + #[serde(rename = "role")] + pub role: String, + } + + impl CompletionMessage { + pub fn new(content: String, role: String) -> CompletionMessage { + CompletionMessage { + content, + role, + } + } + } + diff --git a/rust/src/models/count_out.rs b/rust/src/models/count_out.rs new file mode 100644 index 000000000..b42258883 --- /dev/null +++ b/rust/src/models/count_out.rs @@ -0,0 +1,34 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CountOut { + /// There's a ceiling to how many attempts we count. When the limit is reached, this will be `true` to indicate the actual count is higher than given. + #[serde(rename = "approximated")] + pub approximated: bool, + /// The count of attempts matching the query. + #[serde(rename = "count")] + pub count: i32, + } + + impl CountOut { + pub fn new(approximated: bool, count: i32) -> CountOut { + CountOut { + approximated, + count, + } + } + } + diff --git a/rust/src/models/create_stream_in.rs b/rust/src/models/create_stream_in.rs new file mode 100644 index 000000000..0027c0cb1 --- /dev/null +++ b/rust/src/models/create_stream_in.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CreateStreamIn { + #[serde(rename = "messages")] + pub messages: Vec, + #[serde(rename = "stream", skip_serializing_if = "Option::is_none")] + pub stream: Option>, + } + + impl CreateStreamIn { + pub fn new(messages: Vec) -> CreateStreamIn { + CreateStreamIn { + messages, + stream: None, + } + } + } + diff --git a/rust/src/models/create_token_in.rs b/rust/src/models/create_token_in.rs new file mode 100644 index 000000000..e010e00e4 --- /dev/null +++ b/rust/src/models/create_token_in.rs @@ -0,0 +1,34 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CreateTokenIn { + /// How long the token will be valid for, in seconds. + #[serde(rename = "expiry", skip_serializing_if = "Option::is_none")] + pub expiry: Option, + /// The name of the token. + #[serde(rename = "name")] + pub name: String, + } + + impl CreateTokenIn { + pub fn new(name: String) -> CreateTokenIn { + CreateTokenIn { + expiry: None, + name, + } + } + } + diff --git a/rust/src/models/custom_color_palette.rs b/rust/src/models/custom_color_palette.rs new file mode 100644 index 000000000..e6cafb07b --- /dev/null +++ b/rust/src/models/custom_color_palette.rs @@ -0,0 +1,53 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CustomColorPalette { + #[serde(rename = "backgroundHover", skip_serializing_if = "Option::is_none")] + pub background_hover: Option, + #[serde(rename = "backgroundPrimary", skip_serializing_if = "Option::is_none")] + pub background_primary: Option, + #[serde(rename = "backgroundSecondary", skip_serializing_if = "Option::is_none")] + pub background_secondary: Option, + #[serde(rename = "buttonPrimary", skip_serializing_if = "Option::is_none")] + pub button_primary: Option, + #[serde(rename = "interactiveAccent", skip_serializing_if = "Option::is_none")] + pub interactive_accent: Option, + #[serde(rename = "navigationAccent", skip_serializing_if = "Option::is_none")] + pub navigation_accent: Option, + #[serde(rename = "primary", skip_serializing_if = "Option::is_none")] + pub primary: Option, + #[serde(rename = "textDanger", skip_serializing_if = "Option::is_none")] + pub text_danger: Option, + #[serde(rename = "textPrimary", skip_serializing_if = "Option::is_none")] + pub text_primary: Option, + } + + impl CustomColorPalette { + pub fn new() -> CustomColorPalette { + CustomColorPalette { + background_hover: None, + background_primary: None, + background_secondary: None, + button_primary: None, + interactive_accent: None, + navigation_accent: None, + primary: None, + text_danger: None, + text_primary: None, + } + } + } + diff --git a/rust/src/models/custom_strings_override.rs b/rust/src/models/custom_strings_override.rs new file mode 100644 index 000000000..18ce090df --- /dev/null +++ b/rust/src/models/custom_strings_override.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CustomStringsOverride { + #[serde(rename = "channelsHelp", skip_serializing_if = "Option::is_none")] + pub channels_help: Option, + #[serde(rename = "channelsMany", skip_serializing_if = "Option::is_none")] + pub channels_many: Option, + #[serde(rename = "channelsOne", skip_serializing_if = "Option::is_none")] + pub channels_one: Option, + } + + impl CustomStringsOverride { + pub fn new() -> CustomStringsOverride { + CustomStringsOverride { + channels_help: None, + channels_many: None, + channels_one: None, + } + } + } + diff --git a/rust/src/models/custom_theme_override.rs b/rust/src/models/custom_theme_override.rs new file mode 100644 index 000000000..4f7d79803 --- /dev/null +++ b/rust/src/models/custom_theme_override.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct CustomThemeOverride { + #[serde(rename = "borderRadius", skip_serializing_if = "Option::is_none")] + pub border_radius: Option>, + #[serde(rename = "fontSize", skip_serializing_if = "Option::is_none")] + pub font_size: Option>, + } + + impl CustomThemeOverride { + pub fn new() -> CustomThemeOverride { + CustomThemeOverride { + border_radius: None, + font_size: None, + } + } + } + diff --git a/rust/src/models/dashboard_access_out.rs b/rust/src/models/dashboard_access_out.rs new file mode 100644 index 000000000..a3a198775 --- /dev/null +++ b/rust/src/models/dashboard_access_out.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct DashboardAccessOut { + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "url")] + pub url: String, + } + + impl DashboardAccessOut { + pub fn new(token: String, url: String) -> DashboardAccessOut { + DashboardAccessOut { + token, + url, + } + } + } + diff --git a/rust/src/models/duration.rs b/rust/src/models/duration.rs new file mode 100644 index 000000000..9c623f0ae --- /dev/null +++ b/rust/src/models/duration.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct Duration { + #[serde(rename = "nanos")] + pub nanos: i32, + #[serde(rename = "secs")] + pub secs: i32, + } + + impl Duration { + pub fn new(nanos: i32, secs: i32) -> Duration { + Duration { + nanos, + secs, + } + } + } + diff --git a/rust/src/models/endpoint_created_event.rs b/rust/src/models/endpoint_created_event.rs new file mode 100644 index 000000000..2ff50559a --- /dev/null +++ b/rust/src/models/endpoint_created_event.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointCreatedEvent : Sent when an endpoint is created. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointCreatedEvent { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl EndpointCreatedEvent { + /// Sent when an endpoint is created. + pub fn new(data: models::EndpointCreatedEventData, r#type: Type) -> EndpointCreatedEvent { + EndpointCreatedEvent { + data: Box::new(data), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "endpoint.created")] + EndpointPeriodCreated, + } + + impl Default for Type { + fn default() -> Type { + Self::EndpointPeriodCreated + } + } + diff --git a/rust/src/models/endpoint_created_event_data.rs b/rust/src/models/endpoint_created_event_data.rs new file mode 100644 index 000000000..03283027e --- /dev/null +++ b/rust/src/models/endpoint_created_event_data.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointCreatedEventData : Sent when an endpoint is created, updated, or deleted + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointCreatedEventData { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + /// The ep's UID + #[serde(rename = "endpointUid", skip_serializing_if = "Option::is_none")] + pub endpoint_uid: Option, + } + + impl EndpointCreatedEventData { + /// Sent when an endpoint is created, updated, or deleted + pub fn new(app_id: String, endpoint_id: String) -> EndpointCreatedEventData { + EndpointCreatedEventData { + app_id, + app_uid: None, + endpoint_id, + endpoint_uid: None, + } + } + } + diff --git a/rust/src/models/endpoint_deleted_event.rs b/rust/src/models/endpoint_deleted_event.rs new file mode 100644 index 000000000..0857081f3 --- /dev/null +++ b/rust/src/models/endpoint_deleted_event.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointDeletedEvent : Sent when an endpoint is deleted. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointDeletedEvent { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl EndpointDeletedEvent { + /// Sent when an endpoint is deleted. + pub fn new(data: models::EndpointDeletedEventData, r#type: Type) -> EndpointDeletedEvent { + EndpointDeletedEvent { + data: Box::new(data), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "endpoint.deleted")] + EndpointPeriodDeleted, + } + + impl Default for Type { + fn default() -> Type { + Self::EndpointPeriodDeleted + } + } + diff --git a/rust/src/models/endpoint_deleted_event_data.rs b/rust/src/models/endpoint_deleted_event_data.rs new file mode 100644 index 000000000..a72b4d62c --- /dev/null +++ b/rust/src/models/endpoint_deleted_event_data.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointDeletedEventData : Sent when an endpoint is created, updated, or deleted + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointDeletedEventData { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + /// The ep's UID + #[serde(rename = "endpointUid", skip_serializing_if = "Option::is_none")] + pub endpoint_uid: Option, + } + + impl EndpointDeletedEventData { + /// Sent when an endpoint is created, updated, or deleted + pub fn new(app_id: String, endpoint_id: String) -> EndpointDeletedEventData { + EndpointDeletedEventData { + app_id, + app_uid: None, + endpoint_id, + endpoint_uid: None, + } + } + } + diff --git a/rust/src/models/endpoint_disabled_event.rs b/rust/src/models/endpoint_disabled_event.rs new file mode 100644 index 000000000..ffebac78f --- /dev/null +++ b/rust/src/models/endpoint_disabled_event.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointDisabledEvent : Sent when an endpoint has been automatically disabled after continuous failures. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointDisabledEvent { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl EndpointDisabledEvent { + /// Sent when an endpoint has been automatically disabled after continuous failures. + pub fn new(data: models::EndpointDisabledEventData, r#type: Type) -> EndpointDisabledEvent { + EndpointDisabledEvent { + data: Box::new(data), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "endpoint.disabled")] + EndpointPeriodDisabled, + } + + impl Default for Type { + fn default() -> Type { + Self::EndpointPeriodDisabled + } + } + diff --git a/rust/src/models/endpoint_disabled_event_data.rs b/rust/src/models/endpoint_disabled_event_data.rs new file mode 100644 index 000000000..d8e03dec3 --- /dev/null +++ b/rust/src/models/endpoint_disabled_event_data.rs @@ -0,0 +1,47 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointDisabledEventData : Sent when an endpoint has been automatically disabled after continuous failures. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointDisabledEventData { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + /// The ep's UID + #[serde(rename = "endpointUid", skip_serializing_if = "Option::is_none")] + pub endpoint_uid: Option, + #[serde(rename = "failSince")] + pub fail_since: String, + } + + impl EndpointDisabledEventData { + /// Sent when an endpoint has been automatically disabled after continuous failures. + pub fn new(app_id: String, endpoint_id: String, fail_since: String) -> EndpointDisabledEventData { + EndpointDisabledEventData { + app_id, + app_uid: None, + endpoint_id, + endpoint_uid: None, + fail_since, + } + } + } + diff --git a/rust/src/models/endpoint_headers_in.rs b/rust/src/models/endpoint_headers_in.rs new file mode 100644 index 000000000..61357862e --- /dev/null +++ b/rust/src/models/endpoint_headers_in.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointHeadersIn { + #[serde(rename = "headers")] + pub headers: std::collections::HashMap, + } + + impl EndpointHeadersIn { + pub fn new(headers: std::collections::HashMap) -> EndpointHeadersIn { + EndpointHeadersIn { + headers, + } + } + } + diff --git a/rust/src/models/endpoint_headers_out.rs b/rust/src/models/endpoint_headers_out.rs new file mode 100644 index 000000000..d3145c793 --- /dev/null +++ b/rust/src/models/endpoint_headers_out.rs @@ -0,0 +1,34 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointHeadersOut : The value of the headers is returned in the `headers` field. Sensitive headers that have been redacted are returned in the sensitive field. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointHeadersOut { + #[serde(rename = "headers")] + pub headers: std::collections::HashMap, + #[serde(rename = "sensitive")] + pub sensitive: Vec, + } + + impl EndpointHeadersOut { + /// The value of the headers is returned in the `headers` field. Sensitive headers that have been redacted are returned in the sensitive field. + pub fn new(headers: std::collections::HashMap, sensitive: Vec) -> EndpointHeadersOut { + EndpointHeadersOut { + headers, + sensitive, + } + } + } + diff --git a/rust/src/models/endpoint_headers_patch_in.rs b/rust/src/models/endpoint_headers_patch_in.rs new file mode 100644 index 000000000..3bc5d983b --- /dev/null +++ b/rust/src/models/endpoint_headers_patch_in.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointHeadersPatchIn { + #[serde(rename = "headers")] + pub headers: std::collections::HashMap, + } + + impl EndpointHeadersPatchIn { + pub fn new(headers: std::collections::HashMap) -> EndpointHeadersPatchIn { + EndpointHeadersPatchIn { + headers, + } + } + } + diff --git a/rust/src/models/endpoint_in.rs b/rust/src/models/endpoint_in.rs new file mode 100644 index 000000000..b015de456 --- /dev/null +++ b/rust/src/models/endpoint_in.rs @@ -0,0 +1,59 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointIn { + /// List of message channels this endpoint listens to (omit for all). + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, + /// Optional unique identifier for the endpoint. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "url")] + pub url: String, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + } + + impl EndpointIn { + pub fn new(url: String) -> EndpointIn { + EndpointIn { + channels: None, + description: None, + disabled: None, + filter_types: None, + metadata: None, + rate_limit: None, + secret: None, + uid: None, + url, + version: None, + } + } + } + diff --git a/rust/src/models/endpoint_message_out.rs b/rust/src/models/endpoint_message_out.rs new file mode 100644 index 000000000..fd3c7a264 --- /dev/null +++ b/rust/src/models/endpoint_message_out.rs @@ -0,0 +1,59 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointMessageOut : A model containing information on a given message plus additional fields on the last attempt for that message. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointMessageOut { + /// List of free-form identifiers that endpoints can filter by + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + /// Optional unique identifier for the message + #[serde(rename = "eventId", skip_serializing_if = "Option::is_none")] + pub event_id: Option, + /// The event type's name + #[serde(rename = "eventType")] + pub event_type: String, + /// The msg's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "nextAttempt", skip_serializing_if = "Option::is_none")] + pub next_attempt: Option, + #[serde(rename = "payload")] + pub payload: serde_json::Value, + #[serde(rename = "status")] + pub status: models::MessageStatus, + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "timestamp")] + pub timestamp: String, + } + + impl EndpointMessageOut { + /// A model containing information on a given message plus additional fields on the last attempt for that message. + pub fn new(event_type: String, id: String, payload: serde_json::Value, status: models::MessageStatus, timestamp: String) -> EndpointMessageOut { + EndpointMessageOut { + channels: None, + event_id: None, + event_type, + id, + next_attempt: None, + payload, + status, + tags: None, + timestamp, + } + } + } + diff --git a/rust/src/models/endpoint_mtls_config_in.rs b/rust/src/models/endpoint_mtls_config_in.rs new file mode 100644 index 000000000..5ea408bda --- /dev/null +++ b/rust/src/models/endpoint_mtls_config_in.rs @@ -0,0 +1,34 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointMtlsConfigIn { + /// A PEM encoded private key and X509 certificate to identify the webhook sender. + #[serde(rename = "identity")] + pub identity: String, + /// A PEM encoded X509 certificate used to verify the webhook receiver's certificate. + #[serde(rename = "serverCaCert", skip_serializing_if = "Option::is_none")] + pub server_ca_cert: Option, + } + + impl EndpointMtlsConfigIn { + pub fn new(identity: String) -> EndpointMtlsConfigIn { + EndpointMtlsConfigIn { + identity, + server_ca_cert: None, + } + } + } + diff --git a/rust/src/models/endpoint_oauth_config_in.rs b/rust/src/models/endpoint_oauth_config_in.rs new file mode 100644 index 000000000..53fa56b88 --- /dev/null +++ b/rust/src/models/endpoint_oauth_config_in.rs @@ -0,0 +1,59 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointOauthConfigIn { + #[serde(rename = "authMethod")] + pub auth_method: models::Oauth2AuthMethodIn, + /// The client ID. Required for all authentication types. + #[serde(rename = "clientId")] + pub client_id: String, + /// Optional client secret. This is only used for `clientSecretBasic` and `clientSecretPost`. For `clientSecretBasic`, the secret will be appended to the `Authorization` header. For `clientSecretPost`, this will be added to the body in a `client_secret` parameter. + #[serde(rename = "clientSecret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + /// Extra parameters added to the request body as key-value pairs. + #[serde(rename = "extraParams", skip_serializing_if = "Option::is_none")] + pub extra_params: Option>, + #[serde(rename = "grantType")] + pub grant_type: models::Oauth2GrantTypeIn, + #[serde(rename = "jwtParams", skip_serializing_if = "Option::is_none")] + pub jwt_params: Option>, + /// For `refreshToken` grant type. + #[serde(rename = "refreshToken", skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + /// Optional OAuth scopes added to the request body. + #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] + pub scopes: Option>, + /// The URL of the authorization server. + #[serde(rename = "tokenUrl")] + pub token_url: String, + } + + impl EndpointOauthConfigIn { + pub fn new(auth_method: models::Oauth2AuthMethodIn, client_id: String, grant_type: models::Oauth2GrantTypeIn, token_url: String) -> EndpointOauthConfigIn { + EndpointOauthConfigIn { + auth_method, + client_id, + client_secret: None, + extra_params: None, + grant_type, + jwt_params: None, + refresh_token: None, + scopes: None, + token_url, + } + } + } + diff --git a/rust/src/models/endpoint_out.rs b/rust/src/models/endpoint_out.rs new file mode 100644 index 000000000..53bb6ef03 --- /dev/null +++ b/rust/src/models/endpoint_out.rs @@ -0,0 +1,66 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointOut { + /// List of message channels this endpoint listens to (omit for all). + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + #[serde(rename = "createdAt")] + pub created_at: String, + /// An example endpoint name. + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + /// The ep's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "metadata")] + pub metadata: std::collections::HashMap, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// Optional unique identifier for the endpoint. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "updatedAt")] + pub updated_at: String, + #[serde(rename = "url")] + pub url: String, + #[serde(rename = "version")] + pub version: i32, + } + + impl EndpointOut { + pub fn new(created_at: String, description: String, id: String, metadata: std::collections::HashMap, updated_at: String, url: String, version: i32) -> EndpointOut { + EndpointOut { + channels: None, + created_at, + description, + disabled: None, + filter_types: None, + id, + metadata, + rate_limit: None, + uid: None, + updated_at, + url, + version, + } + } + } + diff --git a/rust/src/models/endpoint_patch.rs b/rust/src/models/endpoint_patch.rs new file mode 100644 index 000000000..999cac9f6 --- /dev/null +++ b/rust/src/models/endpoint_patch.rs @@ -0,0 +1,58 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointPatch { + #[serde(rename = "channels", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub channels: Option>>, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>>, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + #[serde(rename = "rateLimit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option>, + /// The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret. + #[serde(rename = "secret", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub secret: Option>, + /// The ep's UID + #[serde(rename = "uid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub uid: Option>, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + } + + impl EndpointPatch { + pub fn new() -> EndpointPatch { + EndpointPatch { + channels: None, + description: None, + disabled: None, + filter_types: None, + metadata: None, + rate_limit: None, + secret: None, + uid: None, + url: None, + version: None, + } + } + } + diff --git a/rust/src/models/endpoint_secret_out.rs b/rust/src/models/endpoint_secret_out.rs new file mode 100644 index 000000000..ef80d9709 --- /dev/null +++ b/rust/src/models/endpoint_secret_out.rs @@ -0,0 +1,30 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointSecretOut { + /// The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret. + #[serde(rename = "key")] + pub key: String, + } + + impl EndpointSecretOut { + pub fn new(key: String) -> EndpointSecretOut { + EndpointSecretOut { + key, + } + } + } + diff --git a/rust/src/models/endpoint_secret_rotate_in.rs b/rust/src/models/endpoint_secret_rotate_in.rs new file mode 100644 index 000000000..164c0b5f1 --- /dev/null +++ b/rust/src/models/endpoint_secret_rotate_in.rs @@ -0,0 +1,30 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointSecretRotateIn { + /// The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret. + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + } + + impl EndpointSecretRotateIn { + pub fn new() -> EndpointSecretRotateIn { + EndpointSecretRotateIn { + key: None, + } + } + } + diff --git a/rust/src/models/endpoint_stats.rs b/rust/src/models/endpoint_stats.rs new file mode 100644 index 000000000..8f7a1e824 --- /dev/null +++ b/rust/src/models/endpoint_stats.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointStats { + #[serde(rename = "fail")] + pub fail: i64, + #[serde(rename = "pending")] + pub pending: i64, + #[serde(rename = "sending")] + pub sending: i64, + #[serde(rename = "success")] + pub success: i64, + } + + impl EndpointStats { + pub fn new(fail: i64, pending: i64, sending: i64, success: i64) -> EndpointStats { + EndpointStats { + fail, + pending, + sending, + success, + } + } + } + diff --git a/rust/src/models/endpoint_transformation_in.rs b/rust/src/models/endpoint_transformation_in.rs new file mode 100644 index 000000000..332b7a5d8 --- /dev/null +++ b/rust/src/models/endpoint_transformation_in.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointTransformationIn { + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + + impl EndpointTransformationIn { + pub fn new() -> EndpointTransformationIn { + EndpointTransformationIn { + code: None, + enabled: None, + } + } + } + diff --git a/rust/src/models/endpoint_transformation_out.rs b/rust/src/models/endpoint_transformation_out.rs new file mode 100644 index 000000000..e3fb3d9ed --- /dev/null +++ b/rust/src/models/endpoint_transformation_out.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointTransformationOut { + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + + impl EndpointTransformationOut { + pub fn new() -> EndpointTransformationOut { + EndpointTransformationOut { + code: None, + enabled: None, + } + } + } + diff --git a/rust/src/models/endpoint_transformation_simulate_in.rs b/rust/src/models/endpoint_transformation_simulate_in.rs new file mode 100644 index 000000000..94f37a764 --- /dev/null +++ b/rust/src/models/endpoint_transformation_simulate_in.rs @@ -0,0 +1,39 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointTransformationSimulateIn { + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + #[serde(rename = "code")] + pub code: String, + /// The event type's name + #[serde(rename = "eventType")] + pub event_type: String, + #[serde(rename = "payload")] + pub payload: serde_json::Value, + } + + impl EndpointTransformationSimulateIn { + pub fn new(code: String, event_type: String, payload: serde_json::Value) -> EndpointTransformationSimulateIn { + EndpointTransformationSimulateIn { + channels: None, + code, + event_type, + payload, + } + } + } + diff --git a/rust/src/models/endpoint_transformation_simulate_out.rs b/rust/src/models/endpoint_transformation_simulate_out.rs new file mode 100644 index 000000000..6e722f0fd --- /dev/null +++ b/rust/src/models/endpoint_transformation_simulate_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointTransformationSimulateOut { + #[serde(rename = "method", skip_serializing_if = "Option::is_none")] + pub method: Option, + #[serde(rename = "payload")] + pub payload: String, + #[serde(rename = "url")] + pub url: String, + } + + impl EndpointTransformationSimulateOut { + pub fn new(payload: String, url: String) -> EndpointTransformationSimulateOut { + EndpointTransformationSimulateOut { + method: None, + payload, + url, + } + } + } + diff --git a/rust/src/models/endpoint_update.rs b/rust/src/models/endpoint_update.rs new file mode 100644 index 000000000..85efa00d3 --- /dev/null +++ b/rust/src/models/endpoint_update.rs @@ -0,0 +1,55 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointUpdate { + /// List of message channels this endpoint listens to (omit for all). + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// Optional unique identifier for the endpoint. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "url")] + pub url: String, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + } + + impl EndpointUpdate { + pub fn new(url: String) -> EndpointUpdate { + EndpointUpdate { + channels: None, + description: None, + disabled: None, + filter_types: None, + metadata: None, + rate_limit: None, + uid: None, + url, + version: None, + } + } + } + diff --git a/rust/src/models/endpoint_updated_event.rs b/rust/src/models/endpoint_updated_event.rs new file mode 100644 index 000000000..4c650435b --- /dev/null +++ b/rust/src/models/endpoint_updated_event.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointUpdatedEvent : Sent when an endpoint is updated. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointUpdatedEvent { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl EndpointUpdatedEvent { + /// Sent when an endpoint is updated. + pub fn new(data: models::EndpointUpdatedEventData, r#type: Type) -> EndpointUpdatedEvent { + EndpointUpdatedEvent { + data: Box::new(data), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "endpoint.updated")] + EndpointPeriodUpdated, + } + + impl Default for Type { + fn default() -> Type { + Self::EndpointPeriodUpdated + } + } + diff --git a/rust/src/models/endpoint_updated_event_data.rs b/rust/src/models/endpoint_updated_event_data.rs new file mode 100644 index 000000000..11774e277 --- /dev/null +++ b/rust/src/models/endpoint_updated_event_data.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EndpointUpdatedEventData : Sent when an endpoint is created, updated, or deleted + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EndpointUpdatedEventData { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + /// The ep's UID + #[serde(rename = "endpointUid", skip_serializing_if = "Option::is_none")] + pub endpoint_uid: Option, + } + + impl EndpointUpdatedEventData { + /// Sent when an endpoint is created, updated, or deleted + pub fn new(app_id: String, endpoint_id: String) -> EndpointUpdatedEventData { + EndpointUpdatedEventData { + app_id, + app_uid: None, + endpoint_id, + endpoint_uid: None, + } + } + } + diff --git a/rust/src/models/environment_in.rs b/rust/src/models/environment_in.rs new file mode 100644 index 000000000..896ce15ee --- /dev/null +++ b/rust/src/models/environment_in.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EnvironmentIn { + #[serde(rename = "eventTypes", skip_serializing_if = "Option::is_none")] + pub event_types: Option>, + #[serde(rename = "settings", deserialize_with = "Option::deserialize")] + pub settings: Option, + #[serde(rename = "transformationTemplates", skip_serializing_if = "Option::is_none")] + pub transformation_templates: Option>, + } + + impl EnvironmentIn { + pub fn new(settings: Option) -> EnvironmentIn { + EnvironmentIn { + event_types: None, + settings, + transformation_templates: None, + } + } + } + diff --git a/rust/src/models/environment_out.rs b/rust/src/models/environment_out.rs new file mode 100644 index 000000000..09ec79275 --- /dev/null +++ b/rust/src/models/environment_out.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EnvironmentOut { + #[serde(rename = "createdAt")] + pub created_at: String, + #[serde(rename = "eventTypes")] + pub event_types: Vec, + #[serde(rename = "settings", deserialize_with = "Option::deserialize")] + pub settings: Option, + #[serde(rename = "transformationTemplates")] + pub transformation_templates: Vec, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + } + + impl EnvironmentOut { + pub fn new(created_at: String, event_types: Vec, settings: Option, transformation_templates: Vec) -> EnvironmentOut { + EnvironmentOut { + created_at, + event_types, + settings, + transformation_templates, + version: None, + } + } + } + diff --git a/rust/src/models/environment_settings_out.rs b/rust/src/models/environment_settings_out.rs new file mode 100644 index 000000000..20fa3be48 --- /dev/null +++ b/rust/src/models/environment_settings_out.rs @@ -0,0 +1,74 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EnvironmentSettingsOut { + #[serde(rename = "colorPaletteDark", skip_serializing_if = "Option::is_none")] + pub color_palette_dark: Option>, + #[serde(rename = "colorPaletteLight", skip_serializing_if = "Option::is_none")] + pub color_palette_light: Option>, + #[serde(rename = "customColor", skip_serializing_if = "Option::is_none")] + pub custom_color: Option, + #[serde(rename = "customFontFamily", skip_serializing_if = "Option::is_none")] + pub custom_font_family: Option, + #[serde(rename = "customFontFamilyUrl", skip_serializing_if = "Option::is_none")] + pub custom_font_family_url: Option, + #[serde(rename = "customLogoUrl", skip_serializing_if = "Option::is_none")] + pub custom_logo_url: Option, + #[serde(rename = "customStringsOverride", skip_serializing_if = "Option::is_none")] + pub custom_strings_override: Option>, + #[serde(rename = "customThemeOverride", skip_serializing_if = "Option::is_none")] + pub custom_theme_override: Option>, + #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[serde(rename = "enableChannels", skip_serializing_if = "Option::is_none")] + pub enable_channels: Option, + #[serde(rename = "enableIntegrationManagement", skip_serializing_if = "Option::is_none")] + pub enable_integration_management: Option, + #[serde(rename = "enableMessageStream", skip_serializing_if = "Option::is_none")] + pub enable_message_stream: Option, + #[serde(rename = "enableMessageTags", skip_serializing_if = "Option::is_none")] + pub enable_message_tags: Option, + #[serde(rename = "enableTransformations", skip_serializing_if = "Option::is_none")] + pub enable_transformations: Option, + #[serde(rename = "showUseSvixPlay", skip_serializing_if = "Option::is_none")] + pub show_use_svix_play: Option, + #[serde(rename = "wipeSuccessfulPayload", skip_serializing_if = "Option::is_none")] + pub wipe_successful_payload: Option, + } + + impl EnvironmentSettingsOut { + pub fn new() -> EnvironmentSettingsOut { + EnvironmentSettingsOut { + color_palette_dark: None, + color_palette_light: None, + custom_color: None, + custom_font_family: None, + custom_font_family_url: None, + custom_logo_url: None, + custom_strings_override: None, + custom_theme_override: None, + display_name: None, + enable_channels: None, + enable_integration_management: None, + enable_message_stream: None, + enable_message_tags: None, + enable_transformations: None, + show_use_svix_play: None, + wipe_successful_payload: None, + } + } + } + diff --git a/rust/src/models/event_example_in.rs b/rust/src/models/event_example_in.rs new file mode 100644 index 000000000..807818951 --- /dev/null +++ b/rust/src/models/event_example_in.rs @@ -0,0 +1,34 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventExampleIn { + /// The event type's name + #[serde(rename = "eventType")] + pub event_type: String, + /// If the event type schema contains an array of examples, chooses which one to send. Defaults to the first example. Ignored if the schema doesn't contain an array of examples. + #[serde(rename = "exampleIndex", skip_serializing_if = "Option::is_none")] + pub example_index: Option, + } + + impl EventExampleIn { + pub fn new(event_type: String) -> EventExampleIn { + EventExampleIn { + event_type, + example_index: None, + } + } + } + diff --git a/rust/src/models/event_in.rs b/rust/src/models/event_in.rs new file mode 100644 index 000000000..65eef08e1 --- /dev/null +++ b/rust/src/models/event_in.rs @@ -0,0 +1,33 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventIn { + /// The event type's name + #[serde(rename = "eventType", skip_serializing_if = "Option::is_none")] + pub event_type: Option, + #[serde(rename = "payload")] + pub payload: String, + } + + impl EventIn { + pub fn new(payload: String) -> EventIn { + EventIn { + event_type: None, + payload, + } + } + } + diff --git a/rust/src/models/event_out.rs b/rust/src/models/event_out.rs new file mode 100644 index 000000000..7938ade22 --- /dev/null +++ b/rust/src/models/event_out.rs @@ -0,0 +1,36 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventOut { + /// The event type's name + #[serde(rename = "eventType", skip_serializing_if = "Option::is_none")] + pub event_type: Option, + #[serde(rename = "payload")] + pub payload: String, + #[serde(rename = "timestamp")] + pub timestamp: String, + } + + impl EventOut { + pub fn new(payload: String, timestamp: String) -> EventOut { + EventOut { + event_type: None, + payload, + timestamp, + } + } + } + diff --git a/rust/src/models/event_stream_out.rs b/rust/src/models/event_stream_out.rs new file mode 100644 index 000000000..3a96bf1a6 --- /dev/null +++ b/rust/src/models/event_stream_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventStreamOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator")] + pub iterator: String, + } + + impl EventStreamOut { + pub fn new(data: Vec, done: bool, iterator: String) -> EventStreamOut { + EventStreamOut { + data, + done, + iterator, + } + } + } + diff --git a/rust/src/models/event_type_example_out.rs b/rust/src/models/event_type_example_out.rs new file mode 100644 index 000000000..57158dacc --- /dev/null +++ b/rust/src/models/event_type_example_out.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeExampleOut { + #[serde(rename = "example")] + pub example: serde_json::Value, + } + + impl EventTypeExampleOut { + pub fn new(example: serde_json::Value) -> EventTypeExampleOut { + EventTypeExampleOut { + example, + } + } + } + diff --git a/rust/src/models/event_type_from_open_api.rs b/rust/src/models/event_type_from_open_api.rs new file mode 100644 index 000000000..7d23ad3fe --- /dev/null +++ b/rust/src/models/event_type_from_open_api.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeFromOpenApi { + #[serde(rename = "deprecated")] + pub deprecated: bool, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "featureFlag", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + /// The event type group's name + #[serde(rename = "groupName", skip_serializing_if = "Option::is_none")] + pub group_name: Option, + /// The event type's name + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "schemas", skip_serializing_if = "Option::is_none")] + pub schemas: Option, + } + + impl EventTypeFromOpenApi { + pub fn new(deprecated: bool, description: String, name: String) -> EventTypeFromOpenApi { + EventTypeFromOpenApi { + deprecated, + description, + feature_flag: None, + group_name: None, + name, + schemas: None, + } + } + } + diff --git a/rust/src/models/event_type_import_open_api_in.rs b/rust/src/models/event_type_import_open_api_in.rs new file mode 100644 index 000000000..5850326fc --- /dev/null +++ b/rust/src/models/event_type_import_open_api_in.rs @@ -0,0 +1,40 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// EventTypeImportOpenApiIn : Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeImportOpenApiIn { + /// If `true`, return the event types that would be modified without actually modifying them. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, + /// A pre-parsed JSON spec. + #[serde(rename = "spec", skip_serializing_if = "Option::is_none")] + pub spec: Option, + /// A string, parsed by the server as YAML or JSON. + #[serde(rename = "specRaw", skip_serializing_if = "Option::is_none")] + pub spec_raw: Option, + } + + impl EventTypeImportOpenApiIn { + /// Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. + pub fn new() -> EventTypeImportOpenApiIn { + EventTypeImportOpenApiIn { + dry_run: None, + spec: None, + spec_raw: None, + } + } + } + diff --git a/rust/src/models/event_type_import_open_api_out.rs b/rust/src/models/event_type_import_open_api_out.rs new file mode 100644 index 000000000..31b7d8acf --- /dev/null +++ b/rust/src/models/event_type_import_open_api_out.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeImportOpenApiOut { + #[serde(rename = "data")] + pub data: Box, + } + + impl EventTypeImportOpenApiOut { + pub fn new(data: models::EventTypeImportOpenApiOutData) -> EventTypeImportOpenApiOut { + EventTypeImportOpenApiOut { + data: Box::new(data), + } + } + } + diff --git a/rust/src/models/event_type_import_open_api_out_data.rs b/rust/src/models/event_type_import_open_api_out_data.rs new file mode 100644 index 000000000..1f2f3406f --- /dev/null +++ b/rust/src/models/event_type_import_open_api_out_data.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeImportOpenApiOutData { + #[serde(rename = "modified")] + pub modified: Vec, + #[serde(rename = "to_modify", skip_serializing_if = "Option::is_none")] + pub to_modify: Option>, + } + + impl EventTypeImportOpenApiOutData { + pub fn new(modified: Vec) -> EventTypeImportOpenApiOutData { + EventTypeImportOpenApiOutData { + modified, + to_modify: None, + } + } + } + diff --git a/rust/src/models/event_type_in.rs b/rust/src/models/event_type_in.rs new file mode 100644 index 000000000..118398758 --- /dev/null +++ b/rust/src/models/event_type_in.rs @@ -0,0 +1,50 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeIn { + #[serde(rename = "archived", skip_serializing_if = "Option::is_none")] + pub archived: Option, + #[serde(rename = "deprecated", skip_serializing_if = "Option::is_none")] + pub deprecated: Option, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "featureFlag", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + /// The event type group's name + #[serde(rename = "groupName", skip_serializing_if = "Option::is_none")] + pub group_name: Option, + /// The event type's name + #[serde(rename = "name")] + pub name: String, + /// The schema for the event type for a specific version as a JSON schema. + #[serde(rename = "schemas", skip_serializing_if = "Option::is_none")] + pub schemas: Option, + } + + impl EventTypeIn { + pub fn new(description: String, name: String) -> EventTypeIn { + EventTypeIn { + archived: None, + deprecated: None, + description, + feature_flag: None, + group_name: None, + name, + schemas: None, + } + } + } + diff --git a/rust/src/models/event_type_out.rs b/rust/src/models/event_type_out.rs new file mode 100644 index 000000000..499ecbb5e --- /dev/null +++ b/rust/src/models/event_type_out.rs @@ -0,0 +1,56 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeOut { + #[serde(rename = "archived", skip_serializing_if = "Option::is_none")] + pub archived: Option, + #[serde(rename = "createdAt")] + pub created_at: String, + #[serde(rename = "deprecated")] + pub deprecated: bool, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "featureFlag", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + /// The event type group's name + #[serde(rename = "groupName", skip_serializing_if = "Option::is_none")] + pub group_name: Option, + /// The event type's name + #[serde(rename = "name")] + pub name: String, + /// The schema for the event type for a specific version as a JSON schema. + #[serde(rename = "schemas", skip_serializing_if = "Option::is_none")] + pub schemas: Option, + #[serde(rename = "updatedAt")] + pub updated_at: String, + } + + impl EventTypeOut { + pub fn new(created_at: String, deprecated: bool, description: String, name: String, updated_at: String) -> EventTypeOut { + EventTypeOut { + archived: None, + created_at, + deprecated, + description, + feature_flag: None, + group_name: None, + name, + schemas: None, + updated_at, + } + } + } + diff --git a/rust/src/models/event_type_patch.rs b/rust/src/models/event_type_patch.rs new file mode 100644 index 000000000..ad27491fe --- /dev/null +++ b/rust/src/models/event_type_patch.rs @@ -0,0 +1,45 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypePatch { + #[serde(rename = "archived", skip_serializing_if = "Option::is_none")] + pub archived: Option, + #[serde(rename = "deprecated", skip_serializing_if = "Option::is_none")] + pub deprecated: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "featureFlag", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option>, + /// The event type group's name + #[serde(rename = "groupName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub group_name: Option>, + #[serde(rename = "schemas", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub schemas: Option>, + } + + impl EventTypePatch { + pub fn new() -> EventTypePatch { + EventTypePatch { + archived: None, + deprecated: None, + description: None, + feature_flag: None, + group_name: None, + schemas: None, + } + } + } + diff --git a/rust/src/models/event_type_schema_in.rs b/rust/src/models/event_type_schema_in.rs new file mode 100644 index 000000000..896497bc0 --- /dev/null +++ b/rust/src/models/event_type_schema_in.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeSchemaIn { + #[serde(rename = "schema")] + pub schema: serde_json::Value, + } + + impl EventTypeSchemaIn { + pub fn new(schema: serde_json::Value) -> EventTypeSchemaIn { + EventTypeSchemaIn { + schema, + } + } + } + diff --git a/rust/src/models/event_type_update.rs b/rust/src/models/event_type_update.rs new file mode 100644 index 000000000..21f88ce05 --- /dev/null +++ b/rust/src/models/event_type_update.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct EventTypeUpdate { + #[serde(rename = "archived", skip_serializing_if = "Option::is_none")] + pub archived: Option, + #[serde(rename = "deprecated", skip_serializing_if = "Option::is_none")] + pub deprecated: Option, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "featureFlag", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + /// The event type group's name + #[serde(rename = "groupName", skip_serializing_if = "Option::is_none")] + pub group_name: Option, + /// The schema for the event type for a specific version as a JSON schema. + #[serde(rename = "schemas", skip_serializing_if = "Option::is_none")] + pub schemas: Option, + } + + impl EventTypeUpdate { + pub fn new(description: String) -> EventTypeUpdate { + EventTypeUpdate { + archived: None, + deprecated: None, + description, + feature_flag: None, + group_name: None, + schemas: None, + } + } + } + diff --git a/rust/src/models/export_event_type_out.rs b/rust/src/models/export_event_type_out.rs new file mode 100644 index 000000000..09d8aa455 --- /dev/null +++ b/rust/src/models/export_event_type_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ExportEventTypeOut { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: models::BackgroundTaskStatus, + #[serde(rename = "task")] + pub task: models::BackgroundTaskType, + } + + impl ExportEventTypeOut { + pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType) -> ExportEventTypeOut { + ExportEventTypeOut { + id, + status, + task, + } + } + } + diff --git a/rust/src/models/font_size_config.rs b/rust/src/models/font_size_config.rs new file mode 100644 index 000000000..990fe2d01 --- /dev/null +++ b/rust/src/models/font_size_config.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct FontSizeConfig { + #[serde(rename = "base", skip_serializing_if = "Option::is_none")] + pub base: Option, + } + + impl FontSizeConfig { + pub fn new() -> FontSizeConfig { + FontSizeConfig { + base: None, + } + } + } + diff --git a/rust/src/models/generate_in.rs b/rust/src/models/generate_in.rs new file mode 100644 index 000000000..23fe57e91 --- /dev/null +++ b/rust/src/models/generate_in.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct GenerateIn { + #[serde(rename = "prompt")] + pub prompt: String, + } + + impl GenerateIn { + pub fn new(prompt: String) -> GenerateIn { + GenerateIn { + prompt, + } + } + } + diff --git a/rust/src/models/generate_out.rs b/rust/src/models/generate_out.rs new file mode 100644 index 000000000..a5952aca2 --- /dev/null +++ b/rust/src/models/generate_out.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct GenerateOut { + #[serde(rename = "choices")] + pub choices: Vec, + #[serde(rename = "created")] + pub created: i64, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "model")] + pub model: String, + #[serde(rename = "object")] + pub object: String, + } + + impl GenerateOut { + pub fn new(choices: Vec, created: i64, id: String, model: String, object: String) -> GenerateOut { + GenerateOut { + choices, + created, + id, + model, + object, + } + } + } + diff --git a/rust/src/models/google_cloud_storage_config.rs b/rust/src/models/google_cloud_storage_config.rs new file mode 100644 index 000000000..c43e99a5c --- /dev/null +++ b/rust/src/models/google_cloud_storage_config.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// GoogleCloudStorageConfig : Configuration for a Google Cloud Storage sink. Write stream events into the named bucket using the supplied Google Cloud credentials. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct GoogleCloudStorageConfig { + #[serde(rename = "bucket")] + pub bucket: String, + /// Google Cloud Credentials JSON Object as a string. + #[serde(rename = "credentials")] + pub credentials: String, + } + + impl GoogleCloudStorageConfig { + /// Configuration for a Google Cloud Storage sink. Write stream events into the named bucket using the supplied Google Cloud credentials. + pub fn new(bucket: String, credentials: String) -> GoogleCloudStorageConfig { + GoogleCloudStorageConfig { + bucket, + credentials, + } + } + } + diff --git a/rust/src/models/http_error_out.rs b/rust/src/models/http_error_out.rs new file mode 100644 index 000000000..f7e24b654 --- /dev/null +++ b/rust/src/models/http_error_out.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct HttpErrorOut { + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "detail")] + pub detail: String, + } + + impl HttpErrorOut { + pub fn new(code: String, detail: String) -> HttpErrorOut { + HttpErrorOut { + code, + detail, + } + } + } + diff --git a/rust/src/models/http_validation_error.rs b/rust/src/models/http_validation_error.rs new file mode 100644 index 000000000..1fc749c4e --- /dev/null +++ b/rust/src/models/http_validation_error.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct HttpValidationError { + #[serde(rename = "detail")] + pub detail: Vec, + } + + impl HttpValidationError { + pub fn new(detail: Vec) -> HttpValidationError { + HttpValidationError { + detail, + } + } + } + diff --git a/rust/src/models/hubspot_oauth_config_in.rs b/rust/src/models/hubspot_oauth_config_in.rs new file mode 100644 index 000000000..82ec3d792 --- /dev/null +++ b/rust/src/models/hubspot_oauth_config_in.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct HubspotOauthConfigIn { + #[serde(rename = "refresh_token")] + pub refresh_token: String, + } + + impl HubspotOauthConfigIn { + pub fn new(refresh_token: String) -> HubspotOauthConfigIn { + HubspotOauthConfigIn { + refresh_token, + } + } + } + diff --git a/rust/src/models/inbound_path_params.rs b/rust/src/models/inbound_path_params.rs new file mode 100644 index 000000000..78bf0acb4 --- /dev/null +++ b/rust/src/models/inbound_path_params.rs @@ -0,0 +1,33 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct InboundPathParams { + /// The app's ID or UID + #[serde(rename = "app_id")] + pub app_id: String, + #[serde(rename = "inbound_token")] + pub inbound_token: String, + } + + impl InboundPathParams { + pub fn new(app_id: String, inbound_token: String) -> InboundPathParams { + InboundPathParams { + app_id, + inbound_token, + } + } + } + diff --git a/rust/src/models/incoming_webhook_payload_out.rs b/rust/src/models/incoming_webhook_payload_out.rs new file mode 100644 index 000000000..9eb460505 --- /dev/null +++ b/rust/src/models/incoming_webhook_payload_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct IncomingWebhookPayloadOut { + #[serde(rename = "channel", skip_serializing_if = "Option::is_none")] + pub channel: Option, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, + #[serde(rename = "incomingWebhookUrl", skip_serializing_if = "Option::is_none")] + pub incoming_webhook_url: Option, + } + + impl IncomingWebhookPayloadOut { + pub fn new() -> IncomingWebhookPayloadOut { + IncomingWebhookPayloadOut { + channel: None, + error: None, + incoming_webhook_url: None, + } + } + } + diff --git a/rust/src/models/integration_in.rs b/rust/src/models/integration_in.rs new file mode 100644 index 000000000..48b8defcf --- /dev/null +++ b/rust/src/models/integration_in.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct IntegrationIn { + #[serde(rename = "name")] + pub name: String, + } + + impl IntegrationIn { + pub fn new(name: String) -> IntegrationIn { + IntegrationIn { + name, + } + } + } + diff --git a/rust/src/models/integration_key_out.rs b/rust/src/models/integration_key_out.rs new file mode 100644 index 000000000..2b59044fc --- /dev/null +++ b/rust/src/models/integration_key_out.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct IntegrationKeyOut { + #[serde(rename = "key")] + pub key: String, + } + + impl IntegrationKeyOut { + pub fn new(key: String) -> IntegrationKeyOut { + IntegrationKeyOut { + key, + } + } + } + diff --git a/rust/src/models/integration_out.rs b/rust/src/models/integration_out.rs new file mode 100644 index 000000000..01dab8606 --- /dev/null +++ b/rust/src/models/integration_out.rs @@ -0,0 +1,39 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct IntegrationOut { + #[serde(rename = "createdAt")] + pub created_at: String, + /// The integ's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "updatedAt")] + pub updated_at: String, + } + + impl IntegrationOut { + pub fn new(created_at: String, id: String, name: String, updated_at: String) -> IntegrationOut { + IntegrationOut { + created_at, + id, + name, + updated_at, + } + } + } + diff --git a/rust/src/models/integration_update.rs b/rust/src/models/integration_update.rs new file mode 100644 index 000000000..c084c3e02 --- /dev/null +++ b/rust/src/models/integration_update.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct IntegrationUpdate { + #[serde(rename = "name")] + pub name: String, + } + + impl IntegrationUpdate { + pub fn new(name: String) -> IntegrationUpdate { + IntegrationUpdate { + name, + } + } + } + diff --git a/rust/src/models/kafka_security_protocol_type.rs b/rust/src/models/kafka_security_protocol_type.rs new file mode 100644 index 000000000..ed4993aee --- /dev/null +++ b/rust/src/models/kafka_security_protocol_type.rs @@ -0,0 +1,43 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum KafkaSecurityProtocolType { + #[serde(rename = "plaintext")] + Plaintext, + #[serde(rename = "ssl")] + Ssl, + #[serde(rename = "sasl-ssl")] + SaslSsl, + + } + + impl std::fmt::Display for KafkaSecurityProtocolType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Plaintext => write!(f, "plaintext"), + Self::Ssl => write!(f, "ssl"), + Self::SaslSsl => write!(f, "sasl-ssl"), + } + } + } + + impl Default for KafkaSecurityProtocolType { + fn default() -> KafkaSecurityProtocolType { + Self::Plaintext + } + } + diff --git a/rust/src/models/list_response_application_out_.rs b/rust/src/models/list_response_application_out_.rs new file mode 100644 index 000000000..f633116d0 --- /dev/null +++ b/rust/src/models/list_response_application_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseApplicationOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseApplicationOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseApplicationOut { + ListResponseApplicationOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_application_stats_.rs b/rust/src/models/list_response_application_stats_.rs new file mode 100644 index 000000000..d8a84f071 --- /dev/null +++ b/rust/src/models/list_response_application_stats_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseApplicationStats { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseApplicationStats { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseApplicationStats { + ListResponseApplicationStats { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_background_task_out_.rs b/rust/src/models/list_response_background_task_out_.rs new file mode 100644 index 000000000..7c859fe2f --- /dev/null +++ b/rust/src/models/list_response_background_task_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseBackgroundTaskOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseBackgroundTaskOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseBackgroundTaskOut { + ListResponseBackgroundTaskOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_endpoint_message_out_.rs b/rust/src/models/list_response_endpoint_message_out_.rs new file mode 100644 index 000000000..5f133e67c --- /dev/null +++ b/rust/src/models/list_response_endpoint_message_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseEndpointMessageOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseEndpointMessageOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseEndpointMessageOut { + ListResponseEndpointMessageOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_endpoint_out_.rs b/rust/src/models/list_response_endpoint_out_.rs new file mode 100644 index 000000000..e5d6c8a60 --- /dev/null +++ b/rust/src/models/list_response_endpoint_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseEndpointOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseEndpointOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseEndpointOut { + ListResponseEndpointOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_event_type_out_.rs b/rust/src/models/list_response_event_type_out_.rs new file mode 100644 index 000000000..a9ffdb60e --- /dev/null +++ b/rust/src/models/list_response_event_type_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseEventTypeOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseEventTypeOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseEventTypeOut { + ListResponseEventTypeOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_integration_out_.rs b/rust/src/models/list_response_integration_out_.rs new file mode 100644 index 000000000..a4c7784a7 --- /dev/null +++ b/rust/src/models/list_response_integration_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseIntegrationOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseIntegrationOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseIntegrationOut { + ListResponseIntegrationOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_message_attempt_endpoint_out_.rs b/rust/src/models/list_response_message_attempt_endpoint_out_.rs new file mode 100644 index 000000000..703b2388a --- /dev/null +++ b/rust/src/models/list_response_message_attempt_endpoint_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseMessageAttemptEndpointOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseMessageAttemptEndpointOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseMessageAttemptEndpointOut { + ListResponseMessageAttemptEndpointOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_message_attempt_out_.rs b/rust/src/models/list_response_message_attempt_out_.rs new file mode 100644 index 000000000..447d05a3d --- /dev/null +++ b/rust/src/models/list_response_message_attempt_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseMessageAttemptOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseMessageAttemptOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseMessageAttemptOut { + ListResponseMessageAttemptOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_message_endpoint_out_.rs b/rust/src/models/list_response_message_endpoint_out_.rs new file mode 100644 index 000000000..d111581f4 --- /dev/null +++ b/rust/src/models/list_response_message_endpoint_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseMessageEndpointOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseMessageEndpointOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseMessageEndpointOut { + ListResponseMessageEndpointOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_message_out_.rs b/rust/src/models/list_response_message_out_.rs new file mode 100644 index 000000000..9832da2a8 --- /dev/null +++ b/rust/src/models/list_response_message_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseMessageOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseMessageOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseMessageOut { + ListResponseMessageOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_operational_webhook_endpoint_out_.rs b/rust/src/models/list_response_operational_webhook_endpoint_out_.rs new file mode 100644 index 000000000..4ed492409 --- /dev/null +++ b/rust/src/models/list_response_operational_webhook_endpoint_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseOperationalWebhookEndpointOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseOperationalWebhookEndpointOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseOperationalWebhookEndpointOut { + ListResponseOperationalWebhookEndpointOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_sink_out_.rs b/rust/src/models/list_response_sink_out_.rs new file mode 100644 index 000000000..39caedbc0 --- /dev/null +++ b/rust/src/models/list_response_sink_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseSinkOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseSinkOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseSinkOut { + ListResponseSinkOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_stream_event_type_out_.rs b/rust/src/models/list_response_stream_event_type_out_.rs new file mode 100644 index 000000000..386ea3d5a --- /dev/null +++ b/rust/src/models/list_response_stream_event_type_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseStreamEventTypeOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseStreamEventTypeOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseStreamEventTypeOut { + ListResponseStreamEventTypeOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_stream_out_.rs b/rust/src/models/list_response_stream_out_.rs new file mode 100644 index 000000000..aaedd80f0 --- /dev/null +++ b/rust/src/models/list_response_stream_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseStreamOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseStreamOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseStreamOut { + ListResponseStreamOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_stream_sink_out_.rs b/rust/src/models/list_response_stream_sink_out_.rs new file mode 100644 index 000000000..c33e75a8e --- /dev/null +++ b/rust/src/models/list_response_stream_sink_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseStreamSinkOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseStreamSinkOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseStreamSinkOut { + ListResponseStreamSinkOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/list_response_template_out_.rs b/rust/src/models/list_response_template_out_.rs new file mode 100644 index 000000000..ff8653664 --- /dev/null +++ b/rust/src/models/list_response_template_out_.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ListResponseTemplateOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator", deserialize_with = "Option::deserialize")] + pub iterator: Option, + #[serde(rename = "prevIterator", skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, + } + + impl ListResponseTemplateOut { + pub fn new(data: Vec, done: bool, iterator: Option) -> ListResponseTemplateOut { + ListResponseTemplateOut { + data, + done, + iterator, + prev_iterator: None, + } + } + } + diff --git a/rust/src/models/message_attempt_endpoint_out.rs b/rust/src/models/message_attempt_endpoint_out.rs new file mode 100644 index 000000000..4e5e4fbb6 --- /dev/null +++ b/rust/src/models/message_attempt_endpoint_out.rs @@ -0,0 +1,63 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptEndpointOut { + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + /// The attempt's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "msg", skip_serializing_if = "Option::is_none")] + pub msg: Option>, + /// The msg's ID + #[serde(rename = "msgId")] + pub msg_id: String, + #[serde(rename = "response")] + pub response: String, + /// Response duration in milliseconds. + #[serde(rename = "responseDurationMs")] + pub response_duration_ms: i64, + #[serde(rename = "responseStatusCode")] + pub response_status_code: i32, + #[serde(rename = "status")] + pub status: models::MessageStatus, + #[serde(rename = "timestamp")] + pub timestamp: String, + #[serde(rename = "triggerType")] + pub trigger_type: models::MessageAttemptTriggerType, + #[serde(rename = "url")] + pub url: String, + } + + impl MessageAttemptEndpointOut { + pub fn new(endpoint_id: String, id: String, msg_id: String, response: String, response_duration_ms: i64, response_status_code: i32, status: models::MessageStatus, timestamp: String, trigger_type: models::MessageAttemptTriggerType, url: String) -> MessageAttemptEndpointOut { + MessageAttemptEndpointOut { + endpoint_id, + id, + msg: None, + msg_id, + response, + response_duration_ms, + response_status_code, + status, + timestamp, + trigger_type, + url, + } + } + } + diff --git a/rust/src/models/message_attempt_exhausted_event.rs b/rust/src/models/message_attempt_exhausted_event.rs new file mode 100644 index 000000000..09e0b1eaa --- /dev/null +++ b/rust/src/models/message_attempt_exhausted_event.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// MessageAttemptExhaustedEvent : Sent when a message delivery has failed (all of the retry attempts have been exhausted). + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptExhaustedEvent { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl MessageAttemptExhaustedEvent { + /// Sent when a message delivery has failed (all of the retry attempts have been exhausted). + pub fn new(data: models::MessageAttemptExhaustedEventData, r#type: Type) -> MessageAttemptExhaustedEvent { + MessageAttemptExhaustedEvent { + data: Box::new(data), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "message.attempt.exhausted")] + MessagePeriodAttemptPeriodExhausted, + } + + impl Default for Type { + fn default() -> Type { + Self::MessagePeriodAttemptPeriodExhausted + } + } + diff --git a/rust/src/models/message_attempt_exhausted_event_data.rs b/rust/src/models/message_attempt_exhausted_event_data.rs new file mode 100644 index 000000000..9448fdc5d --- /dev/null +++ b/rust/src/models/message_attempt_exhausted_event_data.rs @@ -0,0 +1,51 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// MessageAttemptExhaustedEventData : Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptExhaustedEventData { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + #[serde(rename = "lastAttempt")] + pub last_attempt: Box, + /// The msg's UID + #[serde(rename = "msgEventId", skip_serializing_if = "Option::is_none")] + pub msg_event_id: Option, + /// The msg's ID + #[serde(rename = "msgId")] + pub msg_id: String, + } + + impl MessageAttemptExhaustedEventData { + /// Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. + pub fn new(app_id: String, endpoint_id: String, last_attempt: models::MessageAttemptFailedData, msg_id: String) -> MessageAttemptExhaustedEventData { + MessageAttemptExhaustedEventData { + app_id, + app_uid: None, + endpoint_id, + last_attempt: Box::new(last_attempt), + msg_event_id: None, + msg_id, + } + } + } + diff --git a/rust/src/models/message_attempt_failed_data.rs b/rust/src/models/message_attempt_failed_data.rs new file mode 100644 index 000000000..caf4e3ca1 --- /dev/null +++ b/rust/src/models/message_attempt_failed_data.rs @@ -0,0 +1,36 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptFailedData { + /// The attempt's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "responseStatusCode")] + pub response_status_code: i32, + #[serde(rename = "timestamp")] + pub timestamp: String, + } + + impl MessageAttemptFailedData { + pub fn new(id: String, response_status_code: i32, timestamp: String) -> MessageAttemptFailedData { + MessageAttemptFailedData { + id, + response_status_code, + timestamp, + } + } + } + diff --git a/rust/src/models/message_attempt_failing_event.rs b/rust/src/models/message_attempt_failing_event.rs new file mode 100644 index 000000000..19b1a2d70 --- /dev/null +++ b/rust/src/models/message_attempt_failing_event.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// MessageAttemptFailingEvent : Sent after a message has been failing for a few times. It's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptFailingEvent { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl MessageAttemptFailingEvent { + /// Sent after a message has been failing for a few times. It's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure. + pub fn new(data: models::MessageAttemptFailingEventData, r#type: Type) -> MessageAttemptFailingEvent { + MessageAttemptFailingEvent { + data: Box::new(data), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "message.attempt.failing")] + MessagePeriodAttemptPeriodFailing, + } + + impl Default for Type { + fn default() -> Type { + Self::MessagePeriodAttemptPeriodFailing + } + } + diff --git a/rust/src/models/message_attempt_failing_event_data.rs b/rust/src/models/message_attempt_failing_event_data.rs new file mode 100644 index 000000000..0aa2b57f7 --- /dev/null +++ b/rust/src/models/message_attempt_failing_event_data.rs @@ -0,0 +1,51 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// MessageAttemptFailingEventData : Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptFailingEventData { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + #[serde(rename = "lastAttempt")] + pub last_attempt: Box, + /// The msg's UID + #[serde(rename = "msgEventId", skip_serializing_if = "Option::is_none")] + pub msg_event_id: Option, + /// The msg's ID + #[serde(rename = "msgId")] + pub msg_id: String, + } + + impl MessageAttemptFailingEventData { + /// Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. + pub fn new(app_id: String, endpoint_id: String, last_attempt: models::MessageAttemptFailedData, msg_id: String) -> MessageAttemptFailingEventData { + MessageAttemptFailingEventData { + app_id, + app_uid: None, + endpoint_id, + last_attempt: Box::new(last_attempt), + msg_event_id: None, + msg_id, + } + } + } + diff --git a/rust/src/models/message_attempt_headers_out.rs b/rust/src/models/message_attempt_headers_out.rs new file mode 100644 index 000000000..2e63d421f --- /dev/null +++ b/rust/src/models/message_attempt_headers_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptHeadersOut { + #[serde(rename = "responseHeaders", skip_serializing_if = "Option::is_none")] + pub response_headers: Option>>, + #[serde(rename = "sensitive")] + pub sensitive: Vec, + #[serde(rename = "sentHeaders")] + pub sent_headers: std::collections::HashMap, + } + + impl MessageAttemptHeadersOut { + pub fn new(sensitive: Vec, sent_headers: std::collections::HashMap) -> MessageAttemptHeadersOut { + MessageAttemptHeadersOut { + response_headers: None, + sensitive, + sent_headers, + } + } + } + diff --git a/rust/src/models/message_attempt_out.rs b/rust/src/models/message_attempt_out.rs new file mode 100644 index 000000000..440d40de0 --- /dev/null +++ b/rust/src/models/message_attempt_out.rs @@ -0,0 +1,63 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptOut { + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + /// The attempt's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "msg", skip_serializing_if = "Option::is_none")] + pub msg: Option>, + /// The msg's ID + #[serde(rename = "msgId")] + pub msg_id: String, + #[serde(rename = "response")] + pub response: String, + /// Response duration in milliseconds. + #[serde(rename = "responseDurationMs")] + pub response_duration_ms: i64, + #[serde(rename = "responseStatusCode")] + pub response_status_code: i32, + #[serde(rename = "status")] + pub status: models::MessageStatus, + #[serde(rename = "timestamp")] + pub timestamp: String, + #[serde(rename = "triggerType")] + pub trigger_type: models::MessageAttemptTriggerType, + #[serde(rename = "url")] + pub url: String, + } + + impl MessageAttemptOut { + pub fn new(endpoint_id: String, id: String, msg_id: String, response: String, response_duration_ms: i64, response_status_code: i32, status: models::MessageStatus, timestamp: String, trigger_type: models::MessageAttemptTriggerType, url: String) -> MessageAttemptOut { + MessageAttemptOut { + endpoint_id, + id, + msg: None, + msg_id, + response, + response_duration_ms, + response_status_code, + status, + timestamp, + trigger_type, + url, + } + } + } + diff --git a/rust/src/models/message_attempt_recovered_event.rs b/rust/src/models/message_attempt_recovered_event.rs new file mode 100644 index 000000000..02a9495fc --- /dev/null +++ b/rust/src/models/message_attempt_recovered_event.rs @@ -0,0 +1,46 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// MessageAttemptRecoveredEvent : Sent on a successful dispatch after an earlier failure op webhook has already been sent. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptRecoveredEvent { + #[serde(rename = "data")] + pub data: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl MessageAttemptRecoveredEvent { + /// Sent on a successful dispatch after an earlier failure op webhook has already been sent. + pub fn new(data: models::MessageAttemptRecoveredEventData, r#type: Type) -> MessageAttemptRecoveredEvent { + MessageAttemptRecoveredEvent { + data: Box::new(data), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "message.attempt.recovered")] + MessagePeriodAttemptPeriodRecovered, + } + + impl Default for Type { + fn default() -> Type { + Self::MessagePeriodAttemptPeriodRecovered + } + } + diff --git a/rust/src/models/message_attempt_recovered_event_data.rs b/rust/src/models/message_attempt_recovered_event_data.rs new file mode 100644 index 000000000..f09487f84 --- /dev/null +++ b/rust/src/models/message_attempt_recovered_event_data.rs @@ -0,0 +1,51 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// MessageAttemptRecoveredEventData : Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageAttemptRecoveredEventData { + /// The app's ID + #[serde(rename = "appId")] + pub app_id: String, + /// The app's UID + #[serde(rename = "appUid", skip_serializing_if = "Option::is_none")] + pub app_uid: Option, + /// The ep's ID + #[serde(rename = "endpointId")] + pub endpoint_id: String, + #[serde(rename = "lastAttempt")] + pub last_attempt: Box, + /// The msg's UID + #[serde(rename = "msgEventId", skip_serializing_if = "Option::is_none")] + pub msg_event_id: Option, + /// The msg's ID + #[serde(rename = "msgId")] + pub msg_id: String, + } + + impl MessageAttemptRecoveredEventData { + /// Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. + pub fn new(app_id: String, endpoint_id: String, last_attempt: models::MessageAttemptFailedData, msg_id: String) -> MessageAttemptRecoveredEventData { + MessageAttemptRecoveredEventData { + app_id, + app_uid: None, + endpoint_id, + last_attempt: Box::new(last_attempt), + msg_event_id: None, + msg_id, + } + } + } + diff --git a/rust/src/models/message_attempt_trigger_type.rs b/rust/src/models/message_attempt_trigger_type.rs new file mode 100644 index 000000000..928e81862 --- /dev/null +++ b/rust/src/models/message_attempt_trigger_type.rs @@ -0,0 +1,40 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + use serde_repr::{Serialize_repr,Deserialize_repr}; + /// MessageAttemptTriggerType : The reason an attempt was made: - Scheduled = 0 - Manual = 1 + /// The reason an attempt was made: - Scheduled = 0 - Manual = 1 + #[repr(i64)] + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] + pub enum MessageAttemptTriggerType { + Scheduled = 0, + Manual = 1, + + } + + impl std::fmt::Display for MessageAttemptTriggerType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", match self { + Self::Scheduled => "0", + Self::Manual => "1", + }) + } + } + impl Default for MessageAttemptTriggerType { + fn default() -> MessageAttemptTriggerType { + Self::Scheduled + } + } + diff --git a/rust/src/models/message_broadcast_in.rs b/rust/src/models/message_broadcast_in.rs new file mode 100644 index 000000000..a8a5b305c --- /dev/null +++ b/rust/src/models/message_broadcast_in.rs @@ -0,0 +1,49 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageBroadcastIn { + /// List of free-form identifiers that endpoints can filter by. + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + /// Optional unique identifier for the message. + #[serde(rename = "eventId", skip_serializing_if = "Option::is_none")] + pub event_id: Option, + /// The event type's name + #[serde(rename = "eventType")] + pub event_type: String, + #[serde(rename = "payload")] + pub payload: serde_json::Value, + /// Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`. + #[serde(rename = "payloadRetentionHours", skip_serializing_if = "Option::is_none")] + pub payload_retention_hours: Option, + /// Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`. + #[serde(rename = "payloadRetentionPeriod", skip_serializing_if = "Option::is_none")] + pub payload_retention_period: Option, + } + + impl MessageBroadcastIn { + pub fn new(event_type: String, payload: serde_json::Value) -> MessageBroadcastIn { + MessageBroadcastIn { + channels: None, + event_id: None, + event_type, + payload, + payload_retention_hours: None, + payload_retention_period: None, + } + } + } + diff --git a/rust/src/models/message_broadcast_out.rs b/rust/src/models/message_broadcast_out.rs new file mode 100644 index 000000000..88bb93f2d --- /dev/null +++ b/rust/src/models/message_broadcast_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageBroadcastOut { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: models::BackgroundTaskStatus, + #[serde(rename = "task")] + pub task: models::BackgroundTaskType, + } + + impl MessageBroadcastOut { + pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType) -> MessageBroadcastOut { + MessageBroadcastOut { + id, + status, + task, + } + } + } + diff --git a/rust/src/models/message_endpoint_out.rs b/rust/src/models/message_endpoint_out.rs new file mode 100644 index 000000000..486234f35 --- /dev/null +++ b/rust/src/models/message_endpoint_out.rs @@ -0,0 +1,69 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageEndpointOut { + /// List of message channels this endpoint listens to (omit for all). + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + #[serde(rename = "createdAt")] + pub created_at: String, + /// An example endpoint name. + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + /// The ep's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "nextAttempt", skip_serializing_if = "Option::is_none")] + pub next_attempt: Option, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + #[serde(rename = "status")] + pub status: models::MessageStatus, + /// Optional unique identifier for the endpoint. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "updatedAt")] + pub updated_at: String, + #[serde(rename = "url")] + pub url: String, + #[serde(rename = "version")] + pub version: i32, + } + + impl MessageEndpointOut { + pub fn new(created_at: String, description: String, id: String, status: models::MessageStatus, updated_at: String, url: String, version: i32) -> MessageEndpointOut { + MessageEndpointOut { + channels: None, + created_at, + description, + disabled: None, + filter_types: None, + id, + next_attempt: None, + rate_limit: None, + status, + uid: None, + updated_at, + url, + version, + } + } + } + diff --git a/rust/src/models/message_events_out.rs b/rust/src/models/message_events_out.rs new file mode 100644 index 000000000..f4d0d8fd7 --- /dev/null +++ b/rust/src/models/message_events_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageEventsOut { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "done")] + pub done: bool, + #[serde(rename = "iterator")] + pub iterator: String, + } + + impl MessageEventsOut { + pub fn new(data: Vec, done: bool, iterator: String) -> MessageEventsOut { + MessageEventsOut { + data, + done, + iterator, + } + } + } + diff --git a/rust/src/models/message_in.rs b/rust/src/models/message_in.rs new file mode 100644 index 000000000..17a15afa2 --- /dev/null +++ b/rust/src/models/message_in.rs @@ -0,0 +1,61 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageIn { + #[serde(rename = "application", skip_serializing_if = "Option::is_none")] + pub application: Option>, + /// List of free-form identifiers that endpoints can filter by + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + /// Optional unique identifier for the message + #[serde(rename = "eventId", skip_serializing_if = "Option::is_none")] + pub event_id: Option, + /// The event type's name + #[serde(rename = "eventType")] + pub event_type: String, + /// JSON payload to send as the request body of the webhook. We also support sending non-JSON payloads. Please contact us for more information. + #[serde(rename = "payload")] + pub payload: serde_json::Value, + /// Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`. + #[serde(rename = "payloadRetentionHours", skip_serializing_if = "Option::is_none")] + pub payload_retention_hours: Option, + /// Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`. + #[serde(rename = "payloadRetentionPeriod", skip_serializing_if = "Option::is_none")] + pub payload_retention_period: Option, + /// List of free-form tags that can be filtered by when listing messages + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// Extra parameters to pass to Transformations (for future use) + #[serde(rename = "transformationsParams", skip_serializing_if = "Option::is_none")] + pub transformations_params: Option, + } + + impl MessageIn { + pub fn new(event_type: String, payload: serde_json::Value) -> MessageIn { + MessageIn { + application: None, + channels: None, + event_id: None, + event_type, + payload, + payload_retention_hours: None, + payload_retention_period: None, + tags: None, + transformations_params: None, + } + } + } + diff --git a/rust/src/models/message_out.rs b/rust/src/models/message_out.rs new file mode 100644 index 000000000..0a7e92882 --- /dev/null +++ b/rust/src/models/message_out.rs @@ -0,0 +1,51 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageOut { + /// List of free-form identifiers that endpoints can filter by + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + /// Optional unique identifier for the message + #[serde(rename = "eventId", skip_serializing_if = "Option::is_none")] + pub event_id: Option, + /// The event type's name + #[serde(rename = "eventType")] + pub event_type: String, + /// The msg's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "payload")] + pub payload: serde_json::Value, + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "timestamp")] + pub timestamp: String, + } + + impl MessageOut { + pub fn new(event_type: String, id: String, payload: serde_json::Value, timestamp: String) -> MessageOut { + MessageOut { + channels: None, + event_id: None, + event_type, + id, + payload, + tags: None, + timestamp, + } + } + } + diff --git a/rust/src/models/message_raw_payload_out.rs b/rust/src/models/message_raw_payload_out.rs new file mode 100644 index 000000000..8bc2921c2 --- /dev/null +++ b/rust/src/models/message_raw_payload_out.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageRawPayloadOut { + #[serde(rename = "payload")] + pub payload: String, + } + + impl MessageRawPayloadOut { + pub fn new(payload: String) -> MessageRawPayloadOut { + MessageRawPayloadOut { + payload, + } + } + } + diff --git a/rust/src/models/message_status.rs b/rust/src/models/message_status.rs new file mode 100644 index 000000000..204467af1 --- /dev/null +++ b/rust/src/models/message_status.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + use serde_repr::{Serialize_repr,Deserialize_repr}; + /// MessageStatus : The sending status of the message: - Success = 0 - Pending = 1 - Fail = 2 - Sending = 3 + /// The sending status of the message: - Success = 0 - Pending = 1 - Fail = 2 - Sending = 3 + #[repr(i64)] + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] + pub enum MessageStatus { + Success = 0, + Pending = 1, + Fail = 2, + Sending = 3, + + } + + impl std::fmt::Display for MessageStatus { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", match self { + Self::Success => "0", + Self::Pending => "1", + Self::Fail => "2", + Self::Sending => "3", + }) + } + } + impl Default for MessageStatus { + fn default() -> MessageStatus { + Self::Success + } + } + diff --git a/rust/src/models/message_subscriber_auth_token_out.rs b/rust/src/models/message_subscriber_auth_token_out.rs new file mode 100644 index 000000000..d2ab57908 --- /dev/null +++ b/rust/src/models/message_subscriber_auth_token_out.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct MessageSubscriberAuthTokenOut { + #[serde(rename = "bridgeToken")] + pub bridge_token: String, + #[serde(rename = "token")] + pub token: String, + } + + impl MessageSubscriberAuthTokenOut { + pub fn new(bridge_token: String, token: String) -> MessageSubscriberAuthTokenOut { + MessageSubscriberAuthTokenOut { + bridge_token, + token, + } + } + } + diff --git a/rust/src/models/mod.rs b/rust/src/models/mod.rs new file mode 100644 index 000000000..6e33f6682 --- /dev/null +++ b/rust/src/models/mod.rs @@ -0,0 +1,570 @@ +// TODO: Make modules private for v2.0 of the library +pub mod aggregate_event_types_out; +pub use self::aggregate_event_types_out::AggregateEventTypesOut; +// TODO: Make modules private for v2.0 of the library +pub mod app_portal_access_in; +pub use self::app_portal_access_in::AppPortalAccessIn; +// TODO: Make modules private for v2.0 of the library +pub mod app_portal_access_out; +pub use self::app_portal_access_out::AppPortalAccessOut; +// TODO: Make modules private for v2.0 of the library +pub mod app_usage_stats_in; +pub use self::app_usage_stats_in::AppUsageStatsIn; +// TODO: Make modules private for v2.0 of the library +pub mod app_usage_stats_out; +pub use self::app_usage_stats_out::AppUsageStatsOut; +// TODO: Make modules private for v2.0 of the library +pub mod application_in; +pub use self::application_in::ApplicationIn; +// TODO: Make modules private for v2.0 of the library +pub mod application_out; +pub use self::application_out::ApplicationOut; +// TODO: Make modules private for v2.0 of the library +pub mod application_patch; +pub use self::application_patch::ApplicationPatch; +// TODO: Make modules private for v2.0 of the library +pub mod application_stats; +pub use self::application_stats::ApplicationStats; +// TODO: Make modules private for v2.0 of the library +pub mod application_token_expire_in; +pub use self::application_token_expire_in::ApplicationTokenExpireIn; +// TODO: Make modules private for v2.0 of the library +pub mod attempt_statistics_data; +pub use self::attempt_statistics_data::AttemptStatisticsData; +// TODO: Make modules private for v2.0 of the library +pub mod attempt_statistics_response; +pub use self::attempt_statistics_response::AttemptStatisticsResponse; +// TODO: Make modules private for v2.0 of the library +pub mod auth_token_out; +pub use self::auth_token_out::AuthTokenOut; +// TODO: Make modules private for v2.0 of the library +pub mod azure_blob_storage_config; +pub use self::azure_blob_storage_config::AzureBlobStorageConfig; +// TODO: Make modules private for v2.0 of the library +pub mod background_task_out; +pub use self::background_task_out::BackgroundTaskOut; +// TODO: Make modules private for v2.0 of the library +pub mod background_task_status; +pub use self::background_task_status::BackgroundTaskStatus; +// TODO: Make modules private for v2.0 of the library +pub mod background_task_type; +pub use self::background_task_type::BackgroundTaskType; +// TODO: Make modules private for v2.0 of the library +pub mod big_query_config; +pub use self::big_query_config::BigQueryConfig; +// TODO: Make modules private for v2.0 of the library +pub mod border_radius_config; +pub use self::border_radius_config::BorderRadiusConfig; +// TODO: Make modules private for v2.0 of the library +pub mod border_radius_enum; +pub use self::border_radius_enum::BorderRadiusEnum; +// TODO: Make modules private for v2.0 of the library +pub mod client_secret_jwt_params_in; +pub use self::client_secret_jwt_params_in::ClientSecretJwtParamsIn; +// TODO: Make modules private for v2.0 of the library +pub mod completion_choice; +pub use self::completion_choice::CompletionChoice; +// TODO: Make modules private for v2.0 of the library +pub mod completion_message; +pub use self::completion_message::CompletionMessage; +// TODO: Make modules private for v2.0 of the library +pub mod count_out; +pub use self::count_out::CountOut; +// TODO: Make modules private for v2.0 of the library +pub mod create_stream_in; +pub use self::create_stream_in::CreateStreamIn; +// TODO: Make modules private for v2.0 of the library +pub mod create_token_in; +pub use self::create_token_in::CreateTokenIn; +// TODO: Make modules private for v2.0 of the library +pub mod custom_color_palette; +pub use self::custom_color_palette::CustomColorPalette; +// TODO: Make modules private for v2.0 of the library +pub mod custom_strings_override; +pub use self::custom_strings_override::CustomStringsOverride; +// TODO: Make modules private for v2.0 of the library +pub mod custom_theme_override; +pub use self::custom_theme_override::CustomThemeOverride; +// TODO: Make modules private for v2.0 of the library +pub mod dashboard_access_out; +pub use self::dashboard_access_out::DashboardAccessOut; +// TODO: Make modules private for v2.0 of the library +pub mod duration; +pub use self::duration::Duration; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_created_event; +pub use self::endpoint_created_event::EndpointCreatedEvent; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_created_event_data; +pub use self::endpoint_created_event_data::EndpointCreatedEventData; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_deleted_event; +pub use self::endpoint_deleted_event::EndpointDeletedEvent; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_deleted_event_data; +pub use self::endpoint_deleted_event_data::EndpointDeletedEventData; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_disabled_event; +pub use self::endpoint_disabled_event::EndpointDisabledEvent; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_disabled_event_data; +pub use self::endpoint_disabled_event_data::EndpointDisabledEventData; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_headers_in; +pub use self::endpoint_headers_in::EndpointHeadersIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_headers_out; +pub use self::endpoint_headers_out::EndpointHeadersOut; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_headers_patch_in; +pub use self::endpoint_headers_patch_in::EndpointHeadersPatchIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_in; +pub use self::endpoint_in::EndpointIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_message_out; +pub use self::endpoint_message_out::EndpointMessageOut; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_mtls_config_in; +pub use self::endpoint_mtls_config_in::EndpointMtlsConfigIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_oauth_config_in; +pub use self::endpoint_oauth_config_in::EndpointOauthConfigIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_out; +pub use self::endpoint_out::EndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_patch; +pub use self::endpoint_patch::EndpointPatch; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_secret_out; +pub use self::endpoint_secret_out::EndpointSecretOut; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_secret_rotate_in; +pub use self::endpoint_secret_rotate_in::EndpointSecretRotateIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_stats; +pub use self::endpoint_stats::EndpointStats; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_transformation_in; +pub use self::endpoint_transformation_in::EndpointTransformationIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_transformation_out; +pub use self::endpoint_transformation_out::EndpointTransformationOut; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_transformation_simulate_in; +pub use self::endpoint_transformation_simulate_in::EndpointTransformationSimulateIn; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_transformation_simulate_out; +pub use self::endpoint_transformation_simulate_out::EndpointTransformationSimulateOut; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_update; +pub use self::endpoint_update::EndpointUpdate; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_updated_event; +pub use self::endpoint_updated_event::EndpointUpdatedEvent; +// TODO: Make modules private for v2.0 of the library +pub mod endpoint_updated_event_data; +pub use self::endpoint_updated_event_data::EndpointUpdatedEventData; +// TODO: Make modules private for v2.0 of the library +pub mod environment_in; +pub use self::environment_in::EnvironmentIn; +// TODO: Make modules private for v2.0 of the library +pub mod environment_out; +pub use self::environment_out::EnvironmentOut; +// TODO: Make modules private for v2.0 of the library +pub mod environment_settings_out; +pub use self::environment_settings_out::EnvironmentSettingsOut; +// TODO: Make modules private for v2.0 of the library +pub mod event_example_in; +pub use self::event_example_in::EventExampleIn; +// TODO: Make modules private for v2.0 of the library +pub mod event_in; +pub use self::event_in::EventIn; +// TODO: Make modules private for v2.0 of the library +pub mod event_out; +pub use self::event_out::EventOut; +// TODO: Make modules private for v2.0 of the library +pub mod event_stream_out; +pub use self::event_stream_out::EventStreamOut; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_example_out; +pub use self::event_type_example_out::EventTypeExampleOut; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_from_open_api; +pub use self::event_type_from_open_api::EventTypeFromOpenApi; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_import_open_api_in; +pub use self::event_type_import_open_api_in::EventTypeImportOpenApiIn; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_import_open_api_out; +pub use self::event_type_import_open_api_out::EventTypeImportOpenApiOut; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_import_open_api_out_data; +pub use self::event_type_import_open_api_out_data::EventTypeImportOpenApiOutData; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_in; +pub use self::event_type_in::EventTypeIn; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_out; +pub use self::event_type_out::EventTypeOut; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_patch; +pub use self::event_type_patch::EventTypePatch; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_schema_in; +pub use self::event_type_schema_in::EventTypeSchemaIn; +// TODO: Make modules private for v2.0 of the library +pub mod event_type_update; +pub use self::event_type_update::EventTypeUpdate; +// TODO: Make modules private for v2.0 of the library +pub mod export_event_type_out; +pub use self::export_event_type_out::ExportEventTypeOut; +// TODO: Make modules private for v2.0 of the library +pub mod font_size_config; +pub use self::font_size_config::FontSizeConfig; +// TODO: Make modules private for v2.0 of the library +pub mod generate_in; +pub use self::generate_in::GenerateIn; +// TODO: Make modules private for v2.0 of the library +pub mod generate_out; +pub use self::generate_out::GenerateOut; +// TODO: Make modules private for v2.0 of the library +pub mod google_cloud_storage_config; +pub use self::google_cloud_storage_config::GoogleCloudStorageConfig; +// TODO: Make modules private for v2.0 of the library +pub mod http_error_out; +pub use self::http_error_out::HttpErrorOut; +// TODO: Make modules private for v2.0 of the library +pub mod http_validation_error; +pub use self::http_validation_error::HttpValidationError; +// TODO: Make modules private for v2.0 of the library +pub mod hubspot_oauth_config_in; +pub use self::hubspot_oauth_config_in::HubspotOauthConfigIn; +// TODO: Make modules private for v2.0 of the library +pub mod inbound_path_params; +pub use self::inbound_path_params::InboundPathParams; +// TODO: Make modules private for v2.0 of the library +pub mod incoming_webhook_payload_out; +pub use self::incoming_webhook_payload_out::IncomingWebhookPayloadOut; +// TODO: Make modules private for v2.0 of the library +pub mod integration_in; +pub use self::integration_in::IntegrationIn; +// TODO: Make modules private for v2.0 of the library +pub mod integration_key_out; +pub use self::integration_key_out::IntegrationKeyOut; +// TODO: Make modules private for v2.0 of the library +pub mod integration_out; +pub use self::integration_out::IntegrationOut; +// TODO: Make modules private for v2.0 of the library +pub mod integration_update; +pub use self::integration_update::IntegrationUpdate; +// TODO: Make modules private for v2.0 of the library +pub mod kafka_security_protocol_type; +pub use self::kafka_security_protocol_type::KafkaSecurityProtocolType; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_application_out_; +pub use self::list_response_application_out_::ListResponseApplicationOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_application_stats_; +pub use self::list_response_application_stats_::ListResponseApplicationStats; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_background_task_out_; +pub use self::list_response_background_task_out_::ListResponseBackgroundTaskOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_endpoint_message_out_; +pub use self::list_response_endpoint_message_out_::ListResponseEndpointMessageOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_endpoint_out_; +pub use self::list_response_endpoint_out_::ListResponseEndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_event_type_out_; +pub use self::list_response_event_type_out_::ListResponseEventTypeOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_integration_out_; +pub use self::list_response_integration_out_::ListResponseIntegrationOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_message_attempt_endpoint_out_; +pub use self::list_response_message_attempt_endpoint_out_::ListResponseMessageAttemptEndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_message_attempt_out_; +pub use self::list_response_message_attempt_out_::ListResponseMessageAttemptOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_message_endpoint_out_; +pub use self::list_response_message_endpoint_out_::ListResponseMessageEndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_message_out_; +pub use self::list_response_message_out_::ListResponseMessageOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_operational_webhook_endpoint_out_; +pub use self::list_response_operational_webhook_endpoint_out_::ListResponseOperationalWebhookEndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_sink_out_; +pub use self::list_response_sink_out_::ListResponseSinkOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_stream_event_type_out_; +pub use self::list_response_stream_event_type_out_::ListResponseStreamEventTypeOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_stream_out_; +pub use self::list_response_stream_out_::ListResponseStreamOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_stream_sink_out_; +pub use self::list_response_stream_sink_out_::ListResponseStreamSinkOut; +// TODO: Make modules private for v2.0 of the library +pub mod list_response_template_out_; +pub use self::list_response_template_out_::ListResponseTemplateOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_endpoint_out; +pub use self::message_attempt_endpoint_out::MessageAttemptEndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_exhausted_event; +pub use self::message_attempt_exhausted_event::MessageAttemptExhaustedEvent; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_exhausted_event_data; +pub use self::message_attempt_exhausted_event_data::MessageAttemptExhaustedEventData; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_failed_data; +pub use self::message_attempt_failed_data::MessageAttemptFailedData; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_failing_event; +pub use self::message_attempt_failing_event::MessageAttemptFailingEvent; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_failing_event_data; +pub use self::message_attempt_failing_event_data::MessageAttemptFailingEventData; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_headers_out; +pub use self::message_attempt_headers_out::MessageAttemptHeadersOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_out; +pub use self::message_attempt_out::MessageAttemptOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_recovered_event; +pub use self::message_attempt_recovered_event::MessageAttemptRecoveredEvent; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_recovered_event_data; +pub use self::message_attempt_recovered_event_data::MessageAttemptRecoveredEventData; +// TODO: Make modules private for v2.0 of the library +pub mod message_attempt_trigger_type; +pub use self::message_attempt_trigger_type::MessageAttemptTriggerType; +// TODO: Make modules private for v2.0 of the library +pub mod message_broadcast_in; +pub use self::message_broadcast_in::MessageBroadcastIn; +// TODO: Make modules private for v2.0 of the library +pub mod message_broadcast_out; +pub use self::message_broadcast_out::MessageBroadcastOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_endpoint_out; +pub use self::message_endpoint_out::MessageEndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_events_out; +pub use self::message_events_out::MessageEventsOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_in; +pub use self::message_in::MessageIn; +// TODO: Make modules private for v2.0 of the library +pub mod message_out; +pub use self::message_out::MessageOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_raw_payload_out; +pub use self::message_raw_payload_out::MessageRawPayloadOut; +// TODO: Make modules private for v2.0 of the library +pub mod message_status; +pub use self::message_status::MessageStatus; +// TODO: Make modules private for v2.0 of the library +pub mod message_subscriber_auth_token_out; +pub use self::message_subscriber_auth_token_out::MessageSubscriberAuthTokenOut; +// TODO: Make modules private for v2.0 of the library +pub mod o_auth_payload_in; +pub use self::o_auth_payload_in::OAuthPayloadIn; +// TODO: Make modules private for v2.0 of the library +pub mod o_auth_payload_out; +pub use self::o_auth_payload_out::OAuthPayloadOut; +// TODO: Make modules private for v2.0 of the library +pub mod oauth2_auth_method_in; +pub use self::oauth2_auth_method_in::Oauth2AuthMethodIn; +// TODO: Make modules private for v2.0 of the library +pub mod oauth2_grant_type_in; +pub use self::oauth2_grant_type_in::Oauth2GrantTypeIn; +// TODO: Make modules private for v2.0 of the library +pub mod oauth_jws_signing_algorithm; +pub use self::oauth_jws_signing_algorithm::OauthJwsSigningAlgorithm; +// TODO: Make modules private for v2.0 of the library +pub mod one_time_token_in; +pub use self::one_time_token_in::OneTimeTokenIn; +// TODO: Make modules private for v2.0 of the library +pub mod one_time_token_out; +pub use self::one_time_token_out::OneTimeTokenOut; +// TODO: Make modules private for v2.0 of the library +pub mod operational_webhook_endpoint_in; +pub use self::operational_webhook_endpoint_in::OperationalWebhookEndpointIn; +// TODO: Make modules private for v2.0 of the library +pub mod operational_webhook_endpoint_out; +pub use self::operational_webhook_endpoint_out::OperationalWebhookEndpointOut; +// TODO: Make modules private for v2.0 of the library +pub mod operational_webhook_endpoint_secret_in; +pub use self::operational_webhook_endpoint_secret_in::OperationalWebhookEndpointSecretIn; +// TODO: Make modules private for v2.0 of the library +pub mod operational_webhook_endpoint_secret_out; +pub use self::operational_webhook_endpoint_secret_out::OperationalWebhookEndpointSecretOut; +// TODO: Make modules private for v2.0 of the library +pub mod operational_webhook_endpoint_update; +pub use self::operational_webhook_endpoint_update::OperationalWebhookEndpointUpdate; +// TODO: Make modules private for v2.0 of the library +pub mod ordering; +pub use self::ordering::Ordering; +// TODO: Make modules private for v2.0 of the library +pub mod recover_in; +pub use self::recover_in::RecoverIn; +// TODO: Make modules private for v2.0 of the library +pub mod recover_out; +pub use self::recover_out::RecoverOut; +// TODO: Make modules private for v2.0 of the library +pub mod redshift_config; +pub use self::redshift_config::RedshiftConfig; +// TODO: Make modules private for v2.0 of the library +pub mod replay_in; +pub use self::replay_in::ReplayIn; +// TODO: Make modules private for v2.0 of the library +pub mod replay_out; +pub use self::replay_out::ReplayOut; +// TODO: Make modules private for v2.0 of the library +pub mod retry_schedule_in_out; +pub use self::retry_schedule_in_out::RetryScheduleInOut; +// TODO: Make modules private for v2.0 of the library +pub mod rotate_poller_token_in; +pub use self::rotate_poller_token_in::RotatePollerTokenIn; +// TODO: Make modules private for v2.0 of the library +pub mod rotated_url_out; +pub use self::rotated_url_out::RotatedUrlOut; +// TODO: Make modules private for v2.0 of the library +pub mod s3_config; +pub use self::s3_config::S3Config; +// TODO: Make modules private for v2.0 of the library +pub mod sink_http_config; +pub use self::sink_http_config::SinkHttpConfig; +// TODO: Make modules private for v2.0 of the library +pub mod sink_in; +pub use self::sink_in::SinkIn; +// TODO: Make modules private for v2.0 of the library +pub mod sink_in_one_of; +pub use self::sink_in_one_of::SinkInOneOf; +// TODO: Make modules private for v2.0 of the library +pub mod sink_in_one_of_1; +pub use self::sink_in_one_of_1::SinkInOneOf1; +// TODO: Make modules private for v2.0 of the library +pub mod sink_in_one_of_2; +pub use self::sink_in_one_of_2::SinkInOneOf2; +// TODO: Make modules private for v2.0 of the library +pub mod sink_in_one_of_3; +pub use self::sink_in_one_of_3::SinkInOneOf3; +// TODO: Make modules private for v2.0 of the library +pub mod sink_in_one_of_4; +pub use self::sink_in_one_of_4::SinkInOneOf4; +// TODO: Make modules private for v2.0 of the library +pub mod sink_otel_v1_config; +pub use self::sink_otel_v1_config::SinkOtelV1Config; +// TODO: Make modules private for v2.0 of the library +pub mod sink_out; +pub use self::sink_out::SinkOut; +// TODO: Make modules private for v2.0 of the library +pub mod sink_payload_format; +pub use self::sink_payload_format::SinkPayloadFormat; +// TODO: Make modules private for v2.0 of the library +pub mod sink_status; +pub use self::sink_status::SinkStatus; +// TODO: Make modules private for v2.0 of the library +pub mod sink_status_in; +pub use self::sink_status_in::SinkStatusIn; +// TODO: Make modules private for v2.0 of the library +pub mod sink_transform_in; +pub use self::sink_transform_in::SinkTransformIn; +// TODO: Make modules private for v2.0 of the library +pub mod sink_transformation_out; +pub use self::sink_transformation_out::SinkTransformationOut; +// TODO: Make modules private for v2.0 of the library +pub mod snowflake_config; +pub use self::snowflake_config::SnowflakeConfig; +// TODO: Make modules private for v2.0 of the library +pub mod statistics_period; +pub use self::statistics_period::StatisticsPeriod; +// TODO: Make modules private for v2.0 of the library +pub mod status_code_class; +pub use self::status_code_class::StatusCodeClass; +// TODO: Make modules private for v2.0 of the library +pub mod stream_event_type_in; +pub use self::stream_event_type_in::StreamEventTypeIn; +// TODO: Make modules private for v2.0 of the library +pub mod stream_event_type_out; +pub use self::stream_event_type_out::StreamEventTypeOut; +// TODO: Make modules private for v2.0 of the library +pub mod stream_event_type_patch; +pub use self::stream_event_type_patch::StreamEventTypePatch; +// TODO: Make modules private for v2.0 of the library +pub mod stream_in; +pub use self::stream_in::StreamIn; +// TODO: Make modules private for v2.0 of the library +pub mod stream_out; +pub use self::stream_out::StreamOut; +// TODO: Make modules private for v2.0 of the library +pub mod stream_patch; +pub use self::stream_patch::StreamPatch; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in; +pub use self::stream_sink_in::StreamSinkIn; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of; +pub use self::stream_sink_in_one_of::StreamSinkInOneOf; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of_1; +pub use self::stream_sink_in_one_of_1::StreamSinkInOneOf1; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of_2; +pub use self::stream_sink_in_one_of_2::StreamSinkInOneOf2; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of_3; +pub use self::stream_sink_in_one_of_3::StreamSinkInOneOf3; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of_4; +pub use self::stream_sink_in_one_of_4::StreamSinkInOneOf4; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of_5; +pub use self::stream_sink_in_one_of_5::StreamSinkInOneOf5; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of_6; +pub use self::stream_sink_in_one_of_6::StreamSinkInOneOf6; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_in_one_of_7; +pub use self::stream_sink_in_one_of_7::StreamSinkInOneOf7; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_out; +pub use self::stream_sink_out::StreamSinkOut; +// TODO: Make modules private for v2.0 of the library +pub mod stream_sink_patch; +pub use self::stream_sink_patch::StreamSinkPatch; +// TODO: Make modules private for v2.0 of the library +pub mod template_in; +pub use self::template_in::TemplateIn; +// TODO: Make modules private for v2.0 of the library +pub mod template_out; +pub use self::template_out::TemplateOut; +// TODO: Make modules private for v2.0 of the library +pub mod template_patch; +pub use self::template_patch::TemplatePatch; +// TODO: Make modules private for v2.0 of the library +pub mod template_update; +pub use self::template_update::TemplateUpdate; +// TODO: Make modules private for v2.0 of the library +pub mod transformation_http_method; +pub use self::transformation_http_method::TransformationHttpMethod; +// TODO: Make modules private for v2.0 of the library +pub mod transformation_simulate_in; +pub use self::transformation_simulate_in::TransformationSimulateIn; +// TODO: Make modules private for v2.0 of the library +pub mod transformation_simulate_out; +pub use self::transformation_simulate_out::TransformationSimulateOut; +// TODO: Make modules private for v2.0 of the library +pub mod transformation_template_kind; +pub use self::transformation_template_kind::TransformationTemplateKind; +// TODO: Make modules private for v2.0 of the library +pub mod validation_error; +pub use self::validation_error::ValidationError; diff --git a/rust/src/models/o_auth_payload_in.rs b/rust/src/models/o_auth_payload_in.rs new file mode 100644 index 000000000..dcd438c47 --- /dev/null +++ b/rust/src/models/o_auth_payload_in.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OAuthPayloadIn { + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "redirectUri")] + pub redirect_uri: String, + } + + impl OAuthPayloadIn { + pub fn new(code: String, redirect_uri: String) -> OAuthPayloadIn { + OAuthPayloadIn { + code, + redirect_uri, + } + } + } + diff --git a/rust/src/models/o_auth_payload_out.rs b/rust/src/models/o_auth_payload_out.rs new file mode 100644 index 000000000..d0b5ea317 --- /dev/null +++ b/rust/src/models/o_auth_payload_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OAuthPayloadOut { + #[serde(rename = "accessToken", skip_serializing_if = "Option::is_none")] + pub access_token: Option, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, + #[serde(rename = "refreshToken", skip_serializing_if = "Option::is_none")] + pub refresh_token: Option, + } + + impl OAuthPayloadOut { + pub fn new() -> OAuthPayloadOut { + OAuthPayloadOut { + access_token: None, + error: None, + refresh_token: None, + } + } + } + diff --git a/rust/src/models/oauth2_auth_method_in.rs b/rust/src/models/oauth2_auth_method_in.rs new file mode 100644 index 000000000..abe36af25 --- /dev/null +++ b/rust/src/models/oauth2_auth_method_in.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// Oauth2AuthMethodIn : The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred. + /// The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred. + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Oauth2AuthMethodIn { + #[serde(rename = "clientSecretJwt")] + ClientSecretJwt, + #[serde(rename = "clientSecretBasic")] + ClientSecretBasic, + #[serde(rename = "clientSecretPost")] + ClientSecretPost, + + } + + impl std::fmt::Display for Oauth2AuthMethodIn { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::ClientSecretJwt => write!(f, "clientSecretJwt"), + Self::ClientSecretBasic => write!(f, "clientSecretBasic"), + Self::ClientSecretPost => write!(f, "clientSecretPost"), + } + } + } + + impl Default for Oauth2AuthMethodIn { + fn default() -> Oauth2AuthMethodIn { + Self::ClientSecretJwt + } + } + diff --git a/rust/src/models/oauth2_grant_type_in.rs b/rust/src/models/oauth2_grant_type_in.rs new file mode 100644 index 000000000..34bc345b2 --- /dev/null +++ b/rust/src/models/oauth2_grant_type_in.rs @@ -0,0 +1,40 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Oauth2GrantTypeIn { + #[serde(rename = "clientCredentials")] + ClientCredentials, + #[serde(rename = "refreshToken")] + RefreshToken, + + } + + impl std::fmt::Display for Oauth2GrantTypeIn { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::ClientCredentials => write!(f, "clientCredentials"), + Self::RefreshToken => write!(f, "refreshToken"), + } + } + } + + impl Default for Oauth2GrantTypeIn { + fn default() -> Oauth2GrantTypeIn { + Self::ClientCredentials + } + } + diff --git a/rust/src/models/oauth_jws_signing_algorithm.rs b/rust/src/models/oauth_jws_signing_algorithm.rs new file mode 100644 index 000000000..35169bf88 --- /dev/null +++ b/rust/src/models/oauth_jws_signing_algorithm.rs @@ -0,0 +1,37 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum OauthJwsSigningAlgorithm { + #[serde(rename = "RS256")] + Rs256, + + } + + impl std::fmt::Display for OauthJwsSigningAlgorithm { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Rs256 => write!(f, "RS256"), + } + } + } + + impl Default for OauthJwsSigningAlgorithm { + fn default() -> OauthJwsSigningAlgorithm { + Self::Rs256 + } + } + diff --git a/rust/src/models/one_time_token_in.rs b/rust/src/models/one_time_token_in.rs new file mode 100644 index 000000000..4d98b4785 --- /dev/null +++ b/rust/src/models/one_time_token_in.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OneTimeTokenIn { + #[serde(rename = "oneTimeToken")] + pub one_time_token: String, + } + + impl OneTimeTokenIn { + pub fn new(one_time_token: String) -> OneTimeTokenIn { + OneTimeTokenIn { + one_time_token, + } + } + } + diff --git a/rust/src/models/one_time_token_out.rs b/rust/src/models/one_time_token_out.rs new file mode 100644 index 000000000..b4f20180a --- /dev/null +++ b/rust/src/models/one_time_token_out.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OneTimeTokenOut { + #[serde(rename = "token")] + pub token: String, + } + + impl OneTimeTokenOut { + pub fn new(token: String) -> OneTimeTokenOut { + OneTimeTokenOut { + token, + } + } + } + diff --git a/rust/src/models/operational_webhook_endpoint_in.rs b/rust/src/models/operational_webhook_endpoint_in.rs new file mode 100644 index 000000000..7bbf4d252 --- /dev/null +++ b/rust/src/models/operational_webhook_endpoint_in.rs @@ -0,0 +1,52 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OperationalWebhookEndpointIn { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, + /// Optional unique identifier for the endpoint. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "url")] + pub url: String, + } + + impl OperationalWebhookEndpointIn { + pub fn new(url: String) -> OperationalWebhookEndpointIn { + OperationalWebhookEndpointIn { + description: None, + disabled: None, + filter_types: None, + metadata: None, + rate_limit: None, + secret: None, + uid: None, + url, + } + } + } + diff --git a/rust/src/models/operational_webhook_endpoint_out.rs b/rust/src/models/operational_webhook_endpoint_out.rs new file mode 100644 index 000000000..33e1b0d69 --- /dev/null +++ b/rust/src/models/operational_webhook_endpoint_out.rs @@ -0,0 +1,59 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OperationalWebhookEndpointOut { + #[serde(rename = "createdAt")] + pub created_at: String, + /// An example endpoint name. + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + /// The ep's ID + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "metadata")] + pub metadata: std::collections::HashMap, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// Optional unique identifier for the endpoint. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "updatedAt")] + pub updated_at: String, + #[serde(rename = "url")] + pub url: String, + } + + impl OperationalWebhookEndpointOut { + pub fn new(created_at: String, description: String, id: String, metadata: std::collections::HashMap, updated_at: String, url: String) -> OperationalWebhookEndpointOut { + OperationalWebhookEndpointOut { + created_at, + description, + disabled: None, + filter_types: None, + id, + metadata, + rate_limit: None, + uid: None, + updated_at, + url, + } + } + } + diff --git a/rust/src/models/operational_webhook_endpoint_secret_in.rs b/rust/src/models/operational_webhook_endpoint_secret_in.rs new file mode 100644 index 000000000..1d5880b0f --- /dev/null +++ b/rust/src/models/operational_webhook_endpoint_secret_in.rs @@ -0,0 +1,30 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OperationalWebhookEndpointSecretIn { + /// The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret. + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + } + + impl OperationalWebhookEndpointSecretIn { + pub fn new() -> OperationalWebhookEndpointSecretIn { + OperationalWebhookEndpointSecretIn { + key: None, + } + } + } + diff --git a/rust/src/models/operational_webhook_endpoint_secret_out.rs b/rust/src/models/operational_webhook_endpoint_secret_out.rs new file mode 100644 index 000000000..56a31730f --- /dev/null +++ b/rust/src/models/operational_webhook_endpoint_secret_out.rs @@ -0,0 +1,30 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OperationalWebhookEndpointSecretOut { + /// The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret. + #[serde(rename = "key")] + pub key: String, + } + + impl OperationalWebhookEndpointSecretOut { + pub fn new(key: String) -> OperationalWebhookEndpointSecretOut { + OperationalWebhookEndpointSecretOut { + key, + } + } + } + diff --git a/rust/src/models/operational_webhook_endpoint_update.rs b/rust/src/models/operational_webhook_endpoint_update.rs new file mode 100644 index 000000000..bf27c117c --- /dev/null +++ b/rust/src/models/operational_webhook_endpoint_update.rs @@ -0,0 +1,48 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct OperationalWebhookEndpointUpdate { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] + pub rate_limit: Option, + /// Optional unique identifier for the endpoint. + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "url")] + pub url: String, + } + + impl OperationalWebhookEndpointUpdate { + pub fn new(url: String) -> OperationalWebhookEndpointUpdate { + OperationalWebhookEndpointUpdate { + description: None, + disabled: None, + filter_types: None, + metadata: None, + rate_limit: None, + uid: None, + url, + } + } + } + diff --git a/rust/src/models/ordering.rs b/rust/src/models/ordering.rs new file mode 100644 index 000000000..3d1962215 --- /dev/null +++ b/rust/src/models/ordering.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// Ordering : Defines the ordering in a listing of results. + /// Defines the ordering in a listing of results. + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Ordering { + #[serde(rename = "ascending")] + Ascending, + #[serde(rename = "descending")] + Descending, + + } + + impl std::fmt::Display for Ordering { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Ascending => write!(f, "ascending"), + Self::Descending => write!(f, "descending"), + } + } + } + + impl Default for Ordering { + fn default() -> Ordering { + Self::Ascending + } + } + diff --git a/rust/src/models/recover_in.rs b/rust/src/models/recover_in.rs new file mode 100644 index 000000000..39b3fbc38 --- /dev/null +++ b/rust/src/models/recover_in.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct RecoverIn { + #[serde(rename = "since")] + pub since: String, + #[serde(rename = "until", skip_serializing_if = "Option::is_none")] + pub until: Option, + } + + impl RecoverIn { + pub fn new(since: String) -> RecoverIn { + RecoverIn { + since, + until: None, + } + } + } + diff --git a/rust/src/models/recover_out.rs b/rust/src/models/recover_out.rs new file mode 100644 index 000000000..332c15c59 --- /dev/null +++ b/rust/src/models/recover_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct RecoverOut { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: models::BackgroundTaskStatus, + #[serde(rename = "task")] + pub task: models::BackgroundTaskType, + } + + impl RecoverOut { + pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType) -> RecoverOut { + RecoverOut { + id, + status, + task, + } + } + } + diff --git a/rust/src/models/redshift_config.rs b/rust/src/models/redshift_config.rs new file mode 100644 index 000000000..c20fd4a1e --- /dev/null +++ b/rust/src/models/redshift_config.rs @@ -0,0 +1,55 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// RedshiftConfig : Configuration parameters for defining a Redshift sink. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct RedshiftConfig { + #[serde(rename = "accessKeyId")] + pub access_key_id: String, + #[serde(rename = "clusterIdentifier")] + pub cluster_identifier: String, + /// Database name. Only required if not using transformations. + #[serde(rename = "dbName", skip_serializing_if = "Option::is_none")] + pub db_name: Option, + #[serde(rename = "dbUser")] + pub db_user: String, + #[serde(rename = "region")] + pub region: String, + /// Schema name. Only used if not using transformations. + #[serde(rename = "schemaName", skip_serializing_if = "Option::is_none")] + pub schema_name: Option, + #[serde(rename = "secretAccessKey")] + pub secret_access_key: String, + /// Table name. Only required if not using transformations. + #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] + pub table_name: Option, + } + + impl RedshiftConfig { + /// Configuration parameters for defining a Redshift sink. + pub fn new(access_key_id: String, cluster_identifier: String, db_user: String, region: String, secret_access_key: String) -> RedshiftConfig { + RedshiftConfig { + access_key_id, + cluster_identifier, + db_name: None, + db_user, + region, + schema_name: None, + secret_access_key, + table_name: None, + } + } + } + diff --git a/rust/src/models/replay_in.rs b/rust/src/models/replay_in.rs new file mode 100644 index 000000000..b191d420e --- /dev/null +++ b/rust/src/models/replay_in.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ReplayIn { + #[serde(rename = "since")] + pub since: String, + #[serde(rename = "until", skip_serializing_if = "Option::is_none")] + pub until: Option, + } + + impl ReplayIn { + pub fn new(since: String) -> ReplayIn { + ReplayIn { + since, + until: None, + } + } + } + diff --git a/rust/src/models/replay_out.rs b/rust/src/models/replay_out.rs new file mode 100644 index 000000000..e03c17f8c --- /dev/null +++ b/rust/src/models/replay_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ReplayOut { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: models::BackgroundTaskStatus, + #[serde(rename = "task")] + pub task: models::BackgroundTaskType, + } + + impl ReplayOut { + pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType) -> ReplayOut { + ReplayOut { + id, + status, + task, + } + } + } + diff --git a/rust/src/models/retry_schedule_in_out.rs b/rust/src/models/retry_schedule_in_out.rs new file mode 100644 index 000000000..0c4676b15 --- /dev/null +++ b/rust/src/models/retry_schedule_in_out.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct RetryScheduleInOut { + #[serde(rename = "retrySchedule", skip_serializing_if = "Option::is_none")] + pub retry_schedule: Option>, + } + + impl RetryScheduleInOut { + pub fn new() -> RetryScheduleInOut { + RetryScheduleInOut { + retry_schedule: None, + } + } + } + diff --git a/rust/src/models/rotate_poller_token_in.rs b/rust/src/models/rotate_poller_token_in.rs new file mode 100644 index 000000000..56351e59d --- /dev/null +++ b/rust/src/models/rotate_poller_token_in.rs @@ -0,0 +1,34 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct RotatePollerTokenIn { + /// How long the token will be valid for, in seconds. Can be up to 31,536,000 seconds (1 year). + #[serde(rename = "expiry", skip_serializing_if = "Option::is_none")] + pub expiry: Option, + /// Updates the previous token's expiration, in seconds. If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day). Defaults to 300 seconds (5 minutes). + #[serde(rename = "oldTokenExpiry", skip_serializing_if = "Option::is_none")] + pub old_token_expiry: Option, + } + + impl RotatePollerTokenIn { + pub fn new() -> RotatePollerTokenIn { + RotatePollerTokenIn { + expiry: None, + old_token_expiry: None, + } + } + } + diff --git a/rust/src/models/rotated_url_out.rs b/rust/src/models/rotated_url_out.rs new file mode 100644 index 000000000..0c1ebac8e --- /dev/null +++ b/rust/src/models/rotated_url_out.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct RotatedUrlOut { + #[serde(rename = "url")] + pub url: String, + } + + impl RotatedUrlOut { + pub fn new(url: String) -> RotatedUrlOut { + RotatedUrlOut { + url, + } + } + } + diff --git a/rust/src/models/s3_config.rs b/rust/src/models/s3_config.rs new file mode 100644 index 000000000..baf64de9c --- /dev/null +++ b/rust/src/models/s3_config.rs @@ -0,0 +1,38 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct S3Config { + #[serde(rename = "accessKeyId")] + pub access_key_id: String, + #[serde(rename = "bucket")] + pub bucket: String, + #[serde(rename = "region")] + pub region: String, + #[serde(rename = "secretAccessKey")] + pub secret_access_key: String, + } + + impl S3Config { + pub fn new(access_key_id: String, bucket: String, region: String, secret_access_key: String) -> S3Config { + S3Config { + access_key_id, + bucket, + region, + secret_access_key, + } + } + } + diff --git a/rust/src/models/sink_http_config.rs b/rust/src/models/sink_http_config.rs new file mode 100644 index 000000000..ba382240c --- /dev/null +++ b/rust/src/models/sink_http_config.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkHttpConfig { + #[serde(rename = "headers", skip_serializing_if = "Option::is_none")] + pub headers: Option>, + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + #[serde(rename = "url")] + pub url: String, + } + + impl SinkHttpConfig { + pub fn new(url: String) -> SinkHttpConfig { + SinkHttpConfig { + headers: None, + key: None, + url, + } + } + } + diff --git a/rust/src/models/sink_in.rs b/rust/src/models/sink_in.rs new file mode 100644 index 000000000..65d97c32e --- /dev/null +++ b/rust/src/models/sink_in.rs @@ -0,0 +1,51 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(untagged)] + pub enum SinkIn { + SinkInOneOf(Box), + SinkInOneOf1(Box), + SinkInOneOf2(Box), + SinkInOneOf3(Box), + SinkInOneOf4(Box), + } + + impl Default for SinkIn { + fn default() -> Self { + Self::SinkInOneOf(Default::default()) + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "rabbitMQ")] + RabbitMq, + #[serde(rename = "sqs")] + Sqs, + #[serde(rename = "kafka")] + Kafka, + #[serde(rename = "http")] + Http, + #[serde(rename = "eventStream")] + EventStream, + } + + impl Default for Type { + fn default() -> Type { + Self::RabbitMq + } + } + diff --git a/rust/src/models/sink_in_one_of.rs b/rust/src/models/sink_in_one_of.rs new file mode 100644 index 000000000..030089167 --- /dev/null +++ b/rust/src/models/sink_in_one_of.rs @@ -0,0 +1,47 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkInOneOf { + #[serde(rename = "routingKey")] + pub routing_key: String, + #[serde(rename = "type")] + pub r#type: Type, + #[serde(rename = "uri")] + pub uri: String, + } + + impl SinkInOneOf { + pub fn new(routing_key: String, r#type: Type, uri: String) -> SinkInOneOf { + SinkInOneOf { + routing_key, + r#type, + uri, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "rabbitMQ")] + RabbitMq, + } + + impl Default for Type { + fn default() -> Type { + Self::RabbitMq + } + } + diff --git a/rust/src/models/sink_in_one_of_1.rs b/rust/src/models/sink_in_one_of_1.rs new file mode 100644 index 000000000..cd3705c2a --- /dev/null +++ b/rust/src/models/sink_in_one_of_1.rs @@ -0,0 +1,53 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkInOneOf1 { + #[serde(rename = "accessKey")] + pub access_key: String, + #[serde(rename = "queueDsn")] + pub queue_dsn: String, + #[serde(rename = "region")] + pub region: String, + #[serde(rename = "secretKey")] + pub secret_key: String, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl SinkInOneOf1 { + pub fn new(access_key: String, queue_dsn: String, region: String, secret_key: String, r#type: Type) -> SinkInOneOf1 { + SinkInOneOf1 { + access_key, + queue_dsn, + region, + secret_key, + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "sqs")] + Sqs, + } + + impl Default for Type { + fn default() -> Type { + Self::Sqs + } + } + diff --git a/rust/src/models/sink_in_one_of_2.rs b/rust/src/models/sink_in_one_of_2.rs new file mode 100644 index 000000000..80dc8cdde --- /dev/null +++ b/rust/src/models/sink_in_one_of_2.rs @@ -0,0 +1,58 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkInOneOf2 { + #[serde(rename = "brokers")] + pub brokers: String, + /// Password for SASL, if `security_protocol` is `sasl-ssl`. + #[serde(rename = "saslPassword", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sasl_password: Option>, + /// Username for SASL, if `security_protocol` is `sasl-ssl`. + #[serde(rename = "saslUsername", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sasl_username: Option>, + #[serde(rename = "securityProtocol")] + pub security_protocol: models::KafkaSecurityProtocolType, + #[serde(rename = "topic")] + pub topic: String, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl SinkInOneOf2 { + pub fn new(brokers: String, security_protocol: models::KafkaSecurityProtocolType, topic: String, r#type: Type) -> SinkInOneOf2 { + SinkInOneOf2 { + brokers, + sasl_password: None, + sasl_username: None, + security_protocol, + topic, + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "kafka")] + Kafka, + } + + impl Default for Type { + fn default() -> Type { + Self::Kafka + } + } + diff --git a/rust/src/models/sink_in_one_of_3.rs b/rust/src/models/sink_in_one_of_3.rs new file mode 100644 index 000000000..912ea7eea --- /dev/null +++ b/rust/src/models/sink_in_one_of_3.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkInOneOf3 { + #[serde(rename = "type")] + pub r#type: Type, + #[serde(rename = "url")] + pub url: String, + } + + impl SinkInOneOf3 { + pub fn new(r#type: Type, url: String) -> SinkInOneOf3 { + SinkInOneOf3 { + r#type, + url, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "http")] + Http, + } + + impl Default for Type { + fn default() -> Type { + Self::Http + } + } + diff --git a/rust/src/models/sink_in_one_of_4.rs b/rust/src/models/sink_in_one_of_4.rs new file mode 100644 index 000000000..f8f0c1223 --- /dev/null +++ b/rust/src/models/sink_in_one_of_4.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkInOneOf4 { + #[serde(rename = "type")] + pub r#type: Type, + } + + impl SinkInOneOf4 { + pub fn new(r#type: Type) -> SinkInOneOf4 { + SinkInOneOf4 { + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "eventStream")] + EventStream, + } + + impl Default for Type { + fn default() -> Type { + Self::EventStream + } + } + diff --git a/rust/src/models/sink_otel_v1_config.rs b/rust/src/models/sink_otel_v1_config.rs new file mode 100644 index 000000000..4abe413de --- /dev/null +++ b/rust/src/models/sink_otel_v1_config.rs @@ -0,0 +1,29 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkOtelV1Config { + #[serde(rename = "url")] + pub url: String, + } + + impl SinkOtelV1Config { + pub fn new(url: String) -> SinkOtelV1Config { + SinkOtelV1Config { + url, + } + } + } + diff --git a/rust/src/models/sink_out.rs b/rust/src/models/sink_out.rs new file mode 100644 index 000000000..31313a122 --- /dev/null +++ b/rust/src/models/sink_out.rs @@ -0,0 +1,51 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(untagged)] + pub enum SinkOut { + SinkInOneOf(Box), + SinkInOneOf1(Box), + SinkInOneOf2(Box), + SinkInOneOf3(Box), + SinkInOneOf4(Box), + } + + impl Default for SinkOut { + fn default() -> Self { + Self::SinkInOneOf(Default::default()) + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "rabbitMQ")] + RabbitMq, + #[serde(rename = "sqs")] + Sqs, + #[serde(rename = "kafka")] + Kafka, + #[serde(rename = "http")] + Http, + #[serde(rename = "eventStream")] + EventStream, + } + + impl Default for Type { + fn default() -> Type { + Self::RabbitMq + } + } + diff --git a/rust/src/models/sink_payload_format.rs b/rust/src/models/sink_payload_format.rs new file mode 100644 index 000000000..8ab240ea3 --- /dev/null +++ b/rust/src/models/sink_payload_format.rs @@ -0,0 +1,37 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum SinkPayloadFormat { + #[serde(rename = "json")] + Json, + + } + + impl std::fmt::Display for SinkPayloadFormat { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Json => write!(f, "json"), + } + } + } + + impl Default for SinkPayloadFormat { + fn default() -> SinkPayloadFormat { + Self::Json + } + } + diff --git a/rust/src/models/sink_status.rs b/rust/src/models/sink_status.rs new file mode 100644 index 000000000..a177246b2 --- /dev/null +++ b/rust/src/models/sink_status.rs @@ -0,0 +1,43 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum SinkStatus { + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "paused")] + Paused, + #[serde(rename = "disabled")] + Disabled, + + } + + impl std::fmt::Display for SinkStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Enabled => write!(f, "enabled"), + Self::Paused => write!(f, "paused"), + Self::Disabled => write!(f, "disabled"), + } + } + } + + impl Default for SinkStatus { + fn default() -> SinkStatus { + Self::Enabled + } + } + diff --git a/rust/src/models/sink_status_in.rs b/rust/src/models/sink_status_in.rs new file mode 100644 index 000000000..2168ae301 --- /dev/null +++ b/rust/src/models/sink_status_in.rs @@ -0,0 +1,40 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum SinkStatusIn { + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "paused")] + Paused, + + } + + impl std::fmt::Display for SinkStatusIn { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Enabled => write!(f, "enabled"), + Self::Paused => write!(f, "paused"), + } + } + } + + impl Default for SinkStatusIn { + fn default() -> SinkStatusIn { + Self::Enabled + } + } + diff --git a/rust/src/models/sink_transform_in.rs b/rust/src/models/sink_transform_in.rs new file mode 100644 index 000000000..eec2bbd00 --- /dev/null +++ b/rust/src/models/sink_transform_in.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkTransformIn { + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + + impl SinkTransformIn { + pub fn new() -> SinkTransformIn { + SinkTransformIn { + code: None, + enabled: None, + } + } + } + diff --git a/rust/src/models/sink_transformation_out.rs b/rust/src/models/sink_transformation_out.rs new file mode 100644 index 000000000..200541353 --- /dev/null +++ b/rust/src/models/sink_transformation_out.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SinkTransformationOut { + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + + impl SinkTransformationOut { + pub fn new() -> SinkTransformationOut { + SinkTransformationOut { + code: None, + enabled: None, + } + } + } + diff --git a/rust/src/models/snowflake_config.rs b/rust/src/models/snowflake_config.rs new file mode 100644 index 000000000..69cdca1c7 --- /dev/null +++ b/rust/src/models/snowflake_config.rs @@ -0,0 +1,52 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// SnowflakeConfig : Configuration parameters for defining a Snowflake sink. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct SnowflakeConfig { + /// Snowflake account identifier, which includes both the organization and account IDs separated by a hyphen. + #[serde(rename = "accountIdentifier")] + pub account_identifier: String, + /// Database name. Only required if not using transformations. + #[serde(rename = "dbName", skip_serializing_if = "Option::is_none")] + pub db_name: Option, + /// PEM-encoded private key used for signing token-based requests to the Snowflake API. Beginning/end delimiters are not required. + #[serde(rename = "privateKey")] + pub private_key: String, + /// Schema name. Only required if not using transformations. + #[serde(rename = "schemaName", skip_serializing_if = "Option::is_none")] + pub schema_name: Option, + /// Table name. Only required if not using transformations. + #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] + pub table_name: Option, + /// The Snowflake user id. + #[serde(rename = "userId")] + pub user_id: String, + } + + impl SnowflakeConfig { + /// Configuration parameters for defining a Snowflake sink. + pub fn new(account_identifier: String, private_key: String, user_id: String) -> SnowflakeConfig { + SnowflakeConfig { + account_identifier, + db_name: None, + private_key, + schema_name: None, + table_name: None, + user_id, + } + } + } + diff --git a/rust/src/models/statistics_period.rs b/rust/src/models/statistics_period.rs new file mode 100644 index 000000000..47ab74b74 --- /dev/null +++ b/rust/src/models/statistics_period.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// StatisticsPeriod : Period length for a statistics data point. + /// Period length for a statistics data point. + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum StatisticsPeriod { + #[serde(rename = "OneDay")] + OneDay, + #[serde(rename = "FiveMinutes")] + FiveMinutes, + + } + + impl std::fmt::Display for StatisticsPeriod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::OneDay => write!(f, "OneDay"), + Self::FiveMinutes => write!(f, "FiveMinutes"), + } + } + } + + impl Default for StatisticsPeriod { + fn default() -> StatisticsPeriod { + Self::OneDay + } + } + diff --git a/rust/src/models/status_code_class.rs b/rust/src/models/status_code_class.rs new file mode 100644 index 000000000..a318f9c48 --- /dev/null +++ b/rust/src/models/status_code_class.rs @@ -0,0 +1,48 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + use serde_repr::{Serialize_repr,Deserialize_repr}; + /// StatusCodeClass : The different classes of HTTP status codes: - CodeNone = 0 - Code1xx = 100 - Code2xx = 200 - Code3xx = 300 - Code4xx = 400 - Code5xx = 500 + /// The different classes of HTTP status codes: - CodeNone = 0 - Code1xx = 100 - Code2xx = 200 - Code3xx = 300 - Code4xx = 400 - Code5xx = 500 + #[repr(i64)] + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] + pub enum StatusCodeClass { + CodeNone = 0, + Code1xx = 100, + Code2xx = 200, + Code3xx = 300, + Code4xx = 400, + Code5xx = 500, + + } + + impl std::fmt::Display for StatusCodeClass { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", match self { + Self::CodeNone => "0", + Self::Code1xx => "100", + Self::Code2xx => "200", + Self::Code3xx => "300", + Self::Code4xx => "400", + Self::Code5xx => "500", + }) + } + } + impl Default for StatusCodeClass { + fn default() -> StatusCodeClass { + Self::CodeNone + } + } + diff --git a/rust/src/models/stream_event_type_in.rs b/rust/src/models/stream_event_type_in.rs new file mode 100644 index 000000000..da3550ff6 --- /dev/null +++ b/rust/src/models/stream_event_type_in.rs @@ -0,0 +1,33 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamEventTypeIn { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// The event type's name + #[serde(rename = "name")] + pub name: String, + } + + impl StreamEventTypeIn { + pub fn new(name: String) -> StreamEventTypeIn { + StreamEventTypeIn { + description: None, + name, + } + } + } + diff --git a/rust/src/models/stream_event_type_out.rs b/rust/src/models/stream_event_type_out.rs new file mode 100644 index 000000000..b68415d81 --- /dev/null +++ b/rust/src/models/stream_event_type_out.rs @@ -0,0 +1,39 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamEventTypeOut { + #[serde(rename = "createdAt")] + pub created_at: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// The event type's name + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "updatedAt")] + pub updated_at: String, + } + + impl StreamEventTypeOut { + pub fn new(created_at: String, name: String, updated_at: String) -> StreamEventTypeOut { + StreamEventTypeOut { + created_at, + description: None, + name, + updated_at, + } + } + } + diff --git a/rust/src/models/stream_event_type_patch.rs b/rust/src/models/stream_event_type_patch.rs new file mode 100644 index 000000000..df0c993c7 --- /dev/null +++ b/rust/src/models/stream_event_type_patch.rs @@ -0,0 +1,33 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamEventTypePatch { + #[serde(rename = "description", deserialize_with = "Option::deserialize")] + pub description: Option, + /// The event type's name + #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub name: Option>, + } + + impl StreamEventTypePatch { + pub fn new(description: Option) -> StreamEventTypePatch { + StreamEventTypePatch { + description, + name: None, + } + } + } + diff --git a/rust/src/models/stream_in.rs b/rust/src/models/stream_in.rs new file mode 100644 index 000000000..7fff427c7 --- /dev/null +++ b/rust/src/models/stream_in.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamIn { + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + } + + impl StreamIn { + pub fn new(description: String) -> StreamIn { + StreamIn { + description, + uid: None, + } + } + } + diff --git a/rust/src/models/stream_out.rs b/rust/src/models/stream_out.rs new file mode 100644 index 000000000..3796a9e1b --- /dev/null +++ b/rust/src/models/stream_out.rs @@ -0,0 +1,41 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamOut { + #[serde(rename = "createdAt")] + pub created_at: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "updatedAt")] + pub updated_at: String, + } + + impl StreamOut { + pub fn new(created_at: String, id: String, updated_at: String) -> StreamOut { + StreamOut { + created_at, + description: None, + id, + uid: None, + updated_at, + } + } + } + diff --git a/rust/src/models/stream_patch.rs b/rust/src/models/stream_patch.rs new file mode 100644 index 000000000..fabbb1a2f --- /dev/null +++ b/rust/src/models/stream_patch.rs @@ -0,0 +1,32 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamPatch { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + } + + impl StreamPatch { + pub fn new() -> StreamPatch { + StreamPatch { + description: None, + uid: None, + } + } + } + diff --git a/rust/src/models/stream_sink_in.rs b/rust/src/models/stream_sink_in.rs new file mode 100644 index 000000000..70b4a1910 --- /dev/null +++ b/rust/src/models/stream_sink_in.rs @@ -0,0 +1,60 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(untagged)] + pub enum StreamSinkIn { + StreamSinkInOneOf(Box), + StreamSinkInOneOf1(Box), + StreamSinkInOneOf2(Box), + StreamSinkInOneOf3(Box), + StreamSinkInOneOf4(Box), + StreamSinkInOneOf5(Box), + StreamSinkInOneOf6(Box), + StreamSinkInOneOf7(Box), + } + + impl Default for StreamSinkIn { + fn default() -> Self { + Self::StreamSinkInOneOf(Default::default()) + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "azureBlobStorage")] + AzureBlobStorage, + #[serde(rename = "otelV1HttpTrace")] + OtelV1HttpTrace, + #[serde(rename = "http")] + Http, + #[serde(rename = "amazonS3")] + AmazonS3, + #[serde(rename = "snowflake")] + Snowflake, + #[serde(rename = "googleCloudStorage")] + GoogleCloudStorage, + #[serde(rename = "redshift")] + Redshift, + #[serde(rename = "bigQuery")] + BigQuery, + } + + impl Default for Type { + fn default() -> Type { + Self::AzureBlobStorage + } + } + diff --git a/rust/src/models/stream_sink_in_one_of.rs b/rust/src/models/stream_sink_in_one_of.rs new file mode 100644 index 000000000..e24245725 --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf { + pub fn new(config: models::AzureBlobStorageConfig, r#type: Type) -> StreamSinkInOneOf { + StreamSinkInOneOf { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "azureBlobStorage")] + AzureBlobStorage, + } + + impl Default for Type { + fn default() -> Type { + Self::AzureBlobStorage + } + } + diff --git a/rust/src/models/stream_sink_in_one_of_1.rs b/rust/src/models/stream_sink_in_one_of_1.rs new file mode 100644 index 000000000..821f37fa0 --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of_1.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf1 { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf1 { + pub fn new(config: models::SinkOtelV1Config, r#type: Type) -> StreamSinkInOneOf1 { + StreamSinkInOneOf1 { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "otelV1HttpTrace")] + OtelV1HttpTrace, + } + + impl Default for Type { + fn default() -> Type { + Self::OtelV1HttpTrace + } + } + diff --git a/rust/src/models/stream_sink_in_one_of_2.rs b/rust/src/models/stream_sink_in_one_of_2.rs new file mode 100644 index 000000000..e09e883dc --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of_2.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf2 { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf2 { + pub fn new(config: models::SinkHttpConfig, r#type: Type) -> StreamSinkInOneOf2 { + StreamSinkInOneOf2 { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "http")] + Http, + } + + impl Default for Type { + fn default() -> Type { + Self::Http + } + } + diff --git a/rust/src/models/stream_sink_in_one_of_3.rs b/rust/src/models/stream_sink_in_one_of_3.rs new file mode 100644 index 000000000..fec738be9 --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of_3.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf3 { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf3 { + pub fn new(config: models::S3Config, r#type: Type) -> StreamSinkInOneOf3 { + StreamSinkInOneOf3 { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "amazonS3")] + AmazonS3, + } + + impl Default for Type { + fn default() -> Type { + Self::AmazonS3 + } + } + diff --git a/rust/src/models/stream_sink_in_one_of_4.rs b/rust/src/models/stream_sink_in_one_of_4.rs new file mode 100644 index 000000000..4f346ddff --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of_4.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf4 { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf4 { + pub fn new(config: models::SnowflakeConfig, r#type: Type) -> StreamSinkInOneOf4 { + StreamSinkInOneOf4 { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "snowflake")] + Snowflake, + } + + impl Default for Type { + fn default() -> Type { + Self::Snowflake + } + } + diff --git a/rust/src/models/stream_sink_in_one_of_5.rs b/rust/src/models/stream_sink_in_one_of_5.rs new file mode 100644 index 000000000..d79f54a55 --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of_5.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf5 { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf5 { + pub fn new(config: models::GoogleCloudStorageConfig, r#type: Type) -> StreamSinkInOneOf5 { + StreamSinkInOneOf5 { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "googleCloudStorage")] + GoogleCloudStorage, + } + + impl Default for Type { + fn default() -> Type { + Self::GoogleCloudStorage + } + } + diff --git a/rust/src/models/stream_sink_in_one_of_6.rs b/rust/src/models/stream_sink_in_one_of_6.rs new file mode 100644 index 000000000..8c733dc3c --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of_6.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf6 { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf6 { + pub fn new(config: models::RedshiftConfig, r#type: Type) -> StreamSinkInOneOf6 { + StreamSinkInOneOf6 { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "redshift")] + Redshift, + } + + impl Default for Type { + fn default() -> Type { + Self::Redshift + } + } + diff --git a/rust/src/models/stream_sink_in_one_of_7.rs b/rust/src/models/stream_sink_in_one_of_7.rs new file mode 100644 index 000000000..ac33b410d --- /dev/null +++ b/rust/src/models/stream_sink_in_one_of_7.rs @@ -0,0 +1,44 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct StreamSinkInOneOf7 { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "type")] + pub r#type: Type, + } + + impl StreamSinkInOneOf7 { + pub fn new(config: models::BigQueryConfig, r#type: Type) -> StreamSinkInOneOf7 { + StreamSinkInOneOf7 { + config: Box::new(config), + r#type, + } + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "bigQuery")] + BigQuery, + } + + impl Default for Type { + fn default() -> Type { + Self::BigQuery + } + } + diff --git a/rust/src/models/stream_sink_out.rs b/rust/src/models/stream_sink_out.rs new file mode 100644 index 000000000..fc2e773eb --- /dev/null +++ b/rust/src/models/stream_sink_out.rs @@ -0,0 +1,60 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(untagged)] + pub enum StreamSinkOut { + StreamSinkInOneOf(Box), + StreamSinkInOneOf1(Box), + StreamSinkInOneOf2(Box), + StreamSinkInOneOf3(Box), + StreamSinkInOneOf4(Box), + StreamSinkInOneOf5(Box), + StreamSinkInOneOf6(Box), + StreamSinkInOneOf7(Box), + } + + impl Default for StreamSinkOut { + fn default() -> Self { + Self::StreamSinkInOneOf(Default::default()) + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "azureBlobStorage")] + AzureBlobStorage, + #[serde(rename = "otelV1HttpTrace")] + OtelV1HttpTrace, + #[serde(rename = "http")] + Http, + #[serde(rename = "amazonS3")] + AmazonS3, + #[serde(rename = "snowflake")] + Snowflake, + #[serde(rename = "googleCloudStorage")] + GoogleCloudStorage, + #[serde(rename = "redshift")] + Redshift, + #[serde(rename = "bigQuery")] + BigQuery, + } + + impl Default for Type { + fn default() -> Type { + Self::AzureBlobStorage + } + } + diff --git a/rust/src/models/stream_sink_patch.rs b/rust/src/models/stream_sink_patch.rs new file mode 100644 index 000000000..e25d4e387 --- /dev/null +++ b/rust/src/models/stream_sink_patch.rs @@ -0,0 +1,60 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(untagged)] + pub enum StreamSinkPatch { + StreamSinkInOneOf(Box), + StreamSinkInOneOf1(Box), + StreamSinkInOneOf2(Box), + StreamSinkInOneOf3(Box), + StreamSinkInOneOf4(Box), + StreamSinkInOneOf5(Box), + StreamSinkInOneOf6(Box), + StreamSinkInOneOf7(Box), + } + + impl Default for StreamSinkPatch { + fn default() -> Self { + Self::StreamSinkInOneOf(Default::default()) + } + } + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum Type { + #[serde(rename = "azureBlobStorage")] + AzureBlobStorage, + #[serde(rename = "otelV1HttpTrace")] + OtelV1HttpTrace, + #[serde(rename = "http")] + Http, + #[serde(rename = "amazonS3")] + AmazonS3, + #[serde(rename = "snowflake")] + Snowflake, + #[serde(rename = "googleCloudStorage")] + GoogleCloudStorage, + #[serde(rename = "redshift")] + Redshift, + #[serde(rename = "bigQuery")] + BigQuery, + } + + impl Default for Type { + fn default() -> Type { + Self::AzureBlobStorage + } + } + diff --git a/rust/src/models/template_in.rs b/rust/src/models/template_in.rs new file mode 100644 index 000000000..7681abf7d --- /dev/null +++ b/rust/src/models/template_in.rs @@ -0,0 +1,53 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct TemplateIn { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "featureFlag", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + #[serde(rename = "instructions", skip_serializing_if = "Option::is_none")] + pub instructions: Option, + #[serde(rename = "instructionsLink", skip_serializing_if = "Option::is_none")] + pub instructions_link: Option, + #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde(rename = "logo")] + pub logo: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "transformation")] + pub transformation: String, + } + + impl TemplateIn { + pub fn new(logo: String, name: String, transformation: String) -> TemplateIn { + TemplateIn { + description: None, + feature_flag: None, + filter_types: None, + instructions: None, + instructions_link: None, + kind: None, + logo, + name, + transformation, + } + } + } + diff --git a/rust/src/models/template_out.rs b/rust/src/models/template_out.rs new file mode 100644 index 000000000..2560e4a6d --- /dev/null +++ b/rust/src/models/template_out.rs @@ -0,0 +1,65 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct TemplateOut { + #[serde(rename = "createdAt")] + pub created_at: String, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "featureFlag", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "instructions")] + pub instructions: String, + #[serde(rename = "instructionsLink", skip_serializing_if = "Option::is_none")] + pub instructions_link: Option, + #[serde(rename = "kind")] + pub kind: models::TransformationTemplateKind, + #[serde(rename = "logo")] + pub logo: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "orgId")] + pub org_id: String, + #[serde(rename = "transformation")] + pub transformation: String, + #[serde(rename = "updatedAt")] + pub updated_at: String, + } + + impl TemplateOut { + pub fn new(created_at: String, description: String, id: String, instructions: String, kind: models::TransformationTemplateKind, logo: String, name: String, org_id: String, transformation: String, updated_at: String) -> TemplateOut { + TemplateOut { + created_at, + description, + feature_flag: None, + filter_types: None, + id, + instructions, + instructions_link: None, + kind, + logo, + name, + org_id, + transformation, + updated_at, + } + } + } + diff --git a/rust/src/models/template_patch.rs b/rust/src/models/template_patch.rs new file mode 100644 index 000000000..6a2874ed0 --- /dev/null +++ b/rust/src/models/template_patch.rs @@ -0,0 +1,53 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct TemplatePatch { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "featureFlag", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option>, + #[serde(rename = "filterTypes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>>, + #[serde(rename = "instructions", skip_serializing_if = "Option::is_none")] + pub instructions: Option, + #[serde(rename = "instructionsLink", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub instructions_link: Option>, + #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde(rename = "logo", skip_serializing_if = "Option::is_none")] + pub logo: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "transformation", skip_serializing_if = "Option::is_none")] + pub transformation: Option, + } + + impl TemplatePatch { + pub fn new() -> TemplatePatch { + TemplatePatch { + description: None, + feature_flag: None, + filter_types: None, + instructions: None, + instructions_link: None, + kind: None, + logo: None, + name: None, + transformation: None, + } + } + } + diff --git a/rust/src/models/template_update.rs b/rust/src/models/template_update.rs new file mode 100644 index 000000000..1bb960326 --- /dev/null +++ b/rust/src/models/template_update.rs @@ -0,0 +1,53 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct TemplateUpdate { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "featureFlag", skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + #[serde(rename = "filterTypes", skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + #[serde(rename = "instructions", skip_serializing_if = "Option::is_none")] + pub instructions: Option, + #[serde(rename = "instructionsLink", skip_serializing_if = "Option::is_none")] + pub instructions_link: Option, + #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde(rename = "logo")] + pub logo: String, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "transformation")] + pub transformation: String, + } + + impl TemplateUpdate { + pub fn new(logo: String, transformation: String) -> TemplateUpdate { + TemplateUpdate { + description: None, + feature_flag: None, + filter_types: None, + instructions: None, + instructions_link: None, + kind: None, + logo, + name: None, + transformation, + } + } + } + diff --git a/rust/src/models/transformation_http_method.rs b/rust/src/models/transformation_http_method.rs new file mode 100644 index 000000000..01f0dfd21 --- /dev/null +++ b/rust/src/models/transformation_http_method.rs @@ -0,0 +1,43 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum TransformationHttpMethod { + #[serde(rename = "POST")] + Post, + #[serde(rename = "PUT")] + Put, + #[serde(rename = "PATCH")] + Patch, + + } + + impl std::fmt::Display for TransformationHttpMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Post => write!(f, "POST"), + Self::Put => write!(f, "PUT"), + Self::Patch => write!(f, "PATCH"), + } + } + } + + impl Default for TransformationHttpMethod { + fn default() -> TransformationHttpMethod { + Self::Post + } + } + diff --git a/rust/src/models/transformation_simulate_in.rs b/rust/src/models/transformation_simulate_in.rs new file mode 100644 index 000000000..a652fa6b5 --- /dev/null +++ b/rust/src/models/transformation_simulate_in.rs @@ -0,0 +1,39 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct TransformationSimulateIn { + #[serde(rename = "channels", skip_serializing_if = "Option::is_none")] + pub channels: Option>, + #[serde(rename = "code")] + pub code: String, + /// The event type's name + #[serde(rename = "eventType")] + pub event_type: String, + #[serde(rename = "payload")] + pub payload: serde_json::Value, + } + + impl TransformationSimulateIn { + pub fn new(code: String, event_type: String, payload: serde_json::Value) -> TransformationSimulateIn { + TransformationSimulateIn { + channels: None, + code, + event_type, + payload, + } + } + } + diff --git a/rust/src/models/transformation_simulate_out.rs b/rust/src/models/transformation_simulate_out.rs new file mode 100644 index 000000000..ac439d557 --- /dev/null +++ b/rust/src/models/transformation_simulate_out.rs @@ -0,0 +1,35 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct TransformationSimulateOut { + #[serde(rename = "method", skip_serializing_if = "Option::is_none")] + pub method: Option, + #[serde(rename = "payload")] + pub payload: String, + #[serde(rename = "url")] + pub url: String, + } + + impl TransformationSimulateOut { + pub fn new(payload: String, url: String) -> TransformationSimulateOut { + TransformationSimulateOut { + method: None, + payload, + url, + } + } + } + diff --git a/rust/src/models/transformation_template_kind.rs b/rust/src/models/transformation_template_kind.rs new file mode 100644 index 000000000..d363bfca6 --- /dev/null +++ b/rust/src/models/transformation_template_kind.rs @@ -0,0 +1,70 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// + #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] + pub enum TransformationTemplateKind { + #[serde(rename = "Custom")] + Custom, + #[serde(rename = "CustomerIO")] + CustomerIo, + #[serde(rename = "Discord")] + Discord, + #[serde(rename = "Hubspot")] + Hubspot, + #[serde(rename = "Inngest")] + Inngest, + #[serde(rename = "Salesforce")] + Salesforce, + #[serde(rename = "Segment")] + Segment, + #[serde(rename = "Slack")] + Slack, + #[serde(rename = "Teams")] + Teams, + #[serde(rename = "TriggerDev")] + TriggerDev, + #[serde(rename = "Windmill")] + Windmill, + #[serde(rename = "Zapier")] + Zapier, + + } + + impl std::fmt::Display for TransformationTemplateKind { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Custom => write!(f, "Custom"), + Self::CustomerIo => write!(f, "CustomerIO"), + Self::Discord => write!(f, "Discord"), + Self::Hubspot => write!(f, "Hubspot"), + Self::Inngest => write!(f, "Inngest"), + Self::Salesforce => write!(f, "Salesforce"), + Self::Segment => write!(f, "Segment"), + Self::Slack => write!(f, "Slack"), + Self::Teams => write!(f, "Teams"), + Self::TriggerDev => write!(f, "TriggerDev"), + Self::Windmill => write!(f, "Windmill"), + Self::Zapier => write!(f, "Zapier"), + } + } + } + + impl Default for TransformationTemplateKind { + fn default() -> TransformationTemplateKind { + Self::Custom + } + } + diff --git a/rust/src/models/validation_error.rs b/rust/src/models/validation_error.rs new file mode 100644 index 000000000..55a6bd261 --- /dev/null +++ b/rust/src/models/validation_error.rs @@ -0,0 +1,40 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.1.1 + * + * Generated by: https://openapi-generator.tech + */ + +#[allow(unused_imports)] +use crate::models; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; + + /// ValidationError : Validation errors have their own schema to provide context for invalid requests eg. mismatched types and out of bounds values. There may be any number of these per 422 UNPROCESSABLE ENTITY error. + #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] + pub struct ValidationError { + /// The location as a [`Vec`] of [`String`]s -- often in the form `[\"body\", \"field_name\"]`, `[\"query\", \"field_name\"]`, etc. They may, however, be arbitrarily deep. + #[serde(rename = "loc")] + pub loc: Vec, + /// The message accompanying the validation error item. + #[serde(rename = "msg")] + pub msg: String, + /// The type of error, often \"type_error\" or \"value_error\", but sometimes with more context like as \"value_error.number.not_ge\" + #[serde(rename = "type")] + pub r#type: String, + } + + impl ValidationError { + /// Validation errors have their own schema to provide context for invalid requests eg. mismatched types and out of bounds values. There may be any number of these per 422 UNPROCESSABLE ENTITY error. + pub fn new(loc: Vec, msg: String, r#type: String) -> ValidationError { + ValidationError { + loc, + msg, + r#type, + } + } + } +