diff --git a/rust/.rustfmt.toml b/rust/.rustfmt.toml index c1d40dc85..801dcd01b 100644 --- a/rust/.rustfmt.toml +++ b/rust/.rustfmt.toml @@ -1,2 +1,6 @@ wrap_comments = true imports_granularity = "Crate" +fn_params_layout = "Vertical" +struct_lit_width = 0 +imports_layout = "Vertical" +fn_call_width = 0 diff --git a/rust/src/api/application.rs b/rust/src/api/application.rs index 38144c8c7..f85e70177 100644 --- a/rust/src/api/application.rs +++ b/rust/src/api/application.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct ApplicationListOptions { @@ -24,7 +28,9 @@ pub struct Application<'a> { impl<'a> Application<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List of all the organization's applications. @@ -38,12 +44,21 @@ impl<'a> Application<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/app") - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app", + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Create a new application. @@ -52,13 +67,21 @@ impl<'a> Application<'a> { application_in: ApplicationIn, options: Option, ) -> Result { - let ApplicationCreateOptions { idempotency_key } = options.unwrap_or_default(); + let ApplicationCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/app") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(application_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/app", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(application_in) + .execute(self.cfg) + .await } /// Create the application with the given ID, or create a new one if it @@ -68,22 +91,41 @@ impl<'a> Application<'a> { application_in: ApplicationIn, options: Option, ) -> Result { - let ApplicationCreateOptions { idempotency_key } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/app") - .with_query_param("get_if_exists", "true".to_owned()) - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(application_in) - .execute(self.cfg) - .await + let ApplicationCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/app", + ) + .with_query_param( + "get_if_exists", + "true".to_owned(), + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(application_in) + .execute(self.cfg) + .await } /// Get an application. - pub async fn get(&self, app_id: String) -> Result { - crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}") - .with_path_param("app_id", app_id) - .execute(self.cfg) - .await + pub async fn get( + &self, + app_id: String, + ) -> Result { + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app/{app_id}", + ) + .with_path_param( + "app_id", app_id, + ) + .execute(self.cfg) + .await } /// Update an application. @@ -92,20 +134,33 @@ impl<'a> Application<'a> { app_id: String, application_in: ApplicationIn, ) -> Result { - crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}") - .with_path_param("app_id", app_id) - .with_body_param(application_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PUT, + "/api/v1/app/{app_id}", + ) + .with_path_param( + "app_id", app_id, + ) + .with_body_param(application_in) + .execute(self.cfg) + .await } /// Delete an application. - pub async fn delete(&self, app_id: String) -> Result<()> { - crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}") - .with_path_param("app_id", app_id) - .returns_nothing() - .execute(self.cfg) - .await + pub async fn delete( + &self, + app_id: String, + ) -> Result<()> { + crate::request::Request::new( + http1::Method::DELETE, + "/api/v1/app/{app_id}", + ) + .with_path_param( + "app_id", app_id, + ) + .returns_nothing() + .execute(self.cfg) + .await } /// Partially update an application. @@ -114,10 +169,15 @@ impl<'a> Application<'a> { app_id: String, application_patch: ApplicationPatch, ) -> Result { - crate::request::Request::new(http1::Method::PATCH, "/api/v1/app/{app_id}") - .with_path_param("app_id", app_id) - .with_body_param(application_patch) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PATCH, + "/api/v1/app/{app_id}", + ) + .with_path_param( + "app_id", app_id, + ) + .with_body_param(application_patch) + .execute(self.cfg) + .await } } diff --git a/rust/src/api/authentication.rs b/rust/src/api/authentication.rs index 5aeb647f8..a0932aa54 100644 --- a/rust/src/api/authentication.rs +++ b/rust/src/api/authentication.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct AuthenticationAppPortalAccessOptions { @@ -32,7 +36,9 @@ pub struct Authentication<'a> { impl<'a> Authentication<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// Use this function to get magic links (and authentication codes) for @@ -43,14 +49,21 @@ impl<'a> Authentication<'a> { app_portal_access_in: AppPortalAccessIn, options: Option, ) -> Result { - let AuthenticationAppPortalAccessOptions { idempotency_key } = options.unwrap_or_default(); + let AuthenticationAppPortalAccessOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/auth/app-portal-access/{app_id}", ) - .with_path_param("app_id", app_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(app_portal_access_in) .execute(self.cfg) .await @@ -63,15 +76,25 @@ impl<'a> Authentication<'a> { application_token_expire_in: ApplicationTokenExpireIn, options: Option, ) -> Result<()> { - let AuthenticationExpireAllOptions { idempotency_key } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/auth/app/{app_id}/expire-all") - .with_path_param("app_id", app_id) - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(application_token_expire_in) - .returns_nothing() - .execute(self.cfg) - .await + let AuthenticationExpireAllOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/auth/app/{app_id}/expire-all", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(application_token_expire_in) + .returns_nothing() + .execute(self.cfg) + .await } #[deprecated = "Please use app_portal_access instead."] @@ -81,15 +104,21 @@ impl<'a> Authentication<'a> { app_id: String, options: Option, ) -> Result { - let super::AuthenticationDashboardAccessOptions { idempotency_key } = - options.unwrap_or_default(); + let super::AuthenticationDashboardAccessOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/auth/dashboard-access/{app_id}", ) - .with_path_param("app_id", app_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .execute(self.cfg) .await } @@ -97,14 +126,25 @@ impl<'a> Authentication<'a> { /// Logout an app token. /// /// Trying to log out other tokens will fail. - pub async fn logout(&self, options: Option) -> Result<()> { - let AuthenticationLogoutOptions { idempotency_key } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/auth/logout") - .with_optional_header_param("idempotency-key", idempotency_key) - .returns_nothing() - .execute(self.cfg) - .await + pub async fn logout( + &self, + options: Option, + ) -> Result<()> { + let AuthenticationLogoutOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/auth/logout", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .returns_nothing() + .execute(self.cfg) + .await } /// Use this function to get magic links (and authentication codes) for @@ -115,15 +155,22 @@ impl<'a> Authentication<'a> { stream_portal_access_in: StreamPortalAccessIn, options: Option, ) -> Result { - let AuthenticationStreamPortalAccessOptions { idempotency_key } = - options.unwrap_or_default(); + let AuthenticationStreamPortalAccessOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/auth/stream-portal-access/{stream_id}", ) - .with_path_param("stream_id", stream_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "stream_id", + stream_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(stream_portal_access_in) .execute(self.cfg) .await @@ -139,8 +186,13 @@ impl<'a> Authentication<'a> { http1::Method::GET, "/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .execute(self.cfg) .await } @@ -153,16 +205,25 @@ impl<'a> Authentication<'a> { rotate_poller_token_in: RotatePollerTokenIn, options: Option, ) -> Result { - let AuthenticationRotateStreamPollerTokenOptions { idempotency_key } = - options.unwrap_or_default(); + let AuthenticationRotateStreamPollerTokenOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(rotate_poller_token_in) .execute(self.cfg) .await diff --git a/rust/src/api/background_task.rs b/rust/src/api/background_task.rs index 488c383aa..0405c2f31 100644 --- a/rust/src/api/background_task.rs +++ b/rust/src/api/background_task.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct BackgroundTaskListOptions { @@ -25,7 +29,9 @@ pub struct BackgroundTask<'a> { impl<'a> BackgroundTask<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List background tasks executed in the past 90 days. @@ -41,21 +47,42 @@ impl<'a> BackgroundTask<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/background-task") - .with_optional_query_param("status", status) - .with_optional_query_param("task", task) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/background-task", + ) + .with_optional_query_param( + "status", status, + ) + .with_optional_query_param( + "task", task, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Get a background task by ID. - pub async fn get(&self, task_id: String) -> Result { - crate::request::Request::new(http1::Method::GET, "/api/v1/background-task/{task_id}") - .with_path_param("task_id", task_id) - .execute(self.cfg) - .await + pub async fn get( + &self, + task_id: String, + ) -> Result { + crate::request::Request::new( + http1::Method::GET, + "/api/v1/background-task/{task_id}", + ) + .with_path_param( + "task_id", task_id, + ) + .execute(self.cfg) + .await } } diff --git a/rust/src/api/client.rs b/rust/src/api/client.rs index a2bc910f4..2e964cfea 100644 --- a/rust/src/api/client.rs +++ b/rust/src/api/client.rs @@ -1,6 +1,12 @@ -use std::{sync::Arc, time::Duration}; +use std::{ + sync::Arc, + time::Duration, +}; -use hyper_util::{client::legacy::Client as HyperClient, rt::TokioExecutor}; +use hyper_util::{ + client::legacy::Client as HyperClient, + rt::TokioExecutor, +}; use crate::Configuration; @@ -64,20 +70,25 @@ pub struct Svix { } impl Svix { - pub fn new(token: String, options: Option) -> Self { + pub fn new( + token: String, + options: Option, + ) -> Self { let options = options.unwrap_or_default(); - let cfg = Arc::new(Configuration { - user_agent: Some(format!("svix-libs/{CRATE_VERSION}/rust")), - client: HyperClient::builder(TokioExecutor::new()) - .build(crate::make_connector(options.proxy_address)), - timeout: options.timeout, - // These fields will be set by `with_token` below - base_path: String::new(), - bearer_access_token: None, - num_retries: options.num_retries.unwrap_or(2), - retry_schedule: options.retry_schedule, - }); + let cfg = Arc::new( + Configuration { + user_agent: Some(format!("svix-libs/{CRATE_VERSION}/rust")), + client: HyperClient::builder(TokioExecutor::new()) + .build(crate::make_connector(options.proxy_address)), + timeout: options.timeout, + // These fields will be set by `with_token` below + base_path: String::new(), + bearer_access_token: None, + num_retries: options.num_retries.unwrap_or(2), + retry_schedule: options.retry_schedule, + }, + ); let svix = Self { cfg, server_url: options.server_url, @@ -91,27 +102,34 @@ impl Svix { /// /// This can be used to change the token without incurring /// the cost of TLS initialization. - pub fn with_token(&self, token: String) -> Self { - let base_path = self.server_url.clone().unwrap_or_else(|| { - match token.split('.').next_back() { - Some("us") => "https://api.us.svix.com", - Some("eu") => "https://api.eu.svix.com", - Some("in") => "https://api.in.svix.com", - Some("ca") => "https://api.ca.svix.com", - Some("au") => "https://api.au.svix.com", - _ => "https://api.svix.com", - } - .to_string() - }); - let cfg = Arc::new(Configuration { - base_path, - user_agent: self.cfg.user_agent.clone(), - bearer_access_token: Some(token), - client: self.cfg.client.clone(), - timeout: self.cfg.timeout, - num_retries: self.cfg.num_retries, - retry_schedule: self.cfg.retry_schedule.clone(), - }); + pub fn with_token( + &self, + token: String, + ) -> Self { + let base_path = self.server_url.clone().unwrap_or_else( + || { + match token.split('.').next_back() { + Some("us") => "https://api.us.svix.com", + Some("eu") => "https://api.eu.svix.com", + Some("in") => "https://api.in.svix.com", + Some("ca") => "https://api.ca.svix.com", + Some("au") => "https://api.au.svix.com", + _ => "https://api.svix.com", + } + .to_string() + }, + ); + let cfg = Arc::new( + Configuration { + base_path, + user_agent: self.cfg.user_agent.clone(), + bearer_access_token: Some(token), + client: self.cfg.client.clone(), + timeout: self.cfg.timeout, + num_retries: self.cfg.num_retries, + retry_schedule: self.cfg.retry_schedule.clone(), + }, + ); Self { cfg, @@ -133,9 +151,15 @@ mod tests { fn test_future_send_sync() { fn require_send_sync(_: T) {} - let svix = Svix::new(String::new(), None); + let svix = Svix::new( + String::new(), + None, + ); let message_api = svix.message(); - let fut = message_api.expunge_content(String::new(), String::new()); + let fut = message_api.expunge_content( + String::new(), + String::new(), + ); require_send_sync(fut); } } diff --git a/rust/src/api/connector.rs b/rust/src/api/connector.rs index a577dabd6..401c00dda 100644 --- a/rust/src/api/connector.rs +++ b/rust/src/api/connector.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct ConnectorListOptions { @@ -24,7 +28,9 @@ pub struct Connector<'a> { impl<'a> Connector<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List all connectors for an application. @@ -38,12 +44,21 @@ impl<'a> Connector<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/connector") - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/connector", + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Create a new connector. @@ -52,21 +67,38 @@ impl<'a> Connector<'a> { connector_in: ConnectorIn, options: Option, ) -> Result { - let ConnectorCreateOptions { idempotency_key } = options.unwrap_or_default(); + let ConnectorCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/connector") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(connector_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/connector", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(connector_in) + .execute(self.cfg) + .await } /// Get a connector. - pub async fn get(&self, connector_id: String) -> Result { - crate::request::Request::new(http1::Method::GET, "/api/v1/connector/{connector_id}") - .with_path_param("connector_id", connector_id) - .execute(self.cfg) - .await + pub async fn get( + &self, + connector_id: String, + ) -> Result { + crate::request::Request::new( + http1::Method::GET, + "/api/v1/connector/{connector_id}", + ) + .with_path_param( + "connector_id", + connector_id, + ) + .execute(self.cfg) + .await } /// Update a connector. @@ -75,20 +107,35 @@ impl<'a> Connector<'a> { connector_id: String, connector_update: ConnectorUpdate, ) -> Result { - crate::request::Request::new(http1::Method::PUT, "/api/v1/connector/{connector_id}") - .with_path_param("connector_id", connector_id) - .with_body_param(connector_update) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PUT, + "/api/v1/connector/{connector_id}", + ) + .with_path_param( + "connector_id", + connector_id, + ) + .with_body_param(connector_update) + .execute(self.cfg) + .await } /// Delete a connector. - pub async fn delete(&self, connector_id: String) -> Result<()> { - crate::request::Request::new(http1::Method::DELETE, "/api/v1/connector/{connector_id}") - .with_path_param("connector_id", connector_id) - .returns_nothing() - .execute(self.cfg) - .await + pub async fn delete( + &self, + connector_id: String, + ) -> Result<()> { + crate::request::Request::new( + http1::Method::DELETE, + "/api/v1/connector/{connector_id}", + ) + .with_path_param( + "connector_id", + connector_id, + ) + .returns_nothing() + .execute(self.cfg) + .await } /// Partially update a connector. @@ -97,10 +144,16 @@ impl<'a> Connector<'a> { connector_id: String, connector_patch: ConnectorPatch, ) -> Result { - crate::request::Request::new(http1::Method::PATCH, "/api/v1/connector/{connector_id}") - .with_path_param("connector_id", connector_id) - .with_body_param(connector_patch) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PATCH, + "/api/v1/connector/{connector_id}", + ) + .with_path_param( + "connector_id", + connector_id, + ) + .with_body_param(connector_patch) + .execute(self.cfg) + .await } } diff --git a/rust/src/api/endpoint.rs b/rust/src/api/endpoint.rs index 5edcb786d..bc01cccdd 100644 --- a/rust/src/api/endpoint.rs +++ b/rust/src/api/endpoint.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct EndpointListOptions { @@ -57,7 +61,9 @@ pub struct Endpoint<'a> { impl<'a> Endpoint<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List the application's endpoints. @@ -72,13 +78,24 @@ impl<'a> Endpoint<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/endpoint") - .with_path_param("app_id", app_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app/{app_id}/endpoint", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Create a new endpoint for the application. @@ -91,24 +108,43 @@ impl<'a> Endpoint<'a> { endpoint_in: EndpointIn, options: Option, ) -> Result { - let EndpointCreateOptions { idempotency_key } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint") - .with_path_param("app_id", app_id) - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(endpoint_in) - .execute(self.cfg) - .await + let EndpointCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/app/{app_id}/endpoint", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(endpoint_in) + .execute(self.cfg) + .await } /// Get an endpoint. - pub async fn get(&self, app_id: String, endpoint_id: String) -> Result { + pub async fn get( + &self, + app_id: String, + endpoint_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -124,21 +160,35 @@ impl<'a> Endpoint<'a> { http1::Method::PUT, "/api/v1/app/{app_id}/endpoint/{endpoint_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(endpoint_update) .execute(self.cfg) .await } /// Delete an endpoint. - pub async fn delete(&self, app_id: String, endpoint_id: String) -> Result<()> { + pub async fn delete( + &self, + app_id: String, + endpoint_id: String, + ) -> Result<()> { crate::request::Request::new( http1::Method::DELETE, "/api/v1/app/{app_id}/endpoint/{endpoint_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .returns_nothing() .execute(self.cfg) .await @@ -155,8 +205,13 @@ impl<'a> Endpoint<'a> { http1::Method::PATCH, "/api/v1/app/{app_id}/endpoint/{endpoint_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(endpoint_patch) .execute(self.cfg) .await @@ -172,8 +227,13 @@ impl<'a> Endpoint<'a> { http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -189,8 +249,13 @@ impl<'a> Endpoint<'a> { http1::Method::PUT, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(endpoint_headers_in) .returns_nothing() .execute(self.cfg) @@ -208,8 +273,13 @@ impl<'a> Endpoint<'a> { http1::Method::PATCH, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(endpoint_headers_patch_in) .returns_nothing() .execute(self.cfg) @@ -239,15 +309,25 @@ impl<'a> Endpoint<'a> { recover_in: RecoverIn, options: Option, ) -> Result { - let EndpointRecoverOptions { idempotency_key } = options.unwrap_or_default(); + let EndpointRecoverOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(recover_in) .execute(self.cfg) .await @@ -276,15 +356,25 @@ impl<'a> Endpoint<'a> { replay_in: ReplayIn, options: Option, ) -> Result { - let EndpointReplayMissingOptions { idempotency_key } = options.unwrap_or_default(); + let EndpointReplayMissingOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(replay_in) .execute(self.cfg) .await @@ -303,8 +393,13 @@ impl<'a> Endpoint<'a> { http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -319,15 +414,25 @@ impl<'a> Endpoint<'a> { endpoint_secret_rotate_in: EndpointSecretRotateIn, options: Option, ) -> Result<()> { - let EndpointRotateSecretOptions { idempotency_key } = options.unwrap_or_default(); + let EndpointRotateSecretOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(endpoint_secret_rotate_in) .returns_nothing() .execute(self.cfg) @@ -342,15 +447,25 @@ impl<'a> Endpoint<'a> { event_example_in: EventExampleIn, options: Option, ) -> Result { - let EndpointSendExampleOptions { idempotency_key } = options.unwrap_or_default(); + let EndpointSendExampleOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(event_example_in) .execute(self.cfg) .await @@ -363,16 +478,28 @@ impl<'a> Endpoint<'a> { endpoint_id: String, options: Option, ) -> Result { - let EndpointGetStatsOptions { since, until } = options.unwrap_or_default(); + let EndpointGetStatsOptions { + since, + until, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_query_param("since", since) - .with_optional_query_param("until", until) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_query_param( + "since", since, + ) + .with_optional_query_param( + "until", until, + ) .execute(self.cfg) .await } @@ -387,8 +514,13 @@ impl<'a> Endpoint<'a> { http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -404,8 +536,13 @@ impl<'a> Endpoint<'a> { http1::Method::PATCH, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(endpoint_transformation_patch) .returns_nothing() .execute(self.cfg) @@ -424,8 +561,13 @@ impl<'a> Endpoint<'a> { http1::Method::PATCH, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(endpoint_transformation_in) .returns_nothing() .execute(self.cfg) diff --git a/rust/src/api/environment.rs b/rust/src/api/environment.rs index c6a9648c5..37cd269b4 100644 --- a/rust/src/api/environment.rs +++ b/rust/src/api/environment.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct EnvironmentExportOptions { @@ -17,7 +21,9 @@ pub struct Environment<'a> { impl<'a> Environment<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// Download a JSON file containing all org-settings and event types. @@ -29,12 +35,20 @@ impl<'a> Environment<'a> { &self, options: Option, ) -> Result { - let EnvironmentExportOptions { idempotency_key } = options.unwrap_or_default(); + let EnvironmentExportOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/environment/export") - .with_optional_header_param("idempotency-key", idempotency_key) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/environment/export", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .execute(self.cfg) + .await } /// Import a configuration into the active organization. @@ -49,13 +63,21 @@ impl<'a> Environment<'a> { environment_in: EnvironmentIn, options: Option, ) -> Result<()> { - let EnvironmentImportOptions { idempotency_key } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/environment/import") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(environment_in) - .returns_nothing() - .execute(self.cfg) - .await + let EnvironmentImportOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/environment/import", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(environment_in) + .returns_nothing() + .execute(self.cfg) + .await } } diff --git a/rust/src/api/event_type.rs b/rust/src/api/event_type.rs index 22ef0788e..ada7976f3 100644 --- a/rust/src/api/event_type.rs +++ b/rust/src/api/event_type.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct EventTypeListOptions { @@ -44,7 +48,9 @@ pub struct EventType<'a> { impl<'a> EventType<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// Return the list of event types. @@ -60,14 +66,29 @@ impl<'a> EventType<'a> { with_content, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/event-type") - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .with_optional_query_param("include_archived", include_archived) - .with_optional_query_param("with_content", with_content) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/event-type", + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .with_optional_query_param( + "include_archived", + include_archived, + ) + .with_optional_query_param( + "with_content", + with_content, + ) + .execute(self.cfg) + .await } /// Create new or unarchive existing event type. @@ -81,13 +102,21 @@ impl<'a> EventType<'a> { event_type_in: EventTypeIn, options: Option, ) -> Result { - let EventTypeCreateOptions { idempotency_key } = options.unwrap_or_default(); + let EventTypeCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/event-type") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(event_type_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/event-type", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(event_type_in) + .execute(self.cfg) + .await } /// Given an OpenAPI spec, create new or update existing event types. @@ -100,21 +129,38 @@ impl<'a> EventType<'a> { event_type_import_open_api_in: EventTypeImportOpenApiIn, options: Option, ) -> Result { - let EventTypeImportOpenapiOptions { idempotency_key } = options.unwrap_or_default(); + let EventTypeImportOpenapiOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/event-type/import/openapi") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(event_type_import_open_api_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/event-type/import/openapi", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(event_type_import_open_api_in) + .execute(self.cfg) + .await } /// Get an event type. - pub async fn get(&self, event_type_name: String) -> Result { - crate::request::Request::new(http1::Method::GET, "/api/v1/event-type/{event_type_name}") - .with_path_param("event_type_name", event_type_name) - .execute(self.cfg) - .await + pub async fn get( + &self, + event_type_name: String, + ) -> Result { + crate::request::Request::new( + http1::Method::GET, + "/api/v1/event-type/{event_type_name}", + ) + .with_path_param( + "event_type_name", + event_type_name, + ) + .execute(self.cfg) + .await } /// Update an event type. @@ -123,11 +169,17 @@ impl<'a> EventType<'a> { event_type_name: String, event_type_update: EventTypeUpdate, ) -> Result { - crate::request::Request::new(http1::Method::PUT, "/api/v1/event-type/{event_type_name}") - .with_path_param("event_type_name", event_type_name) - .with_body_param(event_type_update) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PUT, + "/api/v1/event-type/{event_type_name}", + ) + .with_path_param( + "event_type_name", + event_type_name, + ) + .with_body_param(event_type_update) + .execute(self.cfg) + .await } /// Archive an event type. @@ -142,14 +194,21 @@ impl<'a> EventType<'a> { event_type_name: String, options: Option, ) -> Result<()> { - let EventTypeDeleteOptions { expunge } = options.unwrap_or_default(); + let EventTypeDeleteOptions { + expunge, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::DELETE, "/api/v1/event-type/{event_type_name}", ) - .with_path_param("event_type_name", event_type_name) - .with_optional_query_param("expunge", expunge) + .with_path_param( + "event_type_name", + event_type_name, + ) + .with_optional_query_param( + "expunge", expunge, + ) .returns_nothing() .execute(self.cfg) .await @@ -161,10 +220,16 @@ impl<'a> EventType<'a> { event_type_name: String, event_type_patch: EventTypePatch, ) -> Result { - crate::request::Request::new(http1::Method::PATCH, "/api/v1/event-type/{event_type_name}") - .with_path_param("event_type_name", event_type_name) - .with_body_param(event_type_patch) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PATCH, + "/api/v1/event-type/{event_type_name}", + ) + .with_path_param( + "event_type_name", + event_type_name, + ) + .with_body_param(event_type_patch) + .execute(self.cfg) + .await } } diff --git a/rust/src/api/ingest.rs b/rust/src/api/ingest.rs index e5ba1e4ff..a868433c4 100644 --- a/rust/src/api/ingest.rs +++ b/rust/src/api/ingest.rs @@ -1,6 +1,13 @@ // this file is @generated -use super::{IngestEndpoint, IngestSource}; -use crate::{error::Result, models::*, Configuration}; +use super::{ + IngestEndpoint, + IngestSource, +}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct IngestDashboardOptions { @@ -13,7 +20,9 @@ pub struct Ingest<'a> { impl<'a> Ingest<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } pub fn endpoint(&self) -> IngestEndpoint<'a> { @@ -31,14 +40,22 @@ impl<'a> Ingest<'a> { ingest_source_consumer_portal_access_in: IngestSourceConsumerPortalAccessIn, options: Option, ) -> Result { - let IngestDashboardOptions { idempotency_key } = options.unwrap_or_default(); + let IngestDashboardOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/ingest/api/v1/source/{source_id}/dashboard", ) - .with_path_param("source_id", source_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "source_id", + source_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(ingest_source_consumer_portal_access_in) .execute(self.cfg) .await diff --git a/rust/src/api/ingest_endpoint.rs b/rust/src/api/ingest_endpoint.rs index fef11b3af..95510e64a 100644 --- a/rust/src/api/ingest_endpoint.rs +++ b/rust/src/api/ingest_endpoint.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct IngestEndpointListOptions { @@ -29,7 +33,9 @@ pub struct IngestEndpoint<'a> { impl<'a> IngestEndpoint<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List ingest endpoints. @@ -48,10 +54,19 @@ impl<'a> IngestEndpoint<'a> { http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint", ) - .with_path_param("source_id", source_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) + .with_path_param( + "source_id", + source_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) .execute(self.cfg) .await } @@ -63,27 +78,45 @@ impl<'a> IngestEndpoint<'a> { ingest_endpoint_in: IngestEndpointIn, options: Option, ) -> Result { - let IngestEndpointCreateOptions { idempotency_key } = options.unwrap_or_default(); + let IngestEndpointCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/ingest/api/v1/source/{source_id}/endpoint", ) - .with_path_param("source_id", source_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "source_id", + source_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(ingest_endpoint_in) .execute(self.cfg) .await } /// Get an ingest endpoint. - pub async fn get(&self, source_id: String, endpoint_id: String) -> Result { + pub async fn get( + &self, + source_id: String, + endpoint_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -99,21 +132,37 @@ impl<'a> IngestEndpoint<'a> { http1::Method::PUT, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(ingest_endpoint_update) .execute(self.cfg) .await } /// Delete an ingest endpoint. - pub async fn delete(&self, source_id: String, endpoint_id: String) -> Result<()> { + pub async fn delete( + &self, + source_id: String, + endpoint_id: String, + ) -> Result<()> { crate::request::Request::new( http1::Method::DELETE, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .returns_nothing() .execute(self.cfg) .await @@ -129,8 +178,14 @@ impl<'a> IngestEndpoint<'a> { http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -146,8 +201,14 @@ impl<'a> IngestEndpoint<'a> { http1::Method::PUT, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(ingest_endpoint_headers_in) .returns_nothing() .execute(self.cfg) @@ -167,8 +228,14 @@ impl<'a> IngestEndpoint<'a> { http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -183,15 +250,26 @@ impl<'a> IngestEndpoint<'a> { ingest_endpoint_secret_in: IngestEndpointSecretIn, options: Option, ) -> Result<()> { - let IngestEndpointRotateSecretOptions { idempotency_key } = options.unwrap_or_default(); + let IngestEndpointRotateSecretOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(ingest_endpoint_secret_in) .returns_nothing() .execute(self.cfg) @@ -208,8 +286,14 @@ impl<'a> IngestEndpoint<'a> { http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -226,8 +310,14 @@ impl<'a> IngestEndpoint<'a> { http1::Method::PATCH, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation", ) - .with_path_param("source_id", source_id) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "source_id", + source_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(ingest_endpoint_transformation_patch) .returns_nothing() .execute(self.cfg) diff --git a/rust/src/api/ingest_source.rs b/rust/src/api/ingest_source.rs index 6d7e90e02..28d177b30 100644 --- a/rust/src/api/ingest_source.rs +++ b/rust/src/api/ingest_source.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct IngestSourceListOptions { @@ -29,7 +33,9 @@ pub struct IngestSource<'a> { impl<'a> IngestSource<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List of all the organization's Ingest Sources. @@ -43,12 +49,21 @@ impl<'a> IngestSource<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/ingest/api/v1/source") - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/ingest/api/v1/source", + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Create Ingest Source. @@ -57,21 +72,38 @@ impl<'a> IngestSource<'a> { ingest_source_in: IngestSourceIn, options: Option, ) -> Result { - let IngestSourceCreateOptions { idempotency_key } = options.unwrap_or_default(); + let IngestSourceCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/ingest/api/v1/source") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(ingest_source_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/ingest/api/v1/source", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(ingest_source_in) + .execute(self.cfg) + .await } /// Get an Ingest Source by id or uid. - pub async fn get(&self, source_id: String) -> Result { - crate::request::Request::new(http1::Method::GET, "/ingest/api/v1/source/{source_id}") - .with_path_param("source_id", source_id) - .execute(self.cfg) - .await + pub async fn get( + &self, + source_id: String, + ) -> Result { + crate::request::Request::new( + http1::Method::GET, + "/ingest/api/v1/source/{source_id}", + ) + .with_path_param( + "source_id", + source_id, + ) + .execute(self.cfg) + .await } /// Update an Ingest Source. @@ -80,20 +112,35 @@ impl<'a> IngestSource<'a> { source_id: String, ingest_source_in: IngestSourceIn, ) -> Result { - crate::request::Request::new(http1::Method::PUT, "/ingest/api/v1/source/{source_id}") - .with_path_param("source_id", source_id) - .with_body_param(ingest_source_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PUT, + "/ingest/api/v1/source/{source_id}", + ) + .with_path_param( + "source_id", + source_id, + ) + .with_body_param(ingest_source_in) + .execute(self.cfg) + .await } /// Delete an Ingest Source. - pub async fn delete(&self, source_id: String) -> Result<()> { - crate::request::Request::new(http1::Method::DELETE, "/ingest/api/v1/source/{source_id}") - .with_path_param("source_id", source_id) - .returns_nothing() - .execute(self.cfg) - .await + pub async fn delete( + &self, + source_id: String, + ) -> Result<()> { + crate::request::Request::new( + http1::Method::DELETE, + "/ingest/api/v1/source/{source_id}", + ) + .with_path_param( + "source_id", + source_id, + ) + .returns_nothing() + .execute(self.cfg) + .await } /// Rotate the Ingest Source's Url Token. @@ -107,14 +154,22 @@ impl<'a> IngestSource<'a> { source_id: String, options: Option, ) -> Result { - let IngestSourceRotateTokenOptions { idempotency_key } = options.unwrap_or_default(); + let IngestSourceRotateTokenOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/ingest/api/v1/source/{source_id}/token/rotate", ) - .with_path_param("source_id", source_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "source_id", + source_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .execute(self.cfg) .await } diff --git a/rust/src/api/integration.rs b/rust/src/api/integration.rs index 370dbaab7..541e5ca72 100644 --- a/rust/src/api/integration.rs +++ b/rust/src/api/integration.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct IntegrationListOptions { @@ -29,7 +33,9 @@ pub struct Integration<'a> { impl<'a> Integration<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List the application's integrations. @@ -44,13 +50,24 @@ impl<'a> Integration<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/integration") - .with_path_param("app_id", app_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app/{app_id}/integration", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Create an integration. @@ -60,24 +77,42 @@ impl<'a> Integration<'a> { integration_in: IntegrationIn, options: Option, ) -> Result { - let IntegrationCreateOptions { idempotency_key } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/integration") - .with_path_param("app_id", app_id) - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(integration_in) - .execute(self.cfg) - .await + let IntegrationCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/app/{app_id}/integration", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(integration_in) + .execute(self.cfg) + .await } /// Get an integration. - pub async fn get(&self, app_id: String, integ_id: String) -> Result { + pub async fn get( + &self, + app_id: String, + integ_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/api/v1/app/{app_id}/integration/{integ_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("integ_id", integ_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "integ_id", integ_id, + ) .execute(self.cfg) .await } @@ -93,21 +128,33 @@ impl<'a> Integration<'a> { http1::Method::PUT, "/api/v1/app/{app_id}/integration/{integ_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("integ_id", integ_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "integ_id", integ_id, + ) .with_body_param(integration_update) .execute(self.cfg) .await } /// Delete an integration. - pub async fn delete(&self, app_id: String, integ_id: String) -> Result<()> { + pub async fn delete( + &self, + app_id: String, + integ_id: String, + ) -> Result<()> { crate::request::Request::new( http1::Method::DELETE, "/api/v1/app/{app_id}/integration/{integ_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("integ_id", integ_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "integ_id", integ_id, + ) .returns_nothing() .execute(self.cfg) .await @@ -115,13 +162,21 @@ impl<'a> Integration<'a> { /// Get an integration's key. #[deprecated] - pub async fn get_key(&self, app_id: String, integ_id: String) -> Result { + pub async fn get_key( + &self, + app_id: String, + integ_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/api/v1/app/{app_id}/integration/{integ_id}/key", ) - .with_path_param("app_id", app_id) - .with_path_param("integ_id", integ_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "integ_id", integ_id, + ) .execute(self.cfg) .await } @@ -134,15 +189,24 @@ impl<'a> Integration<'a> { integ_id: String, options: Option, ) -> Result { - let IntegrationRotateKeyOptions { idempotency_key } = options.unwrap_or_default(); + let IntegrationRotateKeyOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/integration/{integ_id}/key/rotate", ) - .with_path_param("app_id", app_id) - .with_path_param("integ_id", integ_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "integ_id", integ_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .execute(self.cfg) .await } diff --git a/rust/src/api/message.rs b/rust/src/api/message.rs index d9599e096..d26784312 100644 --- a/rust/src/api/message.rs +++ b/rust/src/api/message.rs @@ -1,6 +1,10 @@ // this file is @generated use super::MessagePoller; -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct MessageListOptions { @@ -58,7 +62,9 @@ pub struct Message<'a> { impl<'a> Message<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } pub fn poller(&self) -> MessagePoller<'a> { @@ -92,18 +98,41 @@ impl<'a> Message<'a> { event_types, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg") - .with_path_param("app_id", app_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("channel", channel) - .with_optional_query_param("before", before) - .with_optional_query_param("after", after) - .with_optional_query_param("with_content", with_content) - .with_optional_query_param("tag", tag) - .with_optional_query_param("event_types", event_types) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app/{app_id}/msg", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "channel", channel, + ) + .with_optional_query_param( + "before", before, + ) + .with_optional_query_param( + "after", after, + ) + .with_optional_query_param( + "with_content", + with_content, + ) + .with_optional_query_param( + "tag", tag, + ) + .with_optional_query_param( + "event_types", + event_types, + ) + .execute(self.cfg) + .await } /// Creates a new message and dispatches it to all of the application's @@ -136,13 +165,24 @@ impl<'a> Message<'a> { idempotency_key, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/msg") - .with_path_param("app_id", app_id) - .with_optional_query_param("with_content", with_content) - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(message_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/app/{app_id}/msg", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_query_param( + "with_content", + with_content, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(message_in) + .execute(self.cfg) + .await } /// Delete all message payloads for the application. @@ -165,14 +205,21 @@ impl<'a> Message<'a> { app_id: String, options: Option, ) -> Result { - let MessageExpungeAllContentsOptions { idempotency_key } = options.unwrap_or_default(); + let MessageExpungeAllContentsOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/msg/expunge-all-contents", ) - .with_path_param("app_id", app_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .execute(self.cfg) .await } @@ -184,14 +231,26 @@ impl<'a> Message<'a> { msg_id: String, options: Option, ) -> Result { - let MessageGetOptions { with_content } = options.unwrap_or_default(); + let MessageGetOptions { + with_content, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}") - .with_path_param("app_id", app_id) - .with_path_param("msg_id", msg_id) - .with_optional_query_param("with_content", with_content) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app/{app_id}/msg/{msg_id}", + ) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "msg_id", msg_id, + ) + .with_optional_query_param( + "with_content", + with_content, + ) + .execute(self.cfg) + .await } /// Delete the given message's payload. @@ -199,13 +258,21 @@ impl<'a> Message<'a> { /// 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 expunge_content(&self, app_id: String, msg_id: String) -> Result<()> { + pub async fn expunge_content( + &self, + app_id: String, + msg_id: String, + ) -> Result<()> { crate::request::Request::new( http1::Method::DELETE, "/api/v1/app/{app_id}/msg/{msg_id}/content", ) - .with_path_param("app_id", app_id) - .with_path_param("msg_id", msg_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "msg_id", msg_id, + ) .returns_nothing() .execute(self.cfg) .await @@ -225,15 +292,31 @@ impl<'a> Message<'a> { after, } = params; - crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/events") - .with_path_param("app_id", app_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("event_types", event_types) - .with_optional_query_param("channels", channels) - .with_optional_query_param("after", after) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app/{app_id}/events", + ) + .with_path_param( + "app_id", app_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "event_types", + event_types, + ) + .with_optional_query_param( + "channels", channels, + ) + .with_optional_query_param( + "after", after, + ) + .execute(self.cfg) + .await } #[cfg(feature = "svix_beta")] @@ -255,13 +338,30 @@ impl<'a> Message<'a> { http1::Method::GET, "/api/v1/app/{app_id}/events/subscription/{subscription_id}", ) - .with_path_param("app_id", app_id.to_string()) - .with_path_param("subscription_id", subscription_id.to_string()) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("event_types", event_types) - .with_optional_query_param("channels", channels) - .with_optional_query_param("after", after) + .with_path_param( + "app_id", + app_id.to_string(), + ) + .with_path_param( + "subscription_id", + subscription_id.to_string(), + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "event_types", + event_types, + ) + .with_optional_query_param( + "channels", channels, + ) + .with_optional_query_param( + "after", after, + ) .execute(self.cfg) .await } diff --git a/rust/src/api/message_attempt.rs b/rust/src/api/message_attempt.rs index 88c3aeb7d..59e4872b1 100644 --- a/rust/src/api/message_attempt.rs +++ b/rust/src/api/message_attempt.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct MessageAttemptListByEndpointOptions { @@ -138,7 +142,9 @@ pub struct MessageAttempt<'a> { impl<'a> MessageAttempt<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List attempts by endpoint id @@ -172,19 +178,49 @@ impl<'a> MessageAttempt<'a> { http1::Method::GET, "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("status", status) - .with_optional_query_param("status_code_class", status_code_class) - .with_optional_query_param("channel", channel) - .with_optional_query_param("tag", tag) - .with_optional_query_param("before", before) - .with_optional_query_param("after", after) - .with_optional_query_param("with_content", with_content) - .with_optional_query_param("with_msg", with_msg) - .with_optional_query_param("event_types", event_types) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "status", status, + ) + .with_optional_query_param( + "status_code_class", + status_code_class, + ) + .with_optional_query_param( + "channel", channel, + ) + .with_optional_query_param( + "tag", tag, + ) + .with_optional_query_param( + "before", before, + ) + .with_optional_query_param( + "after", after, + ) + .with_optional_query_param( + "with_content", + with_content, + ) + .with_optional_query_param( + "with_msg", with_msg, + ) + .with_optional_query_param( + "event_types", + event_types, + ) .execute(self.cfg) .await } @@ -220,19 +256,49 @@ impl<'a> MessageAttempt<'a> { http1::Method::GET, "/api/v1/app/{app_id}/attempt/msg/{msg_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("msg_id", msg_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("status", status) - .with_optional_query_param("status_code_class", status_code_class) - .with_optional_query_param("channel", channel) - .with_optional_query_param("tag", tag) - .with_optional_query_param("endpoint_id", endpoint_id) - .with_optional_query_param("before", before) - .with_optional_query_param("after", after) - .with_optional_query_param("with_content", with_content) - .with_optional_query_param("event_types", event_types) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "msg_id", msg_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "status", status, + ) + .with_optional_query_param( + "status_code_class", + status_code_class, + ) + .with_optional_query_param( + "channel", channel, + ) + .with_optional_query_param( + "tag", tag, + ) + .with_optional_query_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_query_param( + "before", before, + ) + .with_optional_query_param( + "after", after, + ) + .with_optional_query_param( + "with_content", + with_content, + ) + .with_optional_query_param( + "event_types", + event_types, + ) .execute(self.cfg) .await } @@ -270,17 +336,42 @@ impl<'a> MessageAttempt<'a> { http1::Method::GET, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg", ) - .with_path_param("app_id", app_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("channel", channel) - .with_optional_query_param("tag", tag) - .with_optional_query_param("status", status) - .with_optional_query_param("before", before) - .with_optional_query_param("after", after) - .with_optional_query_param("with_content", with_content) - .with_optional_query_param("event_types", event_types) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "channel", channel, + ) + .with_optional_query_param( + "tag", tag, + ) + .with_optional_query_param( + "status", status, + ) + .with_optional_query_param( + "before", before, + ) + .with_optional_query_param( + "after", after, + ) + .with_optional_query_param( + "with_content", + with_content, + ) + .with_optional_query_param( + "event_types", + event_types, + ) .execute(self.cfg) .await } @@ -311,17 +402,43 @@ impl<'a> MessageAttempt<'a> { http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt", ) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("channel", channel) - .with_optional_query_param("tag", tag) - .with_optional_query_param("status", status) - .with_optional_query_param("before", before) - .with_optional_query_param("after", after) - .with_optional_query_param("event_types", event_types) - .with_path_param("app_id", app_id.to_string()) - .with_path_param("msg_id", msg_id.to_string()) - .with_path_param("endpoint_id", endpoint_id.to_string()) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "channel", channel, + ) + .with_optional_query_param( + "tag", tag, + ) + .with_optional_query_param( + "status", status, + ) + .with_optional_query_param( + "before", before, + ) + .with_optional_query_param( + "after", after, + ) + .with_optional_query_param( + "event_types", + event_types, + ) + .with_path_param( + "app_id", + app_id.to_string(), + ) + .with_path_param( + "msg_id", + msg_id.to_string(), + ) + .with_path_param( + "endpoint_id", + endpoint_id.to_string(), + ) .execute(self.cfg) .await } @@ -337,9 +454,16 @@ impl<'a> MessageAttempt<'a> { http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("msg_id", msg_id) - .with_path_param("attempt_id", attempt_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "msg_id", msg_id, + ) + .with_path_param( + "attempt_id", + attempt_id, + ) .execute(self.cfg) .await } @@ -359,9 +483,16 @@ impl<'a> MessageAttempt<'a> { http1::Method::DELETE, "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content", ) - .with_path_param("app_id", app_id) - .with_path_param("msg_id", msg_id) - .with_path_param("attempt_id", attempt_id) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "msg_id", msg_id, + ) + .with_path_param( + "attempt_id", + attempt_id, + ) .returns_nothing() .execute(self.cfg) .await @@ -377,17 +508,27 @@ impl<'a> MessageAttempt<'a> { msg_id: String, options: Option, ) -> Result { - let MessageAttemptListAttemptedDestinationsOptions { limit, iterator } = - options.unwrap_or_default(); + let MessageAttemptListAttemptedDestinationsOptions { + limit, + iterator, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::GET, "/api/v1/app/{app_id}/msg/{msg_id}/endpoint", ) - .with_path_param("app_id", app_id) - .with_path_param("msg_id", msg_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "msg_id", msg_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) .execute(self.cfg) .await } @@ -400,16 +541,28 @@ impl<'a> MessageAttempt<'a> { endpoint_id: String, options: Option, ) -> Result<()> { - let MessageAttemptResendOptions { idempotency_key } = options.unwrap_or_default(); + let MessageAttemptResendOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend", ) - .with_path_param("app_id", app_id) - .with_path_param("msg_id", msg_id) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "msg_id", msg_id, + ) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .returns_nothing() .execute(self.cfg) .await diff --git a/rust/src/api/message_poller.rs b/rust/src/api/message_poller.rs index 4c8056cfd..0f304776e 100644 --- a/rust/src/api/message_poller.rs +++ b/rust/src/api/message_poller.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct MessagePollerPollOptions { @@ -38,7 +42,9 @@ pub struct MessagePoller<'a> { impl<'a> MessagePoller<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// Reads the stream of created messages for an application, filtered on the @@ -57,16 +63,34 @@ impl<'a> MessagePoller<'a> { after, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}/poller/{sink_id}") - .with_path_param("app_id", app_id) - .with_path_param("sink_id", sink_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("event_type", event_type) - .with_optional_query_param("channel", channel) - .with_optional_query_param("after", after) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/app/{app_id}/poller/{sink_id}", + ) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "sink_id", sink_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "event_type", + event_type, + ) + .with_optional_query_param( + "channel", channel, + ) + .with_optional_query_param( + "after", after, + ) + .execute(self.cfg) + .await } /// Reads the stream of created messages for an application, filtered on the @@ -79,17 +103,31 @@ impl<'a> MessagePoller<'a> { consumer_id: String, options: Option, ) -> Result { - let MessagePollerConsumerPollOptions { limit, iterator } = options.unwrap_or_default(); + let MessagePollerConsumerPollOptions { + limit, + iterator, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::GET, "/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}", ) - .with_path_param("app_id", app_id) - .with_path_param("sink_id", sink_id) - .with_path_param("consumer_id", consumer_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "sink_id", sink_id, + ) + .with_path_param( + "consumer_id", + consumer_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) .execute(self.cfg) .await } @@ -103,16 +141,28 @@ impl<'a> MessagePoller<'a> { polling_endpoint_consumer_seek_in: PollingEndpointConsumerSeekIn, options: Option, ) -> Result { - let MessagePollerConsumerSeekOptions { idempotency_key } = options.unwrap_or_default(); + let MessagePollerConsumerSeekOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek", ) - .with_path_param("app_id", app_id) - .with_path_param("sink_id", sink_id) - .with_path_param("consumer_id", consumer_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "app_id", app_id, + ) + .with_path_param( + "sink_id", sink_id, + ) + .with_path_param( + "consumer_id", + consumer_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(polling_endpoint_consumer_seek_in) .execute(self.cfg) .await diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index 4ab61d51b..9a7f09c59 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -4,7 +4,10 @@ mod client; mod deprecated; -pub use self::client::{Svix, SvixOptions}; +pub use self::client::{ + Svix, + SvixOptions, +}; pub use crate::models::*; mod application; @@ -31,69 +34,133 @@ mod streaming_sink; mod streaming_stream; #[cfg(feature = "svix_beta")] -pub use self::message::{V1MessageEventsParams, V1MessageEventsSubscriptionParams}; +pub use self::message::{ + V1MessageEventsParams, + V1MessageEventsSubscriptionParams, +}; pub use self::{ - application::{Application, ApplicationCreateOptions, ApplicationListOptions}, + application::{ + Application, + ApplicationCreateOptions, + ApplicationListOptions, + }, authentication::{ - Authentication, AuthenticationAppPortalAccessOptions, AuthenticationExpireAllOptions, - AuthenticationLogoutOptions, AuthenticationRotateStreamPollerTokenOptions, + Authentication, + AuthenticationAppPortalAccessOptions, + AuthenticationExpireAllOptions, + AuthenticationLogoutOptions, + AuthenticationRotateStreamPollerTokenOptions, AuthenticationStreamPortalAccessOptions, }, - background_task::{BackgroundTask, BackgroundTaskListOptions}, - connector::{Connector, ConnectorCreateOptions, ConnectorListOptions}, + background_task::{ + BackgroundTask, + BackgroundTaskListOptions, + }, + connector::{ + Connector, + ConnectorCreateOptions, + ConnectorListOptions, + }, deprecated::*, endpoint::{ - Endpoint, EndpointCreateOptions, EndpointGetStatsOptions, EndpointListOptions, - EndpointRecoverOptions, EndpointReplayMissingOptions, EndpointRotateSecretOptions, + Endpoint, + EndpointCreateOptions, + EndpointGetStatsOptions, + EndpointListOptions, + EndpointRecoverOptions, + EndpointReplayMissingOptions, + EndpointRotateSecretOptions, EndpointSendExampleOptions, }, - environment::{Environment, EnvironmentExportOptions, EnvironmentImportOptions}, + environment::{ + Environment, + EnvironmentExportOptions, + EnvironmentImportOptions, + }, event_type::{ - EventType, EventTypeCreateOptions, EventTypeDeleteOptions, EventTypeImportOpenapiOptions, + EventType, + EventTypeCreateOptions, + EventTypeDeleteOptions, + EventTypeImportOpenapiOptions, EventTypeListOptions, }, - ingest::{Ingest, IngestDashboardOptions}, + ingest::{ + Ingest, + IngestDashboardOptions, + }, ingest_endpoint::{ - IngestEndpoint, IngestEndpointCreateOptions, IngestEndpointListOptions, + IngestEndpoint, + IngestEndpointCreateOptions, + IngestEndpointListOptions, IngestEndpointRotateSecretOptions, }, ingest_source::{ - IngestSource, IngestSourceCreateOptions, IngestSourceListOptions, + IngestSource, + IngestSourceCreateOptions, + IngestSourceListOptions, IngestSourceRotateTokenOptions, }, integration::{ - Integration, IntegrationCreateOptions, IntegrationListOptions, IntegrationRotateKeyOptions, + Integration, + IntegrationCreateOptions, + IntegrationListOptions, + IntegrationRotateKeyOptions, }, message::{ - Message, MessageCreateOptions, MessageExpungeAllContentsOptions, MessageGetOptions, + Message, + MessageCreateOptions, + MessageExpungeAllContentsOptions, + MessageGetOptions, MessageListOptions, }, message_attempt::{ - MessageAttempt, MessageAttemptListAttemptedDestinationsOptions, - MessageAttemptListAttemptedMessagesOptions, MessageAttemptListByEndpointOptions, - MessageAttemptListByMsgOptions, MessageAttemptResendOptions, + MessageAttempt, + MessageAttemptListAttemptedDestinationsOptions, + MessageAttemptListAttemptedMessagesOptions, + MessageAttemptListByEndpointOptions, + MessageAttemptListByMsgOptions, + MessageAttemptResendOptions, }, message_poller::{ - MessagePoller, MessagePollerConsumerPollOptions, MessagePollerConsumerSeekOptions, + MessagePoller, + MessagePollerConsumerPollOptions, + MessagePollerConsumerSeekOptions, MessagePollerPollOptions, }, operational_webhook::OperationalWebhook, operational_webhook_endpoint::{ - OperationalWebhookEndpoint, OperationalWebhookEndpointCreateOptions, - OperationalWebhookEndpointListOptions, OperationalWebhookEndpointRotateSecretOptions, + OperationalWebhookEndpoint, + OperationalWebhookEndpointCreateOptions, + OperationalWebhookEndpointListOptions, + OperationalWebhookEndpointRotateSecretOptions, + }, + statistics::{ + Statistics, + StatisticsAggregateAppStatsOptions, }, - statistics::{Statistics, StatisticsAggregateAppStatsOptions}, streaming::Streaming, streaming_event_type::{ - StreamingEventType, StreamingEventTypeCreateOptions, StreamingEventTypeDeleteOptions, + StreamingEventType, + StreamingEventTypeCreateOptions, + StreamingEventTypeDeleteOptions, StreamingEventTypeListOptions, }, - streaming_events::{StreamingEvents, StreamingEventsCreateOptions, StreamingEventsGetOptions}, + streaming_events::{ + StreamingEvents, + StreamingEventsCreateOptions, + StreamingEventsGetOptions, + }, streaming_sink::{ - StreamingSink, StreamingSinkCreateOptions, StreamingSinkListOptions, + StreamingSink, + StreamingSinkCreateOptions, + StreamingSinkListOptions, StreamingSinkRotateSecretOptions, }, - streaming_stream::{StreamingStream, StreamingStreamCreateOptions, StreamingStreamListOptions}, + streaming_stream::{ + StreamingStream, + StreamingStreamCreateOptions, + StreamingStreamListOptions, + }, }; impl Svix { diff --git a/rust/src/api/operational_webhook.rs b/rust/src/api/operational_webhook.rs index 887e2d89d..1affbd734 100644 --- a/rust/src/api/operational_webhook.rs +++ b/rust/src/api/operational_webhook.rs @@ -8,7 +8,9 @@ pub struct OperationalWebhook<'a> { impl<'a> OperationalWebhook<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } pub fn endpoint(&self) -> OperationalWebhookEndpoint<'a> { diff --git a/rust/src/api/operational_webhook_endpoint.rs b/rust/src/api/operational_webhook_endpoint.rs index c9505e864..529f79f41 100644 --- a/rust/src/api/operational_webhook_endpoint.rs +++ b/rust/src/api/operational_webhook_endpoint.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct OperationalWebhookEndpointListOptions { @@ -29,7 +33,9 @@ pub struct OperationalWebhookEndpoint<'a> { impl<'a> OperationalWebhookEndpoint<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List operational webhook endpoints. @@ -43,12 +49,21 @@ impl<'a> OperationalWebhookEndpoint<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/operational-webhook/endpoint") - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/operational-webhook/endpoint", + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Create an operational webhook endpoint. @@ -57,23 +72,36 @@ impl<'a> OperationalWebhookEndpoint<'a> { operational_webhook_endpoint_in: OperationalWebhookEndpointIn, options: Option, ) -> Result { - let OperationalWebhookEndpointCreateOptions { idempotency_key } = - options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/operational-webhook/endpoint") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(operational_webhook_endpoint_in) - .execute(self.cfg) - .await + let OperationalWebhookEndpointCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/operational-webhook/endpoint", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(operational_webhook_endpoint_in) + .execute(self.cfg) + .await } /// Get an operational webhook endpoint. - pub async fn get(&self, endpoint_id: String) -> Result { + pub async fn get( + &self, + endpoint_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/api/v1/operational-webhook/endpoint/{endpoint_id}", ) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -88,19 +116,28 @@ impl<'a> OperationalWebhookEndpoint<'a> { http1::Method::PUT, "/api/v1/operational-webhook/endpoint/{endpoint_id}", ) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(operational_webhook_endpoint_update) .execute(self.cfg) .await } /// Delete an operational webhook endpoint. - pub async fn delete(&self, endpoint_id: String) -> Result<()> { + pub async fn delete( + &self, + endpoint_id: String, + ) -> Result<()> { crate::request::Request::new( http1::Method::DELETE, "/api/v1/operational-webhook/endpoint/{endpoint_id}", ) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .returns_nothing() .execute(self.cfg) .await @@ -115,7 +152,10 @@ impl<'a> OperationalWebhookEndpoint<'a> { http1::Method::GET, "/api/v1/operational-webhook/endpoint/{endpoint_id}/headers", ) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -130,7 +170,10 @@ impl<'a> OperationalWebhookEndpoint<'a> { http1::Method::PUT, "/api/v1/operational-webhook/endpoint/{endpoint_id}/headers", ) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .with_body_param(operational_webhook_endpoint_headers_in) .returns_nothing() .execute(self.cfg) @@ -149,7 +192,10 @@ impl<'a> OperationalWebhookEndpoint<'a> { http1::Method::GET, "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret", ) - .with_path_param("endpoint_id", endpoint_id) + .with_path_param( + "endpoint_id", + endpoint_id, + ) .execute(self.cfg) .await } @@ -163,15 +209,22 @@ impl<'a> OperationalWebhookEndpoint<'a> { operational_webhook_endpoint_secret_in: OperationalWebhookEndpointSecretIn, options: Option, ) -> Result<()> { - let OperationalWebhookEndpointRotateSecretOptions { idempotency_key } = - options.unwrap_or_default(); + let OperationalWebhookEndpointRotateSecretOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate", ) - .with_path_param("endpoint_id", endpoint_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "endpoint_id", + endpoint_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(operational_webhook_endpoint_secret_in) .returns_nothing() .execute(self.cfg) diff --git a/rust/src/api/statistics.rs b/rust/src/api/statistics.rs index 921a9298a..41d3bedd0 100644 --- a/rust/src/api/statistics.rs +++ b/rust/src/api/statistics.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct StatisticsAggregateAppStatsOptions { @@ -12,7 +16,9 @@ pub struct Statistics<'a> { impl<'a> Statistics<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// Creates a background task to calculate the message destinations for all @@ -43,13 +49,21 @@ impl<'a> Statistics<'a> { app_usage_stats_in: AppUsageStatsIn, options: Option, ) -> Result { - let StatisticsAggregateAppStatsOptions { idempotency_key } = options.unwrap_or_default(); + let StatisticsAggregateAppStatsOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/stats/usage/app") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(app_usage_stats_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/stats/usage/app", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(app_usage_stats_in) + .execute(self.cfg) + .await } /// Creates a background task to calculate the listed event types for all @@ -76,8 +90,11 @@ impl<'a> Statistics<'a> { /// } /// ``` pub async fn aggregate_event_types(&self) -> Result { - crate::request::Request::new(http1::Method::PUT, "/api/v1/stats/usage/event-types") - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PUT, + "/api/v1/stats/usage/event-types", + ) + .execute(self.cfg) + .await } } diff --git a/rust/src/api/streaming.rs b/rust/src/api/streaming.rs index 1b56fd330..d4fcc4fa8 100644 --- a/rust/src/api/streaming.rs +++ b/rust/src/api/streaming.rs @@ -1,6 +1,15 @@ // this file is @generated -use super::{StreamingEventType, StreamingEvents, StreamingSink, StreamingStream}; -use crate::{error::Result, models::*, Configuration}; +use super::{ + StreamingEventType, + StreamingEvents, + StreamingSink, + StreamingStream, +}; +use crate::{ + error::Result, + models::*, + Configuration, +}; pub struct Streaming<'a> { cfg: &'a Configuration, @@ -8,7 +17,9 @@ pub struct Streaming<'a> { impl<'a> Streaming<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } pub fn event_type(&self) -> StreamingEventType<'a> { @@ -37,8 +48,13 @@ impl<'a> Streaming<'a> { http1::Method::GET, "/api/v1/stream/{stream_id}/sink/{sink_id}/headers", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .execute(self.cfg) .await } @@ -55,8 +71,13 @@ impl<'a> Streaming<'a> { http1::Method::PATCH, "/api/v1/stream/{stream_id}/sink/{sink_id}/headers", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .with_body_param(http_sink_headers_patch_in) .execute(self.cfg) .await @@ -72,8 +93,13 @@ impl<'a> Streaming<'a> { http1::Method::GET, "/api/v1/stream/{stream_id}/sink/{sink_id}/transformation", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .execute(self.cfg) .await } diff --git a/rust/src/api/streaming_event_type.rs b/rust/src/api/streaming_event_type.rs index 38826e5f7..7228389c4 100644 --- a/rust/src/api/streaming_event_type.rs +++ b/rust/src/api/streaming_event_type.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct StreamingEventTypeListOptions { @@ -34,7 +38,9 @@ pub struct StreamingEventType<'a> { impl<'a> StreamingEventType<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List of all the organization's event types for streaming. @@ -49,13 +55,25 @@ impl<'a> StreamingEventType<'a> { include_archived, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/stream/event-type") - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .with_optional_query_param("include_archived", include_archived) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/stream/event-type", + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .with_optional_query_param( + "include_archived", + include_archived, + ) + .execute(self.cfg) + .await } /// Create an event type for Streams. @@ -64,21 +82,37 @@ impl<'a> StreamingEventType<'a> { stream_event_type_in: StreamEventTypeIn, options: Option, ) -> Result { - let StreamingEventTypeCreateOptions { idempotency_key } = options.unwrap_or_default(); + let StreamingEventTypeCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/stream/event-type") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(stream_event_type_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/stream/event-type", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(stream_event_type_in) + .execute(self.cfg) + .await } /// Get an event type. - pub async fn get(&self, name: String) -> Result { - crate::request::Request::new(http1::Method::GET, "/api/v1/stream/event-type/{name}") - .with_path_param("name", name) - .execute(self.cfg) - .await + pub async fn get( + &self, + name: String, + ) -> Result { + crate::request::Request::new( + http1::Method::GET, + "/api/v1/stream/event-type/{name}", + ) + .with_path_param( + "name", name, + ) + .execute(self.cfg) + .await } /// Update or create a event type for Streams. @@ -87,11 +121,16 @@ impl<'a> StreamingEventType<'a> { name: String, stream_event_type_in: StreamEventTypeIn, ) -> Result { - crate::request::Request::new(http1::Method::PUT, "/api/v1/stream/event-type/{name}") - .with_path_param("name", name) - .with_body_param(stream_event_type_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PUT, + "/api/v1/stream/event-type/{name}", + ) + .with_path_param( + "name", name, + ) + .with_body_param(stream_event_type_in) + .execute(self.cfg) + .await } /// Delete an event type. @@ -100,14 +139,23 @@ impl<'a> StreamingEventType<'a> { name: String, options: Option, ) -> Result<()> { - let StreamingEventTypeDeleteOptions { expunge } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::DELETE, "/api/v1/stream/event-type/{name}") - .with_path_param("name", name) - .with_optional_query_param("expunge", expunge) - .returns_nothing() - .execute(self.cfg) - .await + let StreamingEventTypeDeleteOptions { + expunge, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::DELETE, + "/api/v1/stream/event-type/{name}", + ) + .with_path_param( + "name", name, + ) + .with_optional_query_param( + "expunge", expunge, + ) + .returns_nothing() + .execute(self.cfg) + .await } /// Patch an event type for Streams. @@ -116,10 +164,15 @@ impl<'a> StreamingEventType<'a> { name: String, stream_event_type_patch: StreamEventTypePatch, ) -> Result { - crate::request::Request::new(http1::Method::PATCH, "/api/v1/stream/event-type/{name}") - .with_path_param("name", name) - .with_body_param(stream_event_type_patch) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::PATCH, + "/api/v1/stream/event-type/{name}", + ) + .with_path_param( + "name", name, + ) + .with_body_param(stream_event_type_patch) + .execute(self.cfg) + .await } } diff --git a/rust/src/api/streaming_events.rs b/rust/src/api/streaming_events.rs index 5aae10a64..04fdb847b 100644 --- a/rust/src/api/streaming_events.rs +++ b/rust/src/api/streaming_events.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct StreamingEventsCreateOptions { @@ -23,7 +27,9 @@ pub struct StreamingEvents<'a> { impl<'a> StreamingEvents<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// Creates events on the Stream. @@ -33,14 +39,25 @@ impl<'a> StreamingEvents<'a> { create_stream_events_in: CreateStreamEventsIn, options: Option, ) -> Result { - let StreamingEventsCreateOptions { idempotency_key } = options.unwrap_or_default(); + let StreamingEventsCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/stream/{stream_id}/events") - .with_path_param("stream_id", stream_id) - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(create_stream_events_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/stream/{stream_id}/events", + ) + .with_path_param( + "stream_id", + stream_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(create_stream_events_in) + .execute(self.cfg) + .await } /// Iterate over a stream of events. @@ -62,11 +79,22 @@ impl<'a> StreamingEvents<'a> { http1::Method::GET, "/api/v1/stream/{stream_id}/sink/{sink_id}/events", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("after", after) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "after", after, + ) .execute(self.cfg) .await } diff --git a/rust/src/api/streaming_sink.rs b/rust/src/api/streaming_sink.rs index 2be211d8a..0976f7748 100644 --- a/rust/src/api/streaming_sink.rs +++ b/rust/src/api/streaming_sink.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct StreamingSinkListOptions { @@ -29,7 +33,9 @@ pub struct StreamingSink<'a> { impl<'a> StreamingSink<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List of all the stream's sinks. @@ -44,13 +50,25 @@ impl<'a> StreamingSink<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/stream/{stream_id}/sink") - .with_path_param("stream_id", stream_id) - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/stream/{stream_id}/sink", + ) + .with_path_param( + "stream_id", + stream_id, + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Creates a new sink. @@ -60,24 +78,44 @@ impl<'a> StreamingSink<'a> { stream_sink_in: StreamSinkIn, options: Option, ) -> Result { - let StreamingSinkCreateOptions { idempotency_key } = options.unwrap_or_default(); - - crate::request::Request::new(http1::Method::POST, "/api/v1/stream/{stream_id}/sink") - .with_path_param("stream_id", stream_id) - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(stream_sink_in) - .execute(self.cfg) - .await + let StreamingSinkCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/api/v1/stream/{stream_id}/sink", + ) + .with_path_param( + "stream_id", + stream_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(stream_sink_in) + .execute(self.cfg) + .await } /// Get a sink by id or uid. - pub async fn get(&self, stream_id: String, sink_id: String) -> Result { + pub async fn get( + &self, + stream_id: String, + sink_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/api/v1/stream/{stream_id}/sink/{sink_id}", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .execute(self.cfg) .await } @@ -93,21 +131,35 @@ impl<'a> StreamingSink<'a> { http1::Method::PUT, "/api/v1/stream/{stream_id}/sink/{sink_id}", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .with_body_param(stream_sink_in) .execute(self.cfg) .await } /// Delete a sink. - pub async fn delete(&self, stream_id: String, sink_id: String) -> Result<()> { + pub async fn delete( + &self, + stream_id: String, + sink_id: String, + ) -> Result<()> { crate::request::Request::new( http1::Method::DELETE, "/api/v1/stream/{stream_id}/sink/{sink_id}", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .returns_nothing() .execute(self.cfg) .await @@ -124,8 +176,13 @@ impl<'a> StreamingSink<'a> { http1::Method::PATCH, "/api/v1/stream/{stream_id}/sink/{sink_id}", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .with_body_param(stream_sink_patch) .execute(self.cfg) .await @@ -136,13 +193,22 @@ impl<'a> StreamingSink<'a> { /// This is used to verify the authenticity of the delivery. /// /// For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). - pub async fn get_secret(&self, stream_id: String, sink_id: String) -> Result { + pub async fn get_secret( + &self, + stream_id: String, + sink_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/api/v1/stream/{stream_id}/sink/{sink_id}/secret", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .execute(self.cfg) .await } @@ -155,15 +221,25 @@ impl<'a> StreamingSink<'a> { endpoint_secret_rotate_in: EndpointSecretRotateIn, options: Option, ) -> Result { - let StreamingSinkRotateSecretOptions { idempotency_key } = options.unwrap_or_default(); + let StreamingSinkRotateSecretOptions { + idempotency_key, + } = options.unwrap_or_default(); crate::request::Request::new( http1::Method::POST, "/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) - .with_optional_header_param("idempotency-key", idempotency_key) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) .with_body_param(endpoint_secret_rotate_in) .execute(self.cfg) .await @@ -180,8 +256,13 @@ impl<'a> StreamingSink<'a> { http1::Method::PATCH, "/api/v1/stream/{stream_id}/sink/{sink_id}/transformation", ) - .with_path_param("stream_id", stream_id) - .with_path_param("sink_id", sink_id) + .with_path_param( + "stream_id", + stream_id, + ) + .with_path_param( + "sink_id", sink_id, + ) .with_body_param(sink_transform_in) .execute(self.cfg) .await diff --git a/rust/src/api/streaming_stream.rs b/rust/src/api/streaming_stream.rs index 780f22722..96004861c 100644 --- a/rust/src/api/streaming_stream.rs +++ b/rust/src/api/streaming_stream.rs @@ -1,5 +1,9 @@ // this file is @generated -use crate::{error::Result, models::*, Configuration}; +use crate::{ + error::Result, + models::*, + Configuration, +}; #[derive(Default)] pub struct StreamingStreamListOptions { @@ -24,7 +28,9 @@ pub struct StreamingStream<'a> { impl<'a> StreamingStream<'a> { pub(super) fn new(cfg: &'a Configuration) -> Self { - Self { cfg } + Self { + cfg, + } } /// List of all the organization's streams. @@ -38,12 +44,21 @@ impl<'a> StreamingStream<'a> { order, } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::GET, "/api/v1/stream") - .with_optional_query_param("limit", limit) - .with_optional_query_param("iterator", iterator) - .with_optional_query_param("order", order) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::GET, + "/api/v1/stream", + ) + .with_optional_query_param( + "limit", limit, + ) + .with_optional_query_param( + "iterator", iterator, + ) + .with_optional_query_param( + "order", order, + ) + .execute(self.cfg) + .await } /// Creates a new stream. @@ -52,47 +67,93 @@ impl<'a> StreamingStream<'a> { stream_in: StreamIn, options: Option, ) -> Result { - let StreamingStreamCreateOptions { idempotency_key } = options.unwrap_or_default(); + let StreamingStreamCreateOptions { + idempotency_key, + } = options.unwrap_or_default(); - crate::request::Request::new(http1::Method::POST, "/api/v1/stream") - .with_optional_header_param("idempotency-key", idempotency_key) - .with_body_param(stream_in) - .execute(self.cfg) - .await + crate::request::Request::new( + http1::Method::POST, + "/api/v1/stream", + ) + .with_optional_header_param( + "idempotency-key", + idempotency_key, + ) + .with_body_param(stream_in) + .execute(self.cfg) + .await } /// Get a stream by id or uid. - pub async fn get(&self, stream_id: String) -> Result { - crate::request::Request::new(http1::Method::GET, "/api/v1/stream/{stream_id}") - .with_path_param("stream_id", stream_id) - .execute(self.cfg) - .await + pub async fn get( + &self, + stream_id: String, + ) -> Result { + crate::request::Request::new( + http1::Method::GET, + "/api/v1/stream/{stream_id}", + ) + .with_path_param( + "stream_id", + stream_id, + ) + .execute(self.cfg) + .await } /// Update a stream. - pub async fn update(&self, stream_id: String, stream_in: StreamIn) -> Result { - crate::request::Request::new(http1::Method::PUT, "/api/v1/stream/{stream_id}") - .with_path_param("stream_id", stream_id) - .with_body_param(stream_in) - .execute(self.cfg) - .await + pub async fn update( + &self, + stream_id: String, + stream_in: StreamIn, + ) -> Result { + crate::request::Request::new( + http1::Method::PUT, + "/api/v1/stream/{stream_id}", + ) + .with_path_param( + "stream_id", + stream_id, + ) + .with_body_param(stream_in) + .execute(self.cfg) + .await } /// Delete a stream. - pub async fn delete(&self, stream_id: String) -> Result<()> { - crate::request::Request::new(http1::Method::DELETE, "/api/v1/stream/{stream_id}") - .with_path_param("stream_id", stream_id) - .returns_nothing() - .execute(self.cfg) - .await + pub async fn delete( + &self, + stream_id: String, + ) -> Result<()> { + crate::request::Request::new( + http1::Method::DELETE, + "/api/v1/stream/{stream_id}", + ) + .with_path_param( + "stream_id", + stream_id, + ) + .returns_nothing() + .execute(self.cfg) + .await } /// Partially update a stream. - pub async fn patch(&self, stream_id: String, stream_patch: StreamPatch) -> Result { - crate::request::Request::new(http1::Method::PATCH, "/api/v1/stream/{stream_id}") - .with_path_param("stream_id", stream_id) - .with_body_param(stream_patch) - .execute(self.cfg) - .await + pub async fn patch( + &self, + stream_id: String, + stream_patch: StreamPatch, + ) -> Result { + crate::request::Request::new( + http1::Method::PATCH, + "/api/v1/stream/{stream_id}", + ) + .with_path_param( + "stream_id", + stream_id, + ) + .with_body_param(stream_patch) + .execute(self.cfg) + .await } } diff --git a/rust/src/connector.rs b/rust/src/connector.rs index c336e82a8..69ff148d0 100644 --- a/rust/src/connector.rs +++ b/rust/src/connector.rs @@ -1,9 +1,15 @@ -use std::{future::Future, pin::Pin}; +use std::{ + future::Future, + pin::Pin, +}; use http1::Uri; use hyper_util::{ client::legacy::connect::{ - proxy::{SocksV5, Tunnel}, + proxy::{ + SocksV5, + Tunnel, + }, HttpConnector, }, rt::TokioIo, @@ -19,11 +25,17 @@ type MaybeHttpsStream = T; // If only native TLS is enabled, use that. #[cfg(all(feature = "native-tls", not(feature = "rustls-tls")))] -use hyper_tls::{HttpsConnector as HttpsIfAvailable, MaybeHttpsStream}; +use hyper_tls::{ + HttpsConnector as HttpsIfAvailable, + MaybeHttpsStream, +}; // If rustls is enabled, use that. #[cfg(feature = "rustls-tls")] -use hyper_rustls::{HttpsConnector as HttpsIfAvailable, MaybeHttpsStream}; +use hyper_rustls::{ + HttpsConnector as HttpsIfAvailable, + MaybeHttpsStream, +}; fn wrap_connector(conn: H) -> HttpsIfAvailable { #[cfg(not(any(feature = "native-tls", feature = "rustls-tls")))] @@ -64,7 +76,12 @@ pub(crate) enum Connector { // to be fallible and bubble the error up from `Svix::new`. pub(crate) fn make_connector(proxy_addr: Option) -> Connector { let mut http = hyper_util::client::legacy::connect::HttpConnector::new(); - if cfg!(any(feature = "native-tls", feature = "rustls-tls")) { + if cfg!( + any( + feature = "native-tls", + feature = "rustls-tls" + ) + ) { http.enforce_http(false); } @@ -84,15 +101,22 @@ pub(crate) fn make_connector(proxy_addr: Option) -> Connector { match proxy_addr.scheme_str() { Some("http" | "https") => { - let tunnel = Tunnel::new(proxy_addr, http); + let tunnel = Tunnel::new( + proxy_addr, http, + ); Connector::HttpProxy(wrap_connector(tunnel)) } Some("socks5") => { - let socks = SocksV5::new(proxy_addr, http).local_dns(true); + let socks = SocksV5::new( + proxy_addr, http, + ) + .local_dns(true); Connector::Socks5Proxy(wrap_connector(socks)) } Some("socks5h") => { - let socks = SocksV5::new(proxy_addr, http); + let socks = SocksV5::new( + proxy_addr, http, + ); Connector::Socks5Proxy(wrap_connector(socks)) } scheme => { @@ -121,7 +145,10 @@ impl Service for Connector { } } - fn call(&mut self, req: Uri) -> Self::Future { + fn call( + &mut self, + req: Uri, + ) -> Self::Future { match self { Self::Regular(inner) => Box::pin(inner.call(req)), Self::Socks5Proxy(inner) => Box::pin(inner.call(req)), diff --git a/rust/src/error.rs b/rust/src/error.rs index 966729b74..d663a391e 100644 --- a/rust/src/error.rs +++ b/rust/src/error.rs @@ -26,20 +26,27 @@ impl Error { Self::Generic(format!("{err:?}")) } - pub(crate) async fn from_response(status_code: http1::StatusCode, body: Incoming) -> Self { + pub(crate) async fn from_response( + status_code: http1::StatusCode, + body: Incoming, + ) -> Self { match body.collect().await { Ok(collected) => { let bytes = collected.to_bytes(); if status_code == http1::StatusCode::UNPROCESSABLE_ENTITY { - Self::Validation(HttpErrorContent { - status: http02::StatusCode::UNPROCESSABLE_ENTITY, - payload: serde_json::from_slice(&bytes).ok(), - }) + Self::Validation( + HttpErrorContent { + status: http02::StatusCode::UNPROCESSABLE_ENTITY, + payload: serde_json::from_slice(&bytes).ok(), + }, + ) } else { - Error::Http(HttpErrorContent { - status: http1_to_02_status_code(status_code), - payload: serde_json::from_slice(&bytes).ok(), - }) + Error::Http( + HttpErrorContent { + status: http1_to_02_status_code(status_code), + payload: serde_json::from_slice(&bytes).ok(), + }, + ) } } Err(e) => Self::Generic(e.to_string()), @@ -55,11 +62,22 @@ impl From for String { } impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { match self { Error::Generic(s) => s.fmt(f), - Error::Http(e) => format!("Http error (status={}) {:?}", e.status, e.payload).fmt(f), - Error::Validation(e) => format!("Validation error {:?}", e.payload).fmt(f), + Error::Http(e) => format!( + "Http error (status={}) {:?}", + e.status, e.payload + ) + .fmt(f), + Error::Validation(e) => format!( + "Validation error {:?}", + e.payload + ) + .fmt(f), } } } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 4d46798de..deccf009c 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -21,7 +21,10 @@ mod models; mod request; pub mod webhooks; -pub(crate) use connector::{make_connector, Connector}; +pub(crate) use connector::{ + make_connector, + Connector, +}; pub struct Configuration { pub base_path: String, diff --git a/rust/src/model_ext.rs b/rust/src/model_ext.rs index 9a42afc75..e1eb3d586 100644 --- a/rust/src/model_ext.rs +++ b/rust/src/model_ext.rs @@ -5,7 +5,11 @@ use std::str::FromStr; use serde_json::json; use crate::{ - api::{MessageStatus, Ordering, StatusCodeClass}, + api::{ + MessageStatus, + Ordering, + StatusCodeClass, + }, models::MessageIn, }; @@ -22,15 +26,24 @@ impl MessageIn { /// The default `content-type` of `application/json` will still be used for /// the webhook sent by Svix, unless overwritten with /// [`with_content_type`][Self::with_content_type]. - pub fn new_raw_payload(event_type: String, payload: String) -> Self { + pub fn new_raw_payload( + event_type: String, + payload: String, + ) -> Self { Self { transformations_params: Some(json!({ "rawPayload": payload })), - ..Self::new(event_type, json!({})) + ..Self::new( + event_type, + json!({}), + ) } } /// Set the `content-type` header to use for the webhook sent by Svix. - pub fn with_content_type(mut self, content_type: String) -> Self { + pub fn with_content_type( + mut self, + content_type: String, + ) -> Self { let transformations_params = self.transformations_params.get_or_insert_with(|| json!({})); // This will panic if transformations_params, its headers field, or the diff --git a/rust/src/models/adobe_sign_config.rs b/rust/src/models/adobe_sign_config.rs index adfed72f3..0abb9eb32 100644 --- a/rust/src/models/adobe_sign_config.rs +++ b/rust/src/models/adobe_sign_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AdobeSignConfig { @@ -9,6 +12,8 @@ pub struct AdobeSignConfig { impl AdobeSignConfig { pub fn new(client_id: String) -> Self { - Self { client_id } + Self { + client_id, + } } } diff --git a/rust/src/models/adobe_sign_config_out.rs b/rust/src/models/adobe_sign_config_out.rs index efb87d35b..a1bd7e737 100644 --- a/rust/src/models/adobe_sign_config_out.rs +++ b/rust/src/models/adobe_sign_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AdobeSignConfigOut {} diff --git a/rust/src/models/aggregate_event_types_out.rs b/rust/src/models/aggregate_event_types_out.rs index 48834a804..f82c038ce 100644 --- a/rust/src/models/aggregate_event_types_out.rs +++ b/rust/src/models/aggregate_event_types_out.rs @@ -1,8 +1,12 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - background_task_status::BackgroundTaskStatus, background_task_type::BackgroundTaskType, + background_task_status::BackgroundTaskStatus, + background_task_type::BackgroundTaskType, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -16,7 +20,15 @@ pub struct AggregateEventTypesOut { } impl AggregateEventTypesOut { - pub fn new(id: String, status: BackgroundTaskStatus, task: BackgroundTaskType) -> Self { - Self { id, status, task } + pub fn new( + id: String, + status: BackgroundTaskStatus, + task: BackgroundTaskType, + ) -> Self { + Self { + id, + status, + task, + } } } diff --git a/rust/src/models/airwallex_config.rs b/rust/src/models/airwallex_config.rs index 25d4436bb..c3905a3c7 100644 --- a/rust/src/models/airwallex_config.rs +++ b/rust/src/models/airwallex_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AirwallexConfig { @@ -8,6 +11,8 @@ pub struct AirwallexConfig { impl AirwallexConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/airwallex_config_out.rs b/rust/src/models/airwallex_config_out.rs index 14b629bd4..d615c6975 100644 --- a/rust/src/models/airwallex_config_out.rs +++ b/rust/src/models/airwallex_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AirwallexConfigOut {} diff --git a/rust/src/models/amazon_s3_patch_config.rs b/rust/src/models/amazon_s3_patch_config.rs index 51051b885..e595c8fe1 100644 --- a/rust/src/models/amazon_s3_patch_config.rs +++ b/rust/src/models/amazon_s3_patch_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AmazonS3PatchConfig { diff --git a/rust/src/models/api_token_out.rs b/rust/src/models/api_token_out.rs index 2090dd8c4..c539a3435 100644 --- a/rust/src/models/api_token_out.rs +++ b/rust/src/models/api_token_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ApiTokenOut { @@ -23,7 +26,11 @@ pub struct ApiTokenOut { } impl ApiTokenOut { - pub fn new(created_at: String, id: String, token: String) -> Self { + pub fn new( + created_at: String, + id: String, + token: String, + ) -> Self { Self { created_at, expires_at: None, diff --git a/rust/src/models/app_portal_access_in.rs b/rust/src/models/app_portal_access_in.rs index 150e76ccf..13364d4dc 100644 --- a/rust/src/models/app_portal_access_in.rs +++ b/rust/src/models/app_portal_access_in.rs @@ -1,7 +1,13 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; -use super::{app_portal_capability::AppPortalCapability, application_in::ApplicationIn}; +use super::{ + app_portal_capability::AppPortalCapability, + application_in::ApplicationIn, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AppPortalAccessIn { diff --git a/rust/src/models/app_portal_access_out.rs b/rust/src/models/app_portal_access_out.rs index f25625aeb..e3619a0de 100644 --- a/rust/src/models/app_portal_access_out.rs +++ b/rust/src/models/app_portal_access_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AppPortalAccessOut { @@ -9,7 +12,13 @@ pub struct AppPortalAccessOut { } impl AppPortalAccessOut { - pub fn new(token: String, url: String) -> Self { - Self { token, url } + pub fn new( + token: String, + url: String, + ) -> Self { + Self { + token, + url, + } } } diff --git a/rust/src/models/app_portal_capability.rs b/rust/src/models/app_portal_capability.rs index 337db946a..90e2a9d2a 100644 --- a/rust/src/models/app_portal_capability.rs +++ b/rust/src/models/app_portal_capability.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -23,7 +26,10 @@ pub enum AppPortalCapability { } impl fmt::Display for AppPortalCapability { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::ViewBase => "ViewBase", Self::ViewEndpointSecret => "ViewEndpointSecret", diff --git a/rust/src/models/app_usage_stats_in.rs b/rust/src/models/app_usage_stats_in.rs index 6d6c35f98..957e1caea 100644 --- a/rust/src/models/app_usage_stats_in.rs +++ b/rust/src/models/app_usage_stats_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AppUsageStatsIn { @@ -17,7 +20,10 @@ pub struct AppUsageStatsIn { } impl AppUsageStatsIn { - pub fn new(since: String, until: String) -> Self { + pub fn new( + since: String, + until: String, + ) -> Self { Self { app_ids: None, since, diff --git a/rust/src/models/app_usage_stats_out.rs b/rust/src/models/app_usage_stats_out.rs index b3d316e92..59e37ef3e 100644 --- a/rust/src/models/app_usage_stats_out.rs +++ b/rust/src/models/app_usage_stats_out.rs @@ -1,8 +1,12 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - background_task_status::BackgroundTaskStatus, background_task_type::BackgroundTaskType, + background_task_status::BackgroundTaskStatus, + background_task_type::BackgroundTaskType, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] diff --git a/rust/src/models/application_in.rs b/rust/src/models/application_in.rs index 365475a92..085c41761 100644 --- a/rust/src/models/application_in.rs +++ b/rust/src/models/application_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ApplicationIn { diff --git a/rust/src/models/application_out.rs b/rust/src/models/application_out.rs index ab24a798f..0644ce7ea 100644 --- a/rust/src/models/application_out.rs +++ b/rust/src/models/application_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ApplicationOut { diff --git a/rust/src/models/application_patch.rs b/rust/src/models/application_patch.rs index f5f96d105..3ec552cb8 100644 --- a/rust/src/models/application_patch.rs +++ b/rust/src/models/application_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ApplicationPatch { diff --git a/rust/src/models/application_token_expire_in.rs b/rust/src/models/application_token_expire_in.rs index 1871ab9a8..7f775d04c 100644 --- a/rust/src/models/application_token_expire_in.rs +++ b/rust/src/models/application_token_expire_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ApplicationTokenExpireIn { diff --git a/rust/src/models/azure_blob_storage_config.rs b/rust/src/models/azure_blob_storage_config.rs index 8eeb99e8f..13066d079 100644 --- a/rust/src/models/azure_blob_storage_config.rs +++ b/rust/src/models/azure_blob_storage_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AzureBlobStorageConfig { @@ -12,7 +15,11 @@ pub struct AzureBlobStorageConfig { } impl AzureBlobStorageConfig { - pub fn new(access_key: String, account: String, container: String) -> Self { + pub fn new( + access_key: String, + account: String, + container: String, + ) -> Self { Self { access_key, account, diff --git a/rust/src/models/azure_blob_storage_patch_config.rs b/rust/src/models/azure_blob_storage_patch_config.rs index 64c04265a..6b94d960f 100644 --- a/rust/src/models/azure_blob_storage_patch_config.rs +++ b/rust/src/models/azure_blob_storage_patch_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct AzureBlobStoragePatchConfig { diff --git a/rust/src/models/background_task_finished_event.rs b/rust/src/models/background_task_finished_event.rs index deb55405c..a3cc026d6 100644 --- a/rust/src/models/background_task_finished_event.rs +++ b/rust/src/models/background_task_finished_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::background_task_finished_event2::BackgroundTaskFinishedEvent2; @@ -12,7 +15,13 @@ pub struct BackgroundTaskFinishedEvent { } impl BackgroundTaskFinishedEvent { - pub fn new(data: BackgroundTaskFinishedEvent2, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: BackgroundTaskFinishedEvent2, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/background_task_finished_event2.rs b/rust/src/models/background_task_finished_event2.rs index d9d834031..0f4027b7f 100644 --- a/rust/src/models/background_task_finished_event2.rs +++ b/rust/src/models/background_task_finished_event2.rs @@ -1,8 +1,12 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - background_task_status::BackgroundTaskStatus, background_task_type::BackgroundTaskType, + background_task_status::BackgroundTaskStatus, + background_task_type::BackgroundTaskType, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] diff --git a/rust/src/models/background_task_out.rs b/rust/src/models/background_task_out.rs index b4d27724f..b7dccbe8e 100644 --- a/rust/src/models/background_task_out.rs +++ b/rust/src/models/background_task_out.rs @@ -1,8 +1,12 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - background_task_status::BackgroundTaskStatus, background_task_type::BackgroundTaskType, + background_task_status::BackgroundTaskStatus, + background_task_type::BackgroundTaskType, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] diff --git a/rust/src/models/background_task_status.rs b/rust/src/models/background_task_status.rs index a687df182..eeceb0669 100644 --- a/rust/src/models/background_task_status.rs +++ b/rust/src/models/background_task_status.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -17,7 +20,10 @@ pub enum BackgroundTaskStatus { } impl fmt::Display for BackgroundTaskStatus { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::Running => "running", Self::Finished => "finished", diff --git a/rust/src/models/background_task_type.rs b/rust/src/models/background_task_type.rs index 7ccaeec57..bd4b47874 100644 --- a/rust/src/models/background_task_type.rs +++ b/rust/src/models/background_task_type.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -25,7 +28,10 @@ pub enum BackgroundTaskType { } impl fmt::Display for BackgroundTaskType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::EndpointReplay => "endpoint.replay", Self::EndpointRecover => "endpoint.recover", diff --git a/rust/src/models/checkbook_config.rs b/rust/src/models/checkbook_config.rs index 9264098c2..73c2caccf 100644 --- a/rust/src/models/checkbook_config.rs +++ b/rust/src/models/checkbook_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct CheckbookConfig { @@ -8,6 +11,8 @@ pub struct CheckbookConfig { impl CheckbookConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/checkbook_config_out.rs b/rust/src/models/checkbook_config_out.rs index 4eb18287f..a97731680 100644 --- a/rust/src/models/checkbook_config_out.rs +++ b/rust/src/models/checkbook_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct CheckbookConfigOut {} diff --git a/rust/src/models/connector_in.rs b/rust/src/models/connector_in.rs index 2463eeae4..56f236d4e 100644 --- a/rust/src/models/connector_in.rs +++ b/rust/src/models/connector_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::connector_kind::ConnectorKind; @@ -31,7 +34,10 @@ pub struct ConnectorIn { } impl ConnectorIn { - pub fn new(name: String, transformation: String) -> Self { + pub fn new( + name: String, + transformation: String, + ) -> Self { Self { allowed_event_types: None, description: None, diff --git a/rust/src/models/connector_kind.rs b/rust/src/models/connector_kind.rs index 777d65390..569a61270 100644 --- a/rust/src/models/connector_kind.rs +++ b/rust/src/models/connector_kind.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -45,7 +48,10 @@ pub enum ConnectorKind { } impl fmt::Display for ConnectorKind { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::Custom => "Custom", Self::AgenticCommerceProtocol => "AgenticCommerceProtocol", diff --git a/rust/src/models/connector_out.rs b/rust/src/models/connector_out.rs index 557588db6..0931cf929 100644 --- a/rust/src/models/connector_out.rs +++ b/rust/src/models/connector_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::connector_kind::ConnectorKind; diff --git a/rust/src/models/connector_patch.rs b/rust/src/models/connector_patch.rs index f5a9466b8..534872623 100644 --- a/rust/src/models/connector_patch.rs +++ b/rust/src/models/connector_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::connector_kind::ConnectorKind; diff --git a/rust/src/models/connector_update.rs b/rust/src/models/connector_update.rs index e6d2ff7ef..1988b2602 100644 --- a/rust/src/models/connector_update.rs +++ b/rust/src/models/connector_update.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::connector_kind::ConnectorKind; diff --git a/rust/src/models/create_stream_events_in.rs b/rust/src/models/create_stream_events_in.rs index be3ddf4c6..465061de7 100644 --- a/rust/src/models/create_stream_events_in.rs +++ b/rust/src/models/create_stream_events_in.rs @@ -1,7 +1,13 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; -use super::{event_in::EventIn, stream_in::StreamIn}; +use super::{ + event_in::EventIn, + stream_in::StreamIn, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct CreateStreamEventsIn { diff --git a/rust/src/models/create_stream_events_out.rs b/rust/src/models/create_stream_events_out.rs index 805690581..9ee50207b 100644 --- a/rust/src/models/create_stream_events_out.rs +++ b/rust/src/models/create_stream_events_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct CreateStreamEventsOut {} diff --git a/rust/src/models/cron_config.rs b/rust/src/models/cron_config.rs index 5b1a297da..0b4545ae8 100644 --- a/rust/src/models/cron_config.rs +++ b/rust/src/models/cron_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct CronConfig { @@ -16,7 +19,10 @@ pub struct CronConfig { } impl CronConfig { - pub fn new(payload: String, schedule: String) -> Self { + pub fn new( + payload: String, + schedule: String, + ) -> Self { Self { content_type: None, payload, diff --git a/rust/src/models/dashboard_access_out.rs b/rust/src/models/dashboard_access_out.rs index 8d04b8eb1..8c84e8f29 100644 --- a/rust/src/models/dashboard_access_out.rs +++ b/rust/src/models/dashboard_access_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct DashboardAccessOut { @@ -9,7 +12,13 @@ pub struct DashboardAccessOut { } impl DashboardAccessOut { - pub fn new(token: String, url: String) -> Self { - Self { token, url } + pub fn new( + token: String, + url: String, + ) -> Self { + Self { + token, + url, + } } } diff --git a/rust/src/models/docusign_config.rs b/rust/src/models/docusign_config.rs index 89a39f9f8..90fd428ef 100644 --- a/rust/src/models/docusign_config.rs +++ b/rust/src/models/docusign_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct DocusignConfig { @@ -9,6 +12,8 @@ pub struct DocusignConfig { impl DocusignConfig { pub fn new() -> Self { - Self { secret: None } + Self { + secret: None, + } } } diff --git a/rust/src/models/docusign_config_out.rs b/rust/src/models/docusign_config_out.rs index 33aaa96fc..e7d3b2ff9 100644 --- a/rust/src/models/docusign_config_out.rs +++ b/rust/src/models/docusign_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct DocusignConfigOut {} diff --git a/rust/src/models/easypost_config.rs b/rust/src/models/easypost_config.rs index 856c60889..a326ca393 100644 --- a/rust/src/models/easypost_config.rs +++ b/rust/src/models/easypost_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EasypostConfig { @@ -9,6 +12,8 @@ pub struct EasypostConfig { impl EasypostConfig { pub fn new() -> Self { - Self { secret: None } + Self { + secret: None, + } } } diff --git a/rust/src/models/easypost_config_out.rs b/rust/src/models/easypost_config_out.rs index befbcb857..045f801e7 100644 --- a/rust/src/models/easypost_config_out.rs +++ b/rust/src/models/easypost_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EasypostConfigOut {} diff --git a/rust/src/models/empty_response.rs b/rust/src/models/empty_response.rs index 9101c19d0..f1be9a9ed 100644 --- a/rust/src/models/empty_response.rs +++ b/rust/src/models/empty_response.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EmptyResponse {} diff --git a/rust/src/models/endpoint_created_event.rs b/rust/src/models/endpoint_created_event.rs index ae8ccde0a..cd092f6d8 100644 --- a/rust/src/models/endpoint_created_event.rs +++ b/rust/src/models/endpoint_created_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_created_event_data::EndpointCreatedEventData; @@ -12,7 +15,13 @@ pub struct EndpointCreatedEvent { } impl EndpointCreatedEvent { - pub fn new(data: EndpointCreatedEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: EndpointCreatedEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/endpoint_created_event_data.rs b/rust/src/models/endpoint_created_event_data.rs index ac7819280..34df3a3a7 100644 --- a/rust/src/models/endpoint_created_event_data.rs +++ b/rust/src/models/endpoint_created_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Sent when an endpoint is created, updated, or deleted #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -24,7 +27,10 @@ pub struct EndpointCreatedEventData { } impl EndpointCreatedEventData { - pub fn new(app_id: String, endpoint_id: String) -> Self { + pub fn new( + app_id: String, + endpoint_id: String, + ) -> Self { Self { app_id, app_uid: None, diff --git a/rust/src/models/endpoint_deleted_event.rs b/rust/src/models/endpoint_deleted_event.rs index 409b518bf..49cc7cfc4 100644 --- a/rust/src/models/endpoint_deleted_event.rs +++ b/rust/src/models/endpoint_deleted_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_deleted_event_data::EndpointDeletedEventData; @@ -12,7 +15,13 @@ pub struct EndpointDeletedEvent { } impl EndpointDeletedEvent { - pub fn new(data: EndpointDeletedEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: EndpointDeletedEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/endpoint_deleted_event_data.rs b/rust/src/models/endpoint_deleted_event_data.rs index 630b961b4..aecbb6fc5 100644 --- a/rust/src/models/endpoint_deleted_event_data.rs +++ b/rust/src/models/endpoint_deleted_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Sent when an endpoint is created, updated, or deleted #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -24,7 +27,10 @@ pub struct EndpointDeletedEventData { } impl EndpointDeletedEventData { - pub fn new(app_id: String, endpoint_id: String) -> Self { + pub fn new( + app_id: String, + endpoint_id: String, + ) -> Self { Self { app_id, app_uid: None, diff --git a/rust/src/models/endpoint_disabled_event.rs b/rust/src/models/endpoint_disabled_event.rs index ef12af2fa..6f94daadc 100644 --- a/rust/src/models/endpoint_disabled_event.rs +++ b/rust/src/models/endpoint_disabled_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_disabled_event_data::EndpointDisabledEventData; @@ -13,7 +16,13 @@ pub struct EndpointDisabledEvent { } impl EndpointDisabledEvent { - pub fn new(data: EndpointDisabledEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: EndpointDisabledEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/endpoint_disabled_event_data.rs b/rust/src/models/endpoint_disabled_event_data.rs index 614fda874..6ede91397 100644 --- a/rust/src/models/endpoint_disabled_event_data.rs +++ b/rust/src/models/endpoint_disabled_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_disabled_trigger::EndpointDisabledTrigger; @@ -34,7 +37,10 @@ pub struct EndpointDisabledEventData { } impl EndpointDisabledEventData { - pub fn new(app_id: String, endpoint_id: String) -> Self { + pub fn new( + app_id: String, + endpoint_id: String, + ) -> Self { Self { app_id, app_uid: None, diff --git a/rust/src/models/endpoint_disabled_trigger.rs b/rust/src/models/endpoint_disabled_trigger.rs index deb57d45f..ae606e17c 100644 --- a/rust/src/models/endpoint_disabled_trigger.rs +++ b/rust/src/models/endpoint_disabled_trigger.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -15,7 +18,10 @@ pub enum EndpointDisabledTrigger { } impl fmt::Display for EndpointDisabledTrigger { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::Manual => "manual", Self::Automatic => "automatic", diff --git a/rust/src/models/endpoint_enabled_event.rs b/rust/src/models/endpoint_enabled_event.rs index f64f756c7..fc483804c 100644 --- a/rust/src/models/endpoint_enabled_event.rs +++ b/rust/src/models/endpoint_enabled_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_enabled_event_data::EndpointEnabledEventData; @@ -12,7 +15,13 @@ pub struct EndpointEnabledEvent { } impl EndpointEnabledEvent { - pub fn new(data: EndpointEnabledEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: EndpointEnabledEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/endpoint_enabled_event_data.rs b/rust/src/models/endpoint_enabled_event_data.rs index 6d98fa4cd..6cba2278e 100644 --- a/rust/src/models/endpoint_enabled_event_data.rs +++ b/rust/src/models/endpoint_enabled_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Sent when an endpoint has been enabled. #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -24,7 +27,10 @@ pub struct EndpointEnabledEventData { } impl EndpointEnabledEventData { - pub fn new(app_id: String, endpoint_id: String) -> Self { + pub fn new( + app_id: String, + endpoint_id: String, + ) -> Self { Self { app_id, app_uid: None, diff --git a/rust/src/models/endpoint_headers_in.rs b/rust/src/models/endpoint_headers_in.rs index ca7c0fc33..be772ddeb 100644 --- a/rust/src/models/endpoint_headers_in.rs +++ b/rust/src/models/endpoint_headers_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointHeadersIn { @@ -8,6 +11,8 @@ pub struct EndpointHeadersIn { impl EndpointHeadersIn { pub fn new(headers: std::collections::HashMap) -> Self { - Self { headers } + Self { + headers, + } } } diff --git a/rust/src/models/endpoint_headers_out.rs b/rust/src/models/endpoint_headers_out.rs index 6f8f09e5a..299b58dea 100644 --- a/rust/src/models/endpoint_headers_out.rs +++ b/rust/src/models/endpoint_headers_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// The value of the headers is returned in the `headers` field. /// @@ -13,7 +16,13 @@ pub struct EndpointHeadersOut { } impl EndpointHeadersOut { - pub fn new(headers: std::collections::HashMap, sensitive: Vec) -> Self { - Self { headers, sensitive } + pub fn new( + headers: std::collections::HashMap, + sensitive: Vec, + ) -> Self { + Self { + headers, + sensitive, + } } } diff --git a/rust/src/models/endpoint_headers_patch_in.rs b/rust/src/models/endpoint_headers_patch_in.rs index cfabd15fa..c2254772c 100644 --- a/rust/src/models/endpoint_headers_patch_in.rs +++ b/rust/src/models/endpoint_headers_patch_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointHeadersPatchIn { diff --git a/rust/src/models/endpoint_in.rs b/rust/src/models/endpoint_in.rs index 9559a9ac3..f86bd218f 100644 --- a/rust/src/models/endpoint_in.rs +++ b/rust/src/models/endpoint_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointIn { diff --git a/rust/src/models/endpoint_message_out.rs b/rust/src/models/endpoint_message_out.rs index 62a1c47f0..cedcce405 100644 --- a/rust/src/models/endpoint_message_out.rs +++ b/rust/src/models/endpoint_message_out.rs @@ -1,7 +1,13 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; -use super::{message_status::MessageStatus, message_status_text::MessageStatusText}; +use super::{ + message_status::MessageStatus, + message_status_text::MessageStatusText, +}; /// A model containing information on a given message plus additional fields on /// the last attempt for that message. diff --git a/rust/src/models/endpoint_out.rs b/rust/src/models/endpoint_out.rs index 969b1a145..3bd6fd41b 100644 --- a/rust/src/models/endpoint_out.rs +++ b/rust/src/models/endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointOut { diff --git a/rust/src/models/endpoint_patch.rs b/rust/src/models/endpoint_patch.rs index 6ccda6b36..a8ffbc401 100644 --- a/rust/src/models/endpoint_patch.rs +++ b/rust/src/models/endpoint_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointPatch { diff --git a/rust/src/models/endpoint_secret_out.rs b/rust/src/models/endpoint_secret_out.rs index 856bad8dd..fa1dd1070 100644 --- a/rust/src/models/endpoint_secret_out.rs +++ b/rust/src/models/endpoint_secret_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointSecretOut { @@ -13,6 +16,8 @@ pub struct EndpointSecretOut { impl EndpointSecretOut { pub fn new(key: String) -> Self { - Self { key } + Self { + key, + } } } diff --git a/rust/src/models/endpoint_secret_rotate_in.rs b/rust/src/models/endpoint_secret_rotate_in.rs index 564fad1fa..585e8a33d 100644 --- a/rust/src/models/endpoint_secret_rotate_in.rs +++ b/rust/src/models/endpoint_secret_rotate_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointSecretRotateIn { @@ -14,6 +17,8 @@ pub struct EndpointSecretRotateIn { impl EndpointSecretRotateIn { pub fn new() -> Self { - Self { key: None } + Self { + key: None, + } } } diff --git a/rust/src/models/endpoint_stats.rs b/rust/src/models/endpoint_stats.rs index 1178f45f0..8165132e5 100644 --- a/rust/src/models/endpoint_stats.rs +++ b/rust/src/models/endpoint_stats.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointStats { @@ -13,7 +16,12 @@ pub struct EndpointStats { } impl EndpointStats { - pub fn new(fail: i32, pending: i32, sending: i32, success: i32) -> Self { + pub fn new( + fail: i32, + pending: i32, + sending: i32, + success: i32, + ) -> Self { Self { fail, pending, diff --git a/rust/src/models/endpoint_transformation_in.rs b/rust/src/models/endpoint_transformation_in.rs index fb697ebe7..c7bc81d97 100644 --- a/rust/src/models/endpoint_transformation_in.rs +++ b/rust/src/models/endpoint_transformation_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointTransformationIn { diff --git a/rust/src/models/endpoint_transformation_out.rs b/rust/src/models/endpoint_transformation_out.rs index bc725cf41..ed635eb71 100644 --- a/rust/src/models/endpoint_transformation_out.rs +++ b/rust/src/models/endpoint_transformation_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointTransformationOut { diff --git a/rust/src/models/endpoint_transformation_patch.rs b/rust/src/models/endpoint_transformation_patch.rs index 49fd1b79e..64d0cd3f3 100644 --- a/rust/src/models/endpoint_transformation_patch.rs +++ b/rust/src/models/endpoint_transformation_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointTransformationPatch { diff --git a/rust/src/models/endpoint_update.rs b/rust/src/models/endpoint_update.rs index f2a47d189..6d48aae26 100644 --- a/rust/src/models/endpoint_update.rs +++ b/rust/src/models/endpoint_update.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EndpointUpdate { diff --git a/rust/src/models/endpoint_updated_event.rs b/rust/src/models/endpoint_updated_event.rs index 4dc9be475..bd80db16b 100644 --- a/rust/src/models/endpoint_updated_event.rs +++ b/rust/src/models/endpoint_updated_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_updated_event_data::EndpointUpdatedEventData; @@ -12,7 +15,13 @@ pub struct EndpointUpdatedEvent { } impl EndpointUpdatedEvent { - pub fn new(data: EndpointUpdatedEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: EndpointUpdatedEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/endpoint_updated_event_data.rs b/rust/src/models/endpoint_updated_event_data.rs index 508f8ad5b..4c02292ba 100644 --- a/rust/src/models/endpoint_updated_event_data.rs +++ b/rust/src/models/endpoint_updated_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Sent when an endpoint is created, updated, or deleted #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -24,7 +27,10 @@ pub struct EndpointUpdatedEventData { } impl EndpointUpdatedEventData { - pub fn new(app_id: String, endpoint_id: String) -> Self { + pub fn new( + app_id: String, + endpoint_id: String, + ) -> Self { Self { app_id, app_uid: None, diff --git a/rust/src/models/environment_in.rs b/rust/src/models/environment_in.rs index af54bdac9..cf2749b5e 100644 --- a/rust/src/models/environment_in.rs +++ b/rust/src/models/environment_in.rs @@ -1,7 +1,13 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; -use super::{connector_in::ConnectorIn, event_type_in::EventTypeIn}; +use super::{ + connector_in::ConnectorIn, + event_type_in::EventTypeIn, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EnvironmentIn { diff --git a/rust/src/models/environment_out.rs b/rust/src/models/environment_out.rs index 54b8d77e4..5bdb25842 100644 --- a/rust/src/models/environment_out.rs +++ b/rust/src/models/environment_out.rs @@ -1,7 +1,13 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; -use super::{connector_out::ConnectorOut, event_type_out::EventTypeOut}; +use super::{ + connector_out::ConnectorOut, + event_type_out::EventTypeOut, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EnvironmentOut { diff --git a/rust/src/models/event_example_in.rs b/rust/src/models/event_example_in.rs index ee99fc5c0..5122eadb8 100644 --- a/rust/src/models/event_example_in.rs +++ b/rust/src/models/event_example_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventExampleIn { diff --git a/rust/src/models/event_in.rs b/rust/src/models/event_in.rs index e6fd67e28..e9bacb4b7 100644 --- a/rust/src/models/event_in.rs +++ b/rust/src/models/event_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventIn { @@ -11,7 +14,10 @@ pub struct EventIn { } impl EventIn { - pub fn new(event_type: String, payload: String) -> Self { + pub fn new( + event_type: String, + payload: String, + ) -> Self { Self { event_type, payload, diff --git a/rust/src/models/event_out.rs b/rust/src/models/event_out.rs index 00d4ea5a0..55104779b 100644 --- a/rust/src/models/event_out.rs +++ b/rust/src/models/event_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventOut { @@ -13,7 +16,11 @@ pub struct EventOut { } impl EventOut { - pub fn new(event_type: String, payload: String, timestamp: String) -> Self { + pub fn new( + event_type: String, + payload: String, + timestamp: String, + ) -> Self { Self { event_type, payload, diff --git a/rust/src/models/event_stream_out.rs b/rust/src/models/event_stream_out.rs index b85d9192e..a25746528 100644 --- a/rust/src/models/event_stream_out.rs +++ b/rust/src/models/event_stream_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::event_out::EventOut; @@ -13,7 +16,11 @@ pub struct EventStreamOut { } impl EventStreamOut { - pub fn new(data: Vec, done: bool, iterator: String) -> Self { + pub fn new( + data: Vec, + done: bool, + iterator: String, + ) -> Self { Self { data, done, diff --git a/rust/src/models/event_type_from_open_api.rs b/rust/src/models/event_type_from_open_api.rs index 47e74b62a..6f29039ed 100644 --- a/rust/src/models/event_type_from_open_api.rs +++ b/rust/src/models/event_type_from_open_api.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventTypeFromOpenApi { @@ -29,7 +32,11 @@ pub struct EventTypeFromOpenApi { } impl EventTypeFromOpenApi { - pub fn new(deprecated: bool, description: String, name: String) -> Self { + pub fn new( + deprecated: bool, + description: String, + name: String, + ) -> Self { #[allow(deprecated)] Self { deprecated, diff --git a/rust/src/models/event_type_import_open_api_in.rs b/rust/src/models/event_type_import_open_api_in.rs index 34924b45a..7060c34e5 100644 --- a/rust/src/models/event_type_import_open_api_in.rs +++ b/rust/src/models/event_type_import_open_api_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Import a list of event types from webhooks defined in an OpenAPI spec. /// diff --git a/rust/src/models/event_type_import_open_api_out.rs b/rust/src/models/event_type_import_open_api_out.rs index fe14b871f..c0309c04d 100644 --- a/rust/src/models/event_type_import_open_api_out.rs +++ b/rust/src/models/event_type_import_open_api_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::event_type_import_open_api_out_data::EventTypeImportOpenApiOutData; @@ -10,6 +13,8 @@ pub struct EventTypeImportOpenApiOut { impl EventTypeImportOpenApiOut { pub fn new(data: EventTypeImportOpenApiOutData) -> Self { - Self { data } + Self { + 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 index 0e352b1a0..b3da44cf3 100644 --- a/rust/src/models/event_type_import_open_api_out_data.rs +++ b/rust/src/models/event_type_import_open_api_out_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::event_type_from_open_api::EventTypeFromOpenApi; diff --git a/rust/src/models/event_type_in.rs b/rust/src/models/event_type_in.rs index 62e054f28..b526badda 100644 --- a/rust/src/models/event_type_in.rs +++ b/rust/src/models/event_type_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventTypeIn { @@ -35,7 +38,10 @@ pub struct EventTypeIn { } impl EventTypeIn { - pub fn new(description: String, name: String) -> Self { + pub fn new( + description: String, + name: String, + ) -> Self { #[allow(deprecated)] Self { archived: None, diff --git a/rust/src/models/event_type_out.rs b/rust/src/models/event_type_out.rs index ef6874083..9505947fc 100644 --- a/rust/src/models/event_type_out.rs +++ b/rust/src/models/event_type_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventTypeOut { diff --git a/rust/src/models/event_type_patch.rs b/rust/src/models/event_type_patch.rs index de0d0f22e..dca097c05 100644 --- a/rust/src/models/event_type_patch.rs +++ b/rust/src/models/event_type_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventTypePatch { diff --git a/rust/src/models/event_type_update.rs b/rust/src/models/event_type_update.rs index a8ebb3157..74c152f2f 100644 --- a/rust/src/models/event_type_update.rs +++ b/rust/src/models/event_type_update.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EventTypeUpdate { diff --git a/rust/src/models/expunge_all_contents_out.rs b/rust/src/models/expunge_all_contents_out.rs index 678abbca3..0f54be9d6 100644 --- a/rust/src/models/expunge_all_contents_out.rs +++ b/rust/src/models/expunge_all_contents_out.rs @@ -1,8 +1,12 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - background_task_status::BackgroundTaskStatus, background_task_type::BackgroundTaskType, + background_task_status::BackgroundTaskStatus, + background_task_type::BackgroundTaskType, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -16,7 +20,15 @@ pub struct ExpungeAllContentsOut { } impl ExpungeAllContentsOut { - pub fn new(id: String, status: BackgroundTaskStatus, task: BackgroundTaskType) -> Self { - Self { id, status, task } + pub fn new( + id: String, + status: BackgroundTaskStatus, + task: BackgroundTaskType, + ) -> Self { + Self { + id, + status, + task, + } } } diff --git a/rust/src/models/github_config.rs b/rust/src/models/github_config.rs index e28754709..92d1af3fc 100644 --- a/rust/src/models/github_config.rs +++ b/rust/src/models/github_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct GithubConfig { @@ -9,6 +12,8 @@ pub struct GithubConfig { impl GithubConfig { pub fn new() -> Self { - Self { secret: None } + Self { + secret: None, + } } } diff --git a/rust/src/models/github_config_out.rs b/rust/src/models/github_config_out.rs index 93280a9a8..bfdaea24f 100644 --- a/rust/src/models/github_config_out.rs +++ b/rust/src/models/github_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct GithubConfigOut {} diff --git a/rust/src/models/google_cloud_storage_config.rs b/rust/src/models/google_cloud_storage_config.rs index 20cb35388..eec558bd8 100644 --- a/rust/src/models/google_cloud_storage_config.rs +++ b/rust/src/models/google_cloud_storage_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Configuration for a Google Cloud Storage sink. /// @@ -14,7 +17,10 @@ pub struct GoogleCloudStorageConfig { } impl GoogleCloudStorageConfig { - pub fn new(bucket: String, credentials: String) -> Self { + pub fn new( + bucket: String, + credentials: String, + ) -> Self { Self { bucket, credentials, diff --git a/rust/src/models/google_cloud_storage_patch_config.rs b/rust/src/models/google_cloud_storage_patch_config.rs index 2fa64ac9f..c75948668 100644 --- a/rust/src/models/google_cloud_storage_patch_config.rs +++ b/rust/src/models/google_cloud_storage_patch_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct GoogleCloudStoragePatchConfig { diff --git a/rust/src/models/http_error_out.rs b/rust/src/models/http_error_out.rs index f6f090d0d..d297178a0 100644 --- a/rust/src/models/http_error_out.rs +++ b/rust/src/models/http_error_out.rs @@ -11,7 +11,10 @@ #[allow(unused_imports)] use crate::models; #[allow(unused_imports)] -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct HttpErrorOut { @@ -22,7 +25,13 @@ pub struct HttpErrorOut { } impl HttpErrorOut { - pub fn new(code: String, detail: String) -> HttpErrorOut { - HttpErrorOut { code, detail } + pub fn new( + code: String, + detail: String, + ) -> HttpErrorOut { + HttpErrorOut { + code, + detail, + } } } diff --git a/rust/src/models/http_patch_config.rs b/rust/src/models/http_patch_config.rs index 7d2cf2d6c..4061b1886 100644 --- a/rust/src/models/http_patch_config.rs +++ b/rust/src/models/http_patch_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct HttpPatchConfig { @@ -9,6 +12,8 @@ pub struct HttpPatchConfig { impl HttpPatchConfig { pub fn new() -> Self { - Self { url: None } + Self { + url: None, + } } } diff --git a/rust/src/models/http_sink_headers_patch_in.rs b/rust/src/models/http_sink_headers_patch_in.rs index 7024ea610..95d340d13 100644 --- a/rust/src/models/http_sink_headers_patch_in.rs +++ b/rust/src/models/http_sink_headers_patch_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct HttpSinkHeadersPatchIn { @@ -8,6 +11,8 @@ pub struct HttpSinkHeadersPatchIn { impl HttpSinkHeadersPatchIn { pub fn new(headers: std::collections::HashMap) -> Self { - Self { headers } + Self { + headers, + } } } diff --git a/rust/src/models/http_validation_error.rs b/rust/src/models/http_validation_error.rs index ecc1f90ba..d7ec610d7 100644 --- a/rust/src/models/http_validation_error.rs +++ b/rust/src/models/http_validation_error.rs @@ -1,4 +1,7 @@ -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct HttpValidationError { @@ -8,6 +11,8 @@ pub struct HttpValidationError { impl HttpValidationError { pub fn new(detail: Vec) -> HttpValidationError { - HttpValidationError { detail } + HttpValidationError { + detail, + } } } diff --git a/rust/src/models/hubspot_config.rs b/rust/src/models/hubspot_config.rs index f1ff6785f..249b3e3dc 100644 --- a/rust/src/models/hubspot_config.rs +++ b/rust/src/models/hubspot_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct HubspotConfig { @@ -9,6 +12,8 @@ pub struct HubspotConfig { impl HubspotConfig { pub fn new() -> Self { - Self { secret: None } + Self { + secret: None, + } } } diff --git a/rust/src/models/hubspot_config_out.rs b/rust/src/models/hubspot_config_out.rs index 4a0a38fea..6eb791e0e 100644 --- a/rust/src/models/hubspot_config_out.rs +++ b/rust/src/models/hubspot_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct HubspotConfigOut {} diff --git a/rust/src/models/ingest_endpoint_disabled_event.rs b/rust/src/models/ingest_endpoint_disabled_event.rs index 34b5f9229..40116b461 100644 --- a/rust/src/models/ingest_endpoint_disabled_event.rs +++ b/rust/src/models/ingest_endpoint_disabled_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::ingest_endpoint_disabled_event_data::IngestEndpointDisabledEventData; @@ -13,7 +16,13 @@ pub struct IngestEndpointDisabledEvent { } impl IngestEndpointDisabledEvent { - pub fn new(data: IngestEndpointDisabledEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: IngestEndpointDisabledEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/ingest_endpoint_disabled_event_data.rs b/rust/src/models/ingest_endpoint_disabled_event_data.rs index b0731afe1..2b8161845 100644 --- a/rust/src/models/ingest_endpoint_disabled_event_data.rs +++ b/rust/src/models/ingest_endpoint_disabled_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_disabled_trigger::EndpointDisabledTrigger; @@ -29,7 +32,10 @@ pub struct IngestEndpointDisabledEventData { } impl IngestEndpointDisabledEventData { - pub fn new(endpoint_id: String, source_id: String) -> Self { + pub fn new( + endpoint_id: String, + source_id: String, + ) -> Self { Self { endpoint_id, endpoint_uid: None, diff --git a/rust/src/models/ingest_endpoint_headers_in.rs b/rust/src/models/ingest_endpoint_headers_in.rs index cfd90a9de..298deb07f 100644 --- a/rust/src/models/ingest_endpoint_headers_in.rs +++ b/rust/src/models/ingest_endpoint_headers_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointHeadersIn { @@ -8,6 +11,8 @@ pub struct IngestEndpointHeadersIn { impl IngestEndpointHeadersIn { pub fn new(headers: std::collections::HashMap) -> Self { - Self { headers } + Self { + headers, + } } } diff --git a/rust/src/models/ingest_endpoint_headers_out.rs b/rust/src/models/ingest_endpoint_headers_out.rs index a77b8162c..bd74d1439 100644 --- a/rust/src/models/ingest_endpoint_headers_out.rs +++ b/rust/src/models/ingest_endpoint_headers_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointHeadersOut { @@ -9,7 +12,13 @@ pub struct IngestEndpointHeadersOut { } impl IngestEndpointHeadersOut { - pub fn new(headers: std::collections::HashMap, sensitive: Vec) -> Self { - Self { headers, sensitive } + pub fn new( + headers: std::collections::HashMap, + sensitive: Vec, + ) -> Self { + Self { + headers, + sensitive, + } } } diff --git a/rust/src/models/ingest_endpoint_in.rs b/rust/src/models/ingest_endpoint_in.rs index d61e7629a..e72ff7a95 100644 --- a/rust/src/models/ingest_endpoint_in.rs +++ b/rust/src/models/ingest_endpoint_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointIn { diff --git a/rust/src/models/ingest_endpoint_out.rs b/rust/src/models/ingest_endpoint_out.rs index 242683455..986ea3b90 100644 --- a/rust/src/models/ingest_endpoint_out.rs +++ b/rust/src/models/ingest_endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointOut { diff --git a/rust/src/models/ingest_endpoint_secret_in.rs b/rust/src/models/ingest_endpoint_secret_in.rs index 1cec12c68..fe14b415d 100644 --- a/rust/src/models/ingest_endpoint_secret_in.rs +++ b/rust/src/models/ingest_endpoint_secret_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointSecretIn { @@ -14,6 +17,8 @@ pub struct IngestEndpointSecretIn { impl IngestEndpointSecretIn { pub fn new() -> Self { - Self { key: None } + Self { + key: None, + } } } diff --git a/rust/src/models/ingest_endpoint_secret_out.rs b/rust/src/models/ingest_endpoint_secret_out.rs index 1c8bef3ab..7ae6647e5 100644 --- a/rust/src/models/ingest_endpoint_secret_out.rs +++ b/rust/src/models/ingest_endpoint_secret_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointSecretOut { @@ -13,6 +16,8 @@ pub struct IngestEndpointSecretOut { impl IngestEndpointSecretOut { pub fn new(key: String) -> Self { - Self { key } + Self { + key, + } } } diff --git a/rust/src/models/ingest_endpoint_transformation_out.rs b/rust/src/models/ingest_endpoint_transformation_out.rs index 10cfb111d..ea190e2d1 100644 --- a/rust/src/models/ingest_endpoint_transformation_out.rs +++ b/rust/src/models/ingest_endpoint_transformation_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointTransformationOut { diff --git a/rust/src/models/ingest_endpoint_transformation_patch.rs b/rust/src/models/ingest_endpoint_transformation_patch.rs index 7a67fc811..cdba62fad 100644 --- a/rust/src/models/ingest_endpoint_transformation_patch.rs +++ b/rust/src/models/ingest_endpoint_transformation_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointTransformationPatch { diff --git a/rust/src/models/ingest_endpoint_update.rs b/rust/src/models/ingest_endpoint_update.rs index 6950b83b7..239a6fe21 100644 --- a/rust/src/models/ingest_endpoint_update.rs +++ b/rust/src/models/ingest_endpoint_update.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestEndpointUpdate { diff --git a/rust/src/models/ingest_message_attempt_exhausted_event.rs b/rust/src/models/ingest_message_attempt_exhausted_event.rs index c79e611f3..8c0712c62 100644 --- a/rust/src/models/ingest_message_attempt_exhausted_event.rs +++ b/rust/src/models/ingest_message_attempt_exhausted_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::ingest_message_attempt_exhausted_event_data::IngestMessageAttemptExhaustedEventData; @@ -13,7 +16,13 @@ pub struct IngestMessageAttemptExhaustedEvent { } impl IngestMessageAttemptExhaustedEvent { - pub fn new(data: IngestMessageAttemptExhaustedEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: IngestMessageAttemptExhaustedEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/ingest_message_attempt_exhausted_event_data.rs b/rust/src/models/ingest_message_attempt_exhausted_event_data.rs index bfc7bdfbd..bf578ef57 100644 --- a/rust/src/models/ingest_message_attempt_exhausted_event_data.rs +++ b/rust/src/models/ingest_message_attempt_exhausted_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_failed_data::MessageAttemptFailedData; diff --git a/rust/src/models/ingest_message_attempt_failing_event.rs b/rust/src/models/ingest_message_attempt_failing_event.rs index 6c318d087..39f4564d0 100644 --- a/rust/src/models/ingest_message_attempt_failing_event.rs +++ b/rust/src/models/ingest_message_attempt_failing_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::ingest_message_attempt_failing_event_data::IngestMessageAttemptFailingEventData; @@ -14,7 +17,13 @@ pub struct IngestMessageAttemptFailingEvent { } impl IngestMessageAttemptFailingEvent { - pub fn new(data: IngestMessageAttemptFailingEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: IngestMessageAttemptFailingEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/ingest_message_attempt_failing_event_data.rs b/rust/src/models/ingest_message_attempt_failing_event_data.rs index 1664e3a9c..fbb5634ae 100644 --- a/rust/src/models/ingest_message_attempt_failing_event_data.rs +++ b/rust/src/models/ingest_message_attempt_failing_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_failed_data::MessageAttemptFailedData; diff --git a/rust/src/models/ingest_message_attempt_recovered_event.rs b/rust/src/models/ingest_message_attempt_recovered_event.rs index 9c2409e98..420377849 100644 --- a/rust/src/models/ingest_message_attempt_recovered_event.rs +++ b/rust/src/models/ingest_message_attempt_recovered_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::ingest_message_attempt_recovered_event_data::IngestMessageAttemptRecoveredEventData; @@ -13,7 +16,13 @@ pub struct IngestMessageAttemptRecoveredEvent { } impl IngestMessageAttemptRecoveredEvent { - pub fn new(data: IngestMessageAttemptRecoveredEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: IngestMessageAttemptRecoveredEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/ingest_message_attempt_recovered_event_data.rs b/rust/src/models/ingest_message_attempt_recovered_event_data.rs index 6da56a07a..d842be880 100644 --- a/rust/src/models/ingest_message_attempt_recovered_event_data.rs +++ b/rust/src/models/ingest_message_attempt_recovered_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_failed_data::MessageAttemptFailedData; diff --git a/rust/src/models/ingest_source_consumer_portal_access_in.rs b/rust/src/models/ingest_source_consumer_portal_access_in.rs index a390586cd..9ced5676e 100644 --- a/rust/src/models/ingest_source_consumer_portal_access_in.rs +++ b/rust/src/models/ingest_source_consumer_portal_access_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IngestSourceConsumerPortalAccessIn { diff --git a/rust/src/models/ingest_source_in.rs b/rust/src/models/ingest_source_in.rs index 758ced51f..3da865e00 100644 --- a/rust/src/models/ingest_source_in.rs +++ b/rust/src/models/ingest_source_in.rs @@ -1,14 +1,30 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - adobe_sign_config::AdobeSignConfig, airwallex_config::AirwallexConfig, - checkbook_config::CheckbookConfig, cron_config::CronConfig, docusign_config::DocusignConfig, - easypost_config::EasypostConfig, github_config::GithubConfig, hubspot_config::HubspotConfig, - orum_io_config::OrumIoConfig, panda_doc_config::PandaDocConfig, port_io_config::PortIoConfig, - rutter_config::RutterConfig, segment_config::SegmentConfig, shopify_config::ShopifyConfig, - slack_config::SlackConfig, stripe_config::StripeConfig, svix_config::SvixConfig, - telnyx_config::TelnyxConfig, vapi_config::VapiConfig, veriff_config::VeriffConfig, + adobe_sign_config::AdobeSignConfig, + airwallex_config::AirwallexConfig, + checkbook_config::CheckbookConfig, + cron_config::CronConfig, + docusign_config::DocusignConfig, + easypost_config::EasypostConfig, + github_config::GithubConfig, + hubspot_config::HubspotConfig, + orum_io_config::OrumIoConfig, + panda_doc_config::PandaDocConfig, + port_io_config::PortIoConfig, + rutter_config::RutterConfig, + segment_config::SegmentConfig, + shopify_config::ShopifyConfig, + slack_config::SlackConfig, + stripe_config::StripeConfig, + svix_config::SvixConfig, + telnyx_config::TelnyxConfig, + vapi_config::VapiConfig, + veriff_config::VeriffConfig, zoom_config::ZoomConfig, }; diff --git a/rust/src/models/ingest_source_out.rs b/rust/src/models/ingest_source_out.rs index 0b41ce5ba..23d56b772 100644 --- a/rust/src/models/ingest_source_out.rs +++ b/rust/src/models/ingest_source_out.rs @@ -1,17 +1,30 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - adobe_sign_config_out::AdobeSignConfigOut, airwallex_config_out::AirwallexConfigOut, - checkbook_config_out::CheckbookConfigOut, cron_config::CronConfig, - docusign_config_out::DocusignConfigOut, easypost_config_out::EasypostConfigOut, - github_config_out::GithubConfigOut, hubspot_config_out::HubspotConfigOut, - orum_io_config_out::OrumIoConfigOut, panda_doc_config_out::PandaDocConfigOut, - port_io_config_out::PortIoConfigOut, rutter_config_out::RutterConfigOut, - segment_config_out::SegmentConfigOut, shopify_config_out::ShopifyConfigOut, - slack_config_out::SlackConfigOut, stripe_config_out::StripeConfigOut, - svix_config_out::SvixConfigOut, telnyx_config_out::TelnyxConfigOut, - vapi_config_out::VapiConfigOut, veriff_config_out::VeriffConfigOut, + adobe_sign_config_out::AdobeSignConfigOut, + airwallex_config_out::AirwallexConfigOut, + checkbook_config_out::CheckbookConfigOut, + cron_config::CronConfig, + docusign_config_out::DocusignConfigOut, + easypost_config_out::EasypostConfigOut, + github_config_out::GithubConfigOut, + hubspot_config_out::HubspotConfigOut, + orum_io_config_out::OrumIoConfigOut, + panda_doc_config_out::PandaDocConfigOut, + port_io_config_out::PortIoConfigOut, + rutter_config_out::RutterConfigOut, + segment_config_out::SegmentConfigOut, + shopify_config_out::ShopifyConfigOut, + slack_config_out::SlackConfigOut, + stripe_config_out::StripeConfigOut, + svix_config_out::SvixConfigOut, + telnyx_config_out::TelnyxConfigOut, + vapi_config_out::VapiConfigOut, + veriff_config_out::VeriffConfigOut, zoom_config_out::ZoomConfigOut, }; diff --git a/rust/src/models/integration_in.rs b/rust/src/models/integration_in.rs index 31d792edf..1ccbd3c00 100644 --- a/rust/src/models/integration_in.rs +++ b/rust/src/models/integration_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IntegrationIn { diff --git a/rust/src/models/integration_key_out.rs b/rust/src/models/integration_key_out.rs index e9c3bd969..cccfa4ca7 100644 --- a/rust/src/models/integration_key_out.rs +++ b/rust/src/models/integration_key_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IntegrationKeyOut { @@ -8,6 +11,8 @@ pub struct IntegrationKeyOut { impl IntegrationKeyOut { pub fn new(key: String) -> Self { - Self { key } + Self { + key, + } } } diff --git a/rust/src/models/integration_out.rs b/rust/src/models/integration_out.rs index 6dafc862e..c57a6c6af 100644 --- a/rust/src/models/integration_out.rs +++ b/rust/src/models/integration_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IntegrationOut { @@ -21,7 +24,12 @@ pub struct IntegrationOut { } impl IntegrationOut { - pub fn new(created_at: String, id: String, name: String, updated_at: String) -> Self { + pub fn new( + created_at: String, + id: String, + name: String, + updated_at: String, + ) -> Self { Self { created_at, feature_flags: None, diff --git a/rust/src/models/integration_update.rs b/rust/src/models/integration_update.rs index fe0ac6801..49d9e29bd 100644 --- a/rust/src/models/integration_update.rs +++ b/rust/src/models/integration_update.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct IntegrationUpdate { diff --git a/rust/src/models/list_response_application_out.rs b/rust/src/models/list_response_application_out.rs index 7a22165a6..c8d51ddc5 100644 --- a/rust/src/models/list_response_application_out.rs +++ b/rust/src/models/list_response_application_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::application_out::ApplicationOut; @@ -18,7 +21,10 @@ pub struct ListResponseApplicationOut { } impl ListResponseApplicationOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_background_task_out.rs b/rust/src/models/list_response_background_task_out.rs index 1167f085e..a56ff9094 100644 --- a/rust/src/models/list_response_background_task_out.rs +++ b/rust/src/models/list_response_background_task_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::background_task_out::BackgroundTaskOut; @@ -18,7 +21,10 @@ pub struct ListResponseBackgroundTaskOut { } impl ListResponseBackgroundTaskOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_connector_out.rs b/rust/src/models/list_response_connector_out.rs index 6fc6047ce..4effaf8da 100644 --- a/rust/src/models/list_response_connector_out.rs +++ b/rust/src/models/list_response_connector_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::connector_out::ConnectorOut; @@ -18,7 +21,10 @@ pub struct ListResponseConnectorOut { } impl ListResponseConnectorOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_endpoint_message_out.rs b/rust/src/models/list_response_endpoint_message_out.rs index 7423bdfea..9de24b6b4 100644 --- a/rust/src/models/list_response_endpoint_message_out.rs +++ b/rust/src/models/list_response_endpoint_message_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_message_out::EndpointMessageOut; @@ -18,7 +21,10 @@ pub struct ListResponseEndpointMessageOut { } impl ListResponseEndpointMessageOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_endpoint_out.rs b/rust/src/models/list_response_endpoint_out.rs index 659438ed2..2d8d8710a 100644 --- a/rust/src/models/list_response_endpoint_out.rs +++ b/rust/src/models/list_response_endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::endpoint_out::EndpointOut; @@ -18,7 +21,10 @@ pub struct ListResponseEndpointOut { } impl ListResponseEndpointOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_event_type_out.rs b/rust/src/models/list_response_event_type_out.rs index f19b1daab..49a64cb46 100644 --- a/rust/src/models/list_response_event_type_out.rs +++ b/rust/src/models/list_response_event_type_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::event_type_out::EventTypeOut; @@ -18,7 +21,10 @@ pub struct ListResponseEventTypeOut { } impl ListResponseEventTypeOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_ingest_endpoint_out.rs b/rust/src/models/list_response_ingest_endpoint_out.rs index 24274ab79..99a13daf5 100644 --- a/rust/src/models/list_response_ingest_endpoint_out.rs +++ b/rust/src/models/list_response_ingest_endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::ingest_endpoint_out::IngestEndpointOut; @@ -18,7 +21,10 @@ pub struct ListResponseIngestEndpointOut { } impl ListResponseIngestEndpointOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_ingest_source_out.rs b/rust/src/models/list_response_ingest_source_out.rs index d63fe2981..4012d9c1f 100644 --- a/rust/src/models/list_response_ingest_source_out.rs +++ b/rust/src/models/list_response_ingest_source_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::ingest_source_out::IngestSourceOut; @@ -18,7 +21,10 @@ pub struct ListResponseIngestSourceOut { } impl ListResponseIngestSourceOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_integration_out.rs b/rust/src/models/list_response_integration_out.rs index 370654cad..3ee497885 100644 --- a/rust/src/models/list_response_integration_out.rs +++ b/rust/src/models/list_response_integration_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::integration_out::IntegrationOut; @@ -18,7 +21,10 @@ pub struct ListResponseIntegrationOut { } impl ListResponseIntegrationOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_message_attempt_endpoint_out.rs b/rust/src/models/list_response_message_attempt_endpoint_out.rs index a91b6ee62..b27198f0e 100644 --- a/rust/src/models/list_response_message_attempt_endpoint_out.rs +++ b/rust/src/models/list_response_message_attempt_endpoint_out.rs @@ -1,4 +1,7 @@ -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_endpoint_out::MessageAttemptEndpointOut; @@ -16,7 +19,11 @@ pub struct ListResponseMessageAttemptEndpointOut { } impl ListResponseMessageAttemptEndpointOut { - pub fn new(data: Vec, done: bool, iterator: String) -> Self { + pub fn new( + data: Vec, + done: bool, + iterator: String, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_message_attempt_out.rs b/rust/src/models/list_response_message_attempt_out.rs index 0c546e19e..02918ca66 100644 --- a/rust/src/models/list_response_message_attempt_out.rs +++ b/rust/src/models/list_response_message_attempt_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_out::MessageAttemptOut; @@ -18,7 +21,10 @@ pub struct ListResponseMessageAttemptOut { } impl ListResponseMessageAttemptOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_message_endpoint_out.rs b/rust/src/models/list_response_message_endpoint_out.rs index 04e7fe987..f45bae20e 100644 --- a/rust/src/models/list_response_message_endpoint_out.rs +++ b/rust/src/models/list_response_message_endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_endpoint_out::MessageEndpointOut; @@ -18,7 +21,10 @@ pub struct ListResponseMessageEndpointOut { } impl ListResponseMessageEndpointOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_message_out.rs b/rust/src/models/list_response_message_out.rs index 9c3d678fa..54b7bf80a 100644 --- a/rust/src/models/list_response_message_out.rs +++ b/rust/src/models/list_response_message_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_out::MessageOut; @@ -18,7 +21,10 @@ pub struct ListResponseMessageOut { } impl ListResponseMessageOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_operational_webhook_endpoint_out.rs b/rust/src/models/list_response_operational_webhook_endpoint_out.rs index db7e39be7..8ea2204ba 100644 --- a/rust/src/models/list_response_operational_webhook_endpoint_out.rs +++ b/rust/src/models/list_response_operational_webhook_endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::operational_webhook_endpoint_out::OperationalWebhookEndpointOut; @@ -18,7 +21,10 @@ pub struct ListResponseOperationalWebhookEndpointOut { } impl ListResponseOperationalWebhookEndpointOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_stream_event_type_out.rs b/rust/src/models/list_response_stream_event_type_out.rs index 67ed7a22d..d3b39f267 100644 --- a/rust/src/models/list_response_stream_event_type_out.rs +++ b/rust/src/models/list_response_stream_event_type_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::stream_event_type_out::StreamEventTypeOut; @@ -18,7 +21,10 @@ pub struct ListResponseStreamEventTypeOut { } impl ListResponseStreamEventTypeOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_stream_out.rs b/rust/src/models/list_response_stream_out.rs index 767a7787a..97f8e3d8a 100644 --- a/rust/src/models/list_response_stream_out.rs +++ b/rust/src/models/list_response_stream_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::stream_out::StreamOut; @@ -18,7 +21,10 @@ pub struct ListResponseStreamOut { } impl ListResponseStreamOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/list_response_stream_sink_out.rs b/rust/src/models/list_response_stream_sink_out.rs index ab79dc06b..6d78a09ad 100644 --- a/rust/src/models/list_response_stream_sink_out.rs +++ b/rust/src/models/list_response_stream_sink_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::stream_sink_out::StreamSinkOut; @@ -18,7 +21,10 @@ pub struct ListResponseStreamSinkOut { } impl ListResponseStreamSinkOut { - pub fn new(data: Vec, done: bool) -> Self { + pub fn new( + data: Vec, + done: bool, + ) -> Self { Self { data, done, diff --git a/rust/src/models/message_attempt_endpoint_out.rs b/rust/src/models/message_attempt_endpoint_out.rs index 96b938bc7..623162158 100644 --- a/rust/src/models/message_attempt_endpoint_out.rs +++ b/rust/src/models/message_attempt_endpoint_out.rs @@ -1,7 +1,11 @@ -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - message_attempt_trigger_type::MessageAttemptTriggerType, message_out::MessageOut, + message_attempt_trigger_type::MessageAttemptTriggerType, + message_out::MessageOut, message_status::MessageStatus, }; diff --git a/rust/src/models/message_attempt_exhausted_event.rs b/rust/src/models/message_attempt_exhausted_event.rs index 802faf28c..0bcf6e5d8 100644 --- a/rust/src/models/message_attempt_exhausted_event.rs +++ b/rust/src/models/message_attempt_exhausted_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_exhausted_event_data::MessageAttemptExhaustedEventData; @@ -13,7 +16,13 @@ pub struct MessageAttemptExhaustedEvent { } impl MessageAttemptExhaustedEvent { - pub fn new(data: MessageAttemptExhaustedEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: MessageAttemptExhaustedEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/message_attempt_exhausted_event_data.rs b/rust/src/models/message_attempt_exhausted_event_data.rs index d74a78b46..9d2028dee 100644 --- a/rust/src/models/message_attempt_exhausted_event_data.rs +++ b/rust/src/models/message_attempt_exhausted_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_failed_data::MessageAttemptFailedData; diff --git a/rust/src/models/message_attempt_failed_data.rs b/rust/src/models/message_attempt_failed_data.rs index f37be84ed..03aeb0455 100644 --- a/rust/src/models/message_attempt_failed_data.rs +++ b/rust/src/models/message_attempt_failed_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct MessageAttemptFailedData { @@ -13,7 +16,11 @@ pub struct MessageAttemptFailedData { } impl MessageAttemptFailedData { - pub fn new(id: String, response_status_code: i16, timestamp: String) -> Self { + pub fn new( + id: String, + response_status_code: i16, + timestamp: String, + ) -> Self { Self { id, response_status_code, diff --git a/rust/src/models/message_attempt_failing_event.rs b/rust/src/models/message_attempt_failing_event.rs index 06a82a5c6..841175b53 100644 --- a/rust/src/models/message_attempt_failing_event.rs +++ b/rust/src/models/message_attempt_failing_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_failing_event_data::MessageAttemptFailingEventData; @@ -14,7 +17,13 @@ pub struct MessageAttemptFailingEvent { } impl MessageAttemptFailingEvent { - pub fn new(data: MessageAttemptFailingEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: MessageAttemptFailingEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/message_attempt_failing_event_data.rs b/rust/src/models/message_attempt_failing_event_data.rs index 5fc841ea6..f40499939 100644 --- a/rust/src/models/message_attempt_failing_event_data.rs +++ b/rust/src/models/message_attempt_failing_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_failed_data::MessageAttemptFailedData; diff --git a/rust/src/models/message_attempt_out.rs b/rust/src/models/message_attempt_out.rs index a2dd24831..de440f656 100644 --- a/rust/src/models/message_attempt_out.rs +++ b/rust/src/models/message_attempt_out.rs @@ -1,9 +1,14 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - message_attempt_trigger_type::MessageAttemptTriggerType, message_out::MessageOut, - message_status::MessageStatus, message_status_text::MessageStatusText, + message_attempt_trigger_type::MessageAttemptTriggerType, + message_out::MessageOut, + message_status::MessageStatus, + message_status_text::MessageStatusText, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] diff --git a/rust/src/models/message_attempt_recovered_event.rs b/rust/src/models/message_attempt_recovered_event.rs index af711b8bd..1998d2698 100644 --- a/rust/src/models/message_attempt_recovered_event.rs +++ b/rust/src/models/message_attempt_recovered_event.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_recovered_event_data::MessageAttemptRecoveredEventData; @@ -13,7 +16,13 @@ pub struct MessageAttemptRecoveredEvent { } impl MessageAttemptRecoveredEvent { - pub fn new(data: MessageAttemptRecoveredEventData, r#type: String) -> Self { - Self { data, r#type } + pub fn new( + data: MessageAttemptRecoveredEventData, + r#type: String, + ) -> Self { + Self { + data, + r#type, + } } } diff --git a/rust/src/models/message_attempt_recovered_event_data.rs b/rust/src/models/message_attempt_recovered_event_data.rs index 385d7a8e7..357193df3 100644 --- a/rust/src/models/message_attempt_recovered_event_data.rs +++ b/rust/src/models/message_attempt_recovered_event_data.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::message_attempt_failed_data::MessageAttemptFailedData; diff --git a/rust/src/models/message_attempt_trigger_type.rs b/rust/src/models/message_attempt_trigger_type.rs index aa90491aa..ccfae29f6 100644 --- a/rust/src/models/message_attempt_trigger_type.rs +++ b/rust/src/models/message_attempt_trigger_type.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde_repr::{Deserialize_repr, Serialize_repr}; +use serde_repr::{ + Deserialize_repr, + Serialize_repr, +}; /// The reason an attempt was made: /// @@ -28,7 +31,14 @@ pub enum MessageAttemptTriggerType { } impl fmt::Display for MessageAttemptTriggerType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", *self as i64) + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { + write!( + f, + "{}", + *self as i64 + ) } } diff --git a/rust/src/models/message_endpoint_out.rs b/rust/src/models/message_endpoint_out.rs index 8965111a1..b162efd11 100644 --- a/rust/src/models/message_endpoint_out.rs +++ b/rust/src/models/message_endpoint_out.rs @@ -1,7 +1,13 @@ // this file is @generated -use serde::{Deserialize, Serialize}; - -use super::{message_status::MessageStatus, message_status_text::MessageStatusText}; +use serde::{ + Deserialize, + Serialize, +}; + +use super::{ + message_status::MessageStatus, + message_status_text::MessageStatusText, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct MessageEndpointOut { diff --git a/rust/src/models/message_events_out.rs b/rust/src/models/message_events_out.rs index 993a7326e..abfe71ee1 100644 --- a/rust/src/models/message_events_out.rs +++ b/rust/src/models/message_events_out.rs @@ -1,4 +1,7 @@ -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct MessageEventsOut { @@ -8,7 +11,11 @@ pub struct MessageEventsOut { } impl MessageEventsOut { - pub fn new(data: Vec, done: bool, iterator: String) -> MessageEventsOut { + pub fn new( + data: Vec, + done: bool, + iterator: String, + ) -> MessageEventsOut { MessageEventsOut { data, done, diff --git a/rust/src/models/message_in.rs b/rust/src/models/message_in.rs index 60fb0b752..243634517 100644 --- a/rust/src/models/message_in.rs +++ b/rust/src/models/message_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::application_in::ApplicationIn; @@ -64,7 +67,10 @@ pub struct MessageIn { } impl MessageIn { - pub fn new(event_type: String, payload: serde_json::Value) -> Self { + pub fn new( + event_type: String, + payload: serde_json::Value, + ) -> Self { Self { application: None, channels: None, diff --git a/rust/src/models/message_out.rs b/rust/src/models/message_out.rs index 00f91507f..13172e3ca 100644 --- a/rust/src/models/message_out.rs +++ b/rust/src/models/message_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct MessageOut { diff --git a/rust/src/models/message_status.rs b/rust/src/models/message_status.rs index aa09cf5b6..6d8881a33 100644 --- a/rust/src/models/message_status.rs +++ b/rust/src/models/message_status.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde_repr::{Deserialize_repr, Serialize_repr}; +use serde_repr::{ + Deserialize_repr, + Serialize_repr, +}; /// The sending status of the message: /// @@ -32,7 +35,14 @@ pub enum MessageStatus { } impl fmt::Display for MessageStatus { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", *self as i64) + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { + write!( + f, + "{}", + *self as i64 + ) } } diff --git a/rust/src/models/message_status_text.rs b/rust/src/models/message_status_text.rs index eb0781713..c8372bbaa 100644 --- a/rust/src/models/message_status_text.rs +++ b/rust/src/models/message_status_text.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -19,7 +22,10 @@ pub enum MessageStatusText { } impl fmt::Display for MessageStatusText { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::Success => "success", Self::Pending => "pending", diff --git a/rust/src/models/mod.rs b/rust/src/models/mod.rs index 154014cee..f4a46f423 100644 --- a/rust/src/models/mod.rs +++ b/rust/src/models/mod.rs @@ -320,8 +320,14 @@ pub use self::{ ingest_message_attempt_recovered_event::IngestMessageAttemptRecoveredEvent, ingest_message_attempt_recovered_event_data::IngestMessageAttemptRecoveredEventData, ingest_source_consumer_portal_access_in::IngestSourceConsumerPortalAccessIn, - ingest_source_in::{IngestSourceIn, IngestSourceInConfig}, - ingest_source_out::{IngestSourceOut, IngestSourceOutConfig}, + ingest_source_in::{ + IngestSourceIn, + IngestSourceInConfig, + }, + ingest_source_out::{ + IngestSourceOut, + IngestSourceOutConfig, + }, integration_in::IntegrationIn, integration_key_out::IntegrationKeyOut, integration_out::IntegrationOut, @@ -405,9 +411,18 @@ pub use self::{ stream_out::StreamOut, stream_patch::StreamPatch, stream_portal_access_in::StreamPortalAccessIn, - stream_sink_in::{StreamSinkIn, StreamSinkInConfig}, - stream_sink_out::{StreamSinkOut, StreamSinkOutConfig}, - stream_sink_patch::{StreamSinkPatch, StreamSinkPatchConfig}, + stream_sink_in::{ + StreamSinkIn, + StreamSinkInConfig, + }, + stream_sink_out::{ + StreamSinkOut, + StreamSinkOutConfig, + }, + stream_sink_patch::{ + StreamSinkPatch, + StreamSinkPatchConfig, + }, stripe_config::StripeConfig, stripe_config_out::StripeConfigOut, svix_config::SvixConfig, @@ -424,8 +439,10 @@ pub use self::{ // not currently generated pub use self::{ - http_error_out::HttpErrorOut, http_validation_error::HttpValidationError, + http_error_out::HttpErrorOut, + http_validation_error::HttpValidationError, list_response_message_attempt_endpoint_out::ListResponseMessageAttemptEndpointOut, - message_attempt_endpoint_out::MessageAttemptEndpointOut, message_events_out::MessageEventsOut, + message_attempt_endpoint_out::MessageAttemptEndpointOut, + message_events_out::MessageEventsOut, validation_error::ValidationError, }; diff --git a/rust/src/models/operational_webhook_endpoint_headers_in.rs b/rust/src/models/operational_webhook_endpoint_headers_in.rs index 713c7cebf..f9edc47b2 100644 --- a/rust/src/models/operational_webhook_endpoint_headers_in.rs +++ b/rust/src/models/operational_webhook_endpoint_headers_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OperationalWebhookEndpointHeadersIn { @@ -8,6 +11,8 @@ pub struct OperationalWebhookEndpointHeadersIn { impl OperationalWebhookEndpointHeadersIn { pub fn new(headers: std::collections::HashMap) -> Self { - Self { headers } + Self { + headers, + } } } diff --git a/rust/src/models/operational_webhook_endpoint_headers_out.rs b/rust/src/models/operational_webhook_endpoint_headers_out.rs index 4e4fa3db0..d22644db8 100644 --- a/rust/src/models/operational_webhook_endpoint_headers_out.rs +++ b/rust/src/models/operational_webhook_endpoint_headers_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OperationalWebhookEndpointHeadersOut { @@ -9,7 +12,13 @@ pub struct OperationalWebhookEndpointHeadersOut { } impl OperationalWebhookEndpointHeadersOut { - pub fn new(headers: std::collections::HashMap, sensitive: Vec) -> Self { - Self { headers, sensitive } + pub fn new( + headers: std::collections::HashMap, + sensitive: Vec, + ) -> Self { + Self { + headers, + sensitive, + } } } diff --git a/rust/src/models/operational_webhook_endpoint_in.rs b/rust/src/models/operational_webhook_endpoint_in.rs index a9cbc93fc..4ada28462 100644 --- a/rust/src/models/operational_webhook_endpoint_in.rs +++ b/rust/src/models/operational_webhook_endpoint_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OperationalWebhookEndpointIn { diff --git a/rust/src/models/operational_webhook_endpoint_out.rs b/rust/src/models/operational_webhook_endpoint_out.rs index e09f98d46..ee9ae00f2 100644 --- a/rust/src/models/operational_webhook_endpoint_out.rs +++ b/rust/src/models/operational_webhook_endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OperationalWebhookEndpointOut { diff --git a/rust/src/models/operational_webhook_endpoint_secret_in.rs b/rust/src/models/operational_webhook_endpoint_secret_in.rs index 834b9e105..ba784d974 100644 --- a/rust/src/models/operational_webhook_endpoint_secret_in.rs +++ b/rust/src/models/operational_webhook_endpoint_secret_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OperationalWebhookEndpointSecretIn { @@ -14,6 +17,8 @@ pub struct OperationalWebhookEndpointSecretIn { impl OperationalWebhookEndpointSecretIn { pub fn new() -> Self { - Self { key: None } + Self { + key: None, + } } } diff --git a/rust/src/models/operational_webhook_endpoint_secret_out.rs b/rust/src/models/operational_webhook_endpoint_secret_out.rs index fc79a0387..a08cbeb9f 100644 --- a/rust/src/models/operational_webhook_endpoint_secret_out.rs +++ b/rust/src/models/operational_webhook_endpoint_secret_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OperationalWebhookEndpointSecretOut { @@ -13,6 +16,8 @@ pub struct OperationalWebhookEndpointSecretOut { impl OperationalWebhookEndpointSecretOut { pub fn new(key: String) -> Self { - Self { key } + Self { + key, + } } } diff --git a/rust/src/models/operational_webhook_endpoint_update.rs b/rust/src/models/operational_webhook_endpoint_update.rs index d9b9c0cc0..34ac42b97 100644 --- a/rust/src/models/operational_webhook_endpoint_update.rs +++ b/rust/src/models/operational_webhook_endpoint_update.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OperationalWebhookEndpointUpdate { diff --git a/rust/src/models/ordering.rs b/rust/src/models/ordering.rs index 31be71df3..ed1b8fb8f 100644 --- a/rust/src/models/ordering.rs +++ b/rust/src/models/ordering.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Defines the ordering in a listing of results. #[derive( @@ -16,7 +19,10 @@ pub enum Ordering { } impl fmt::Display for Ordering { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::Ascending => "ascending", Self::Descending => "descending", diff --git a/rust/src/models/orum_io_config.rs b/rust/src/models/orum_io_config.rs index 094ac5c8c..52c8339ff 100644 --- a/rust/src/models/orum_io_config.rs +++ b/rust/src/models/orum_io_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OrumIoConfig { @@ -9,6 +12,8 @@ pub struct OrumIoConfig { impl OrumIoConfig { pub fn new(public_key: String) -> Self { - Self { public_key } + Self { + public_key, + } } } diff --git a/rust/src/models/orum_io_config_out.rs b/rust/src/models/orum_io_config_out.rs index 336f10005..2c3730259 100644 --- a/rust/src/models/orum_io_config_out.rs +++ b/rust/src/models/orum_io_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OrumIoConfigOut { @@ -9,6 +12,8 @@ pub struct OrumIoConfigOut { impl OrumIoConfigOut { pub fn new(public_key: String) -> Self { - Self { public_key } + Self { + public_key, + } } } diff --git a/rust/src/models/otel_tracing_patch_config.rs b/rust/src/models/otel_tracing_patch_config.rs index 24bcdf499..182f9ba14 100644 --- a/rust/src/models/otel_tracing_patch_config.rs +++ b/rust/src/models/otel_tracing_patch_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct OtelTracingPatchConfig { @@ -9,6 +12,8 @@ pub struct OtelTracingPatchConfig { impl OtelTracingPatchConfig { pub fn new() -> Self { - Self { url: None } + Self { + url: None, + } } } diff --git a/rust/src/models/panda_doc_config.rs b/rust/src/models/panda_doc_config.rs index 636a2ae46..0c0cfe596 100644 --- a/rust/src/models/panda_doc_config.rs +++ b/rust/src/models/panda_doc_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct PandaDocConfig { @@ -8,6 +11,8 @@ pub struct PandaDocConfig { impl PandaDocConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/panda_doc_config_out.rs b/rust/src/models/panda_doc_config_out.rs index b4ac34c86..6d953c8ca 100644 --- a/rust/src/models/panda_doc_config_out.rs +++ b/rust/src/models/panda_doc_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct PandaDocConfigOut {} diff --git a/rust/src/models/polling_endpoint_consumer_seek_in.rs b/rust/src/models/polling_endpoint_consumer_seek_in.rs index 05d996d73..1df532968 100644 --- a/rust/src/models/polling_endpoint_consumer_seek_in.rs +++ b/rust/src/models/polling_endpoint_consumer_seek_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct PollingEndpointConsumerSeekIn { @@ -8,6 +11,8 @@ pub struct PollingEndpointConsumerSeekIn { impl PollingEndpointConsumerSeekIn { pub fn new(after: String) -> Self { - Self { after } + Self { + after, + } } } diff --git a/rust/src/models/polling_endpoint_consumer_seek_out.rs b/rust/src/models/polling_endpoint_consumer_seek_out.rs index b2bcdacf6..efe8b8767 100644 --- a/rust/src/models/polling_endpoint_consumer_seek_out.rs +++ b/rust/src/models/polling_endpoint_consumer_seek_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct PollingEndpointConsumerSeekOut { @@ -8,6 +11,8 @@ pub struct PollingEndpointConsumerSeekOut { impl PollingEndpointConsumerSeekOut { pub fn new(iterator: String) -> Self { - Self { iterator } + Self { + iterator, + } } } diff --git a/rust/src/models/polling_endpoint_message_out.rs b/rust/src/models/polling_endpoint_message_out.rs index f92e1a145..49f6182ce 100644 --- a/rust/src/models/polling_endpoint_message_out.rs +++ b/rust/src/models/polling_endpoint_message_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// The MessageOut equivalent of polling endpoint #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] diff --git a/rust/src/models/polling_endpoint_out.rs b/rust/src/models/polling_endpoint_out.rs index ced1f1187..fb7b7620f 100644 --- a/rust/src/models/polling_endpoint_out.rs +++ b/rust/src/models/polling_endpoint_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::polling_endpoint_message_out::PollingEndpointMessageOut; @@ -13,7 +16,11 @@ pub struct PollingEndpointOut { } impl PollingEndpointOut { - pub fn new(data: Vec, done: bool, iterator: String) -> Self { + pub fn new( + data: Vec, + done: bool, + iterator: String, + ) -> Self { Self { data, done, diff --git a/rust/src/models/port_io_config.rs b/rust/src/models/port_io_config.rs index 54808565f..1859a911c 100644 --- a/rust/src/models/port_io_config.rs +++ b/rust/src/models/port_io_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct PortIoConfig { @@ -8,6 +11,8 @@ pub struct PortIoConfig { impl PortIoConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/port_io_config_out.rs b/rust/src/models/port_io_config_out.rs index da35b1c52..840e15bac 100644 --- a/rust/src/models/port_io_config_out.rs +++ b/rust/src/models/port_io_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct PortIoConfigOut {} diff --git a/rust/src/models/recover_in.rs b/rust/src/models/recover_in.rs index d9e5b9528..233819202 100644 --- a/rust/src/models/recover_in.rs +++ b/rust/src/models/recover_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct RecoverIn { @@ -11,6 +14,9 @@ pub struct RecoverIn { impl RecoverIn { pub fn new(since: String) -> Self { - Self { since, until: None } + Self { + since, + until: None, + } } } diff --git a/rust/src/models/recover_out.rs b/rust/src/models/recover_out.rs index 445d4f78f..e0f471811 100644 --- a/rust/src/models/recover_out.rs +++ b/rust/src/models/recover_out.rs @@ -1,8 +1,12 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - background_task_status::BackgroundTaskStatus, background_task_type::BackgroundTaskType, + background_task_status::BackgroundTaskStatus, + background_task_type::BackgroundTaskType, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -16,7 +20,15 @@ pub struct RecoverOut { } impl RecoverOut { - pub fn new(id: String, status: BackgroundTaskStatus, task: BackgroundTaskType) -> Self { - Self { id, status, task } + pub fn new( + id: String, + status: BackgroundTaskStatus, + task: BackgroundTaskType, + ) -> Self { + Self { + id, + status, + task, + } } } diff --git a/rust/src/models/replay_in.rs b/rust/src/models/replay_in.rs index 311d27167..155d2dafe 100644 --- a/rust/src/models/replay_in.rs +++ b/rust/src/models/replay_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ReplayIn { @@ -11,6 +14,9 @@ pub struct ReplayIn { impl ReplayIn { pub fn new(since: String) -> Self { - Self { since, until: None } + Self { + since, + until: None, + } } } diff --git a/rust/src/models/replay_out.rs b/rust/src/models/replay_out.rs index fa9aac1f0..77fb2c802 100644 --- a/rust/src/models/replay_out.rs +++ b/rust/src/models/replay_out.rs @@ -1,8 +1,12 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ - background_task_status::BackgroundTaskStatus, background_task_type::BackgroundTaskType, + background_task_status::BackgroundTaskStatus, + background_task_type::BackgroundTaskType, }; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] @@ -16,7 +20,15 @@ pub struct ReplayOut { } impl ReplayOut { - pub fn new(id: String, status: BackgroundTaskStatus, task: BackgroundTaskType) -> Self { - Self { id, status, task } + pub fn new( + id: String, + status: BackgroundTaskStatus, + task: BackgroundTaskType, + ) -> Self { + Self { + id, + status, + task, + } } } diff --git a/rust/src/models/rotate_poller_token_in.rs b/rust/src/models/rotate_poller_token_in.rs index c428799af..04b15d259 100644 --- a/rust/src/models/rotate_poller_token_in.rs +++ b/rust/src/models/rotate_poller_token_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct RotatePollerTokenIn { diff --git a/rust/src/models/rotate_token_out.rs b/rust/src/models/rotate_token_out.rs index c0bcd7f00..81172ec97 100644 --- a/rust/src/models/rotate_token_out.rs +++ b/rust/src/models/rotate_token_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct RotateTokenOut { @@ -9,6 +12,8 @@ pub struct RotateTokenOut { impl RotateTokenOut { pub fn new(ingest_url: String) -> Self { - Self { ingest_url } + Self { + ingest_url, + } } } diff --git a/rust/src/models/rutter_config.rs b/rust/src/models/rutter_config.rs index 30c32758f..b2431a58e 100644 --- a/rust/src/models/rutter_config.rs +++ b/rust/src/models/rutter_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct RutterConfig { @@ -8,6 +11,8 @@ pub struct RutterConfig { impl RutterConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/rutter_config_out.rs b/rust/src/models/rutter_config_out.rs index f50375f30..d848a9234 100644 --- a/rust/src/models/rutter_config_out.rs +++ b/rust/src/models/rutter_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct RutterConfigOut {} diff --git a/rust/src/models/s3_config.rs b/rust/src/models/s3_config.rs index 2a6dcc7cd..b32a6ef71 100644 --- a/rust/src/models/s3_config.rs +++ b/rust/src/models/s3_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct S3Config { diff --git a/rust/src/models/segment_config.rs b/rust/src/models/segment_config.rs index bc692c1f1..2bbd3b01f 100644 --- a/rust/src/models/segment_config.rs +++ b/rust/src/models/segment_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SegmentConfig { @@ -9,6 +12,8 @@ pub struct SegmentConfig { impl SegmentConfig { pub fn new() -> Self { - Self { secret: None } + Self { + secret: None, + } } } diff --git a/rust/src/models/segment_config_out.rs b/rust/src/models/segment_config_out.rs index 1b0ca6ce5..fb1edc21c 100644 --- a/rust/src/models/segment_config_out.rs +++ b/rust/src/models/segment_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SegmentConfigOut {} diff --git a/rust/src/models/shopify_config.rs b/rust/src/models/shopify_config.rs index 93ac695ed..e45d2e838 100644 --- a/rust/src/models/shopify_config.rs +++ b/rust/src/models/shopify_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ShopifyConfig { @@ -8,6 +11,8 @@ pub struct ShopifyConfig { impl ShopifyConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/shopify_config_out.rs b/rust/src/models/shopify_config_out.rs index fca4bbc6f..1d4a9716b 100644 --- a/rust/src/models/shopify_config_out.rs +++ b/rust/src/models/shopify_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ShopifyConfigOut {} diff --git a/rust/src/models/sink_http_config.rs b/rust/src/models/sink_http_config.rs index 2fb26137d..3c009912e 100644 --- a/rust/src/models/sink_http_config.rs +++ b/rust/src/models/sink_http_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SinkHttpConfig { diff --git a/rust/src/models/sink_otel_v1_config.rs b/rust/src/models/sink_otel_v1_config.rs index c32e8013d..d01b98ff8 100644 --- a/rust/src/models/sink_otel_v1_config.rs +++ b/rust/src/models/sink_otel_v1_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SinkOtelV1Config { @@ -11,6 +14,9 @@ pub struct SinkOtelV1Config { impl SinkOtelV1Config { pub fn new(url: String) -> Self { - Self { headers: None, url } + Self { + headers: None, + url, + } } } diff --git a/rust/src/models/sink_secret_out.rs b/rust/src/models/sink_secret_out.rs index 9d2be4985..e1d5d5e9a 100644 --- a/rust/src/models/sink_secret_out.rs +++ b/rust/src/models/sink_secret_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SinkSecretOut { @@ -14,6 +17,8 @@ pub struct SinkSecretOut { impl SinkSecretOut { pub fn new() -> Self { - Self { key: None } + Self { + key: None, + } } } diff --git a/rust/src/models/sink_status.rs b/rust/src/models/sink_status.rs index 188d35eda..d7bc4b53d 100644 --- a/rust/src/models/sink_status.rs +++ b/rust/src/models/sink_status.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -19,7 +22,10 @@ pub enum SinkStatus { } impl fmt::Display for SinkStatus { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::Enabled => "enabled", Self::Paused => "paused", diff --git a/rust/src/models/sink_status_in.rs b/rust/src/models/sink_status_in.rs index ffdeb6d22..4fb497491 100644 --- a/rust/src/models/sink_status_in.rs +++ b/rust/src/models/sink_status_in.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive( Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, @@ -15,7 +18,10 @@ pub enum SinkStatusIn { } impl fmt::Display for SinkStatusIn { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { let value = match self { Self::Enabled => "enabled", Self::Disabled => "disabled", diff --git a/rust/src/models/sink_transform_in.rs b/rust/src/models/sink_transform_in.rs index a20a47deb..8aeda3a41 100644 --- a/rust/src/models/sink_transform_in.rs +++ b/rust/src/models/sink_transform_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SinkTransformIn { @@ -9,6 +12,8 @@ pub struct SinkTransformIn { impl SinkTransformIn { pub fn new() -> Self { - Self { code: None } + Self { + code: None, + } } } diff --git a/rust/src/models/sink_transformation_out.rs b/rust/src/models/sink_transformation_out.rs index 698b97d5f..c9252abb1 100644 --- a/rust/src/models/sink_transformation_out.rs +++ b/rust/src/models/sink_transformation_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SinkTransformationOut { diff --git a/rust/src/models/slack_config.rs b/rust/src/models/slack_config.rs index dc39dfa79..1986bc691 100644 --- a/rust/src/models/slack_config.rs +++ b/rust/src/models/slack_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SlackConfig { @@ -8,6 +11,8 @@ pub struct SlackConfig { impl SlackConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/slack_config_out.rs b/rust/src/models/slack_config_out.rs index 938917095..bdc612eda 100644 --- a/rust/src/models/slack_config_out.rs +++ b/rust/src/models/slack_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SlackConfigOut {} diff --git a/rust/src/models/status_code_class.rs b/rust/src/models/status_code_class.rs index 925a74324..98a0d1078 100644 --- a/rust/src/models/status_code_class.rs +++ b/rust/src/models/status_code_class.rs @@ -1,7 +1,10 @@ // this file is @generated use std::fmt; -use serde_repr::{Deserialize_repr, Serialize_repr}; +use serde_repr::{ + Deserialize_repr, + Serialize_repr, +}; /// The different classes of HTTP status codes: /// @@ -36,7 +39,14 @@ pub enum StatusCodeClass { } impl fmt::Display for StatusCodeClass { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", *self as i64) + fn fmt( + &self, + f: &mut fmt::Formatter, + ) -> fmt::Result { + write!( + f, + "{}", + *self as i64 + ) } } diff --git a/rust/src/models/stream_event_type_in.rs b/rust/src/models/stream_event_type_in.rs index 1d7324899..7ada1b44c 100644 --- a/rust/src/models/stream_event_type_in.rs +++ b/rust/src/models/stream_event_type_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StreamEventTypeIn { diff --git a/rust/src/models/stream_event_type_out.rs b/rust/src/models/stream_event_type_out.rs index 188bdfc2d..0a5040218 100644 --- a/rust/src/models/stream_event_type_out.rs +++ b/rust/src/models/stream_event_type_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StreamEventTypeOut { diff --git a/rust/src/models/stream_event_type_patch.rs b/rust/src/models/stream_event_type_patch.rs index a188dcd25..4c949dc39 100644 --- a/rust/src/models/stream_event_type_patch.rs +++ b/rust/src/models/stream_event_type_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StreamEventTypePatch { diff --git a/rust/src/models/stream_in.rs b/rust/src/models/stream_in.rs index d93a861d7..f34b6f8d1 100644 --- a/rust/src/models/stream_in.rs +++ b/rust/src/models/stream_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StreamIn { diff --git a/rust/src/models/stream_out.rs b/rust/src/models/stream_out.rs index bb6569beb..91378e1d6 100644 --- a/rust/src/models/stream_out.rs +++ b/rust/src/models/stream_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StreamOut { diff --git a/rust/src/models/stream_patch.rs b/rust/src/models/stream_patch.rs index 3f2cdaab7..5df8447c7 100644 --- a/rust/src/models/stream_patch.rs +++ b/rust/src/models/stream_patch.rs @@ -1,6 +1,9 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StreamPatch { diff --git a/rust/src/models/stream_portal_access_in.rs b/rust/src/models/stream_portal_access_in.rs index 9880dfb4b..d531a4275 100644 --- a/rust/src/models/stream_portal_access_in.rs +++ b/rust/src/models/stream_portal_access_in.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StreamPortalAccessIn { diff --git a/rust/src/models/stream_sink_in.rs b/rust/src/models/stream_sink_in.rs index 2b0f9bdb7..b2262835c 100644 --- a/rust/src/models/stream_sink_in.rs +++ b/rust/src/models/stream_sink_in.rs @@ -1,10 +1,15 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ azure_blob_storage_config::AzureBlobStorageConfig, - google_cloud_storage_config::GoogleCloudStorageConfig, s3_config::S3Config, - sink_http_config::SinkHttpConfig, sink_otel_v1_config::SinkOtelV1Config, + google_cloud_storage_config::GoogleCloudStorageConfig, + s3_config::S3Config, + sink_http_config::SinkHttpConfig, + sink_otel_v1_config::SinkOtelV1Config, sink_status_in::SinkStatusIn, }; diff --git a/rust/src/models/stream_sink_out.rs b/rust/src/models/stream_sink_out.rs index e901167cb..39e80c397 100644 --- a/rust/src/models/stream_sink_out.rs +++ b/rust/src/models/stream_sink_out.rs @@ -1,10 +1,15 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ azure_blob_storage_config::AzureBlobStorageConfig, - google_cloud_storage_config::GoogleCloudStorageConfig, s3_config::S3Config, - sink_http_config::SinkHttpConfig, sink_otel_v1_config::SinkOtelV1Config, + google_cloud_storage_config::GoogleCloudStorageConfig, + s3_config::S3Config, + sink_http_config::SinkHttpConfig, + sink_otel_v1_config::SinkOtelV1Config, sink_status::SinkStatus, }; diff --git a/rust/src/models/stream_sink_patch.rs b/rust/src/models/stream_sink_patch.rs index eef4f16a6..3f4949e15 100644 --- a/rust/src/models/stream_sink_patch.rs +++ b/rust/src/models/stream_sink_patch.rs @@ -1,12 +1,16 @@ // this file is @generated use js_option::JsOption; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; use super::{ amazon_s3_patch_config::AmazonS3PatchConfig, azure_blob_storage_patch_config::AzureBlobStoragePatchConfig, google_cloud_storage_patch_config::GoogleCloudStoragePatchConfig, - http_patch_config::HttpPatchConfig, otel_tracing_patch_config::OtelTracingPatchConfig, + http_patch_config::HttpPatchConfig, + otel_tracing_patch_config::OtelTracingPatchConfig, sink_status_in::SinkStatusIn, }; diff --git a/rust/src/models/stripe_config.rs b/rust/src/models/stripe_config.rs index b7f343b86..3f825c82b 100644 --- a/rust/src/models/stripe_config.rs +++ b/rust/src/models/stripe_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StripeConfig { @@ -8,6 +11,8 @@ pub struct StripeConfig { impl StripeConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/stripe_config_out.rs b/rust/src/models/stripe_config_out.rs index 4e1d7d5b0..8f44d9017 100644 --- a/rust/src/models/stripe_config_out.rs +++ b/rust/src/models/stripe_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct StripeConfigOut {} diff --git a/rust/src/models/svix_config.rs b/rust/src/models/svix_config.rs index ac1aaf80f..df23f8c28 100644 --- a/rust/src/models/svix_config.rs +++ b/rust/src/models/svix_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SvixConfig { @@ -8,6 +11,8 @@ pub struct SvixConfig { impl SvixConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/svix_config_out.rs b/rust/src/models/svix_config_out.rs index 160f35d6a..df0c84870 100644 --- a/rust/src/models/svix_config_out.rs +++ b/rust/src/models/svix_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct SvixConfigOut {} diff --git a/rust/src/models/telnyx_config.rs b/rust/src/models/telnyx_config.rs index 74aba6125..0958eb31b 100644 --- a/rust/src/models/telnyx_config.rs +++ b/rust/src/models/telnyx_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct TelnyxConfig { @@ -9,6 +12,8 @@ pub struct TelnyxConfig { impl TelnyxConfig { pub fn new(public_key: String) -> Self { - Self { public_key } + Self { + public_key, + } } } diff --git a/rust/src/models/telnyx_config_out.rs b/rust/src/models/telnyx_config_out.rs index b88793ac0..d8db5169c 100644 --- a/rust/src/models/telnyx_config_out.rs +++ b/rust/src/models/telnyx_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct TelnyxConfigOut { @@ -9,6 +12,8 @@ pub struct TelnyxConfigOut { impl TelnyxConfigOut { pub fn new(public_key: String) -> Self { - Self { public_key } + Self { + public_key, + } } } diff --git a/rust/src/models/validation_error.rs b/rust/src/models/validation_error.rs index 52d8fff42..d4459f12d 100644 --- a/rust/src/models/validation_error.rs +++ b/rust/src/models/validation_error.rs @@ -1,4 +1,7 @@ -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; /// Validation errors have their own schema to provide context /// for invalid requests eg. mismatched types and out of bounds values. There @@ -20,7 +23,15 @@ 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 } + pub fn new( + loc: Vec, + msg: String, + r#type: String, + ) -> ValidationError { + ValidationError { + loc, + msg, + r#type, + } } } diff --git a/rust/src/models/vapi_config.rs b/rust/src/models/vapi_config.rs index 8fba30700..a1003019b 100644 --- a/rust/src/models/vapi_config.rs +++ b/rust/src/models/vapi_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct VapiConfig { @@ -8,6 +11,8 @@ pub struct VapiConfig { impl VapiConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/vapi_config_out.rs b/rust/src/models/vapi_config_out.rs index 2790e1653..5cffed9b4 100644 --- a/rust/src/models/vapi_config_out.rs +++ b/rust/src/models/vapi_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct VapiConfigOut {} diff --git a/rust/src/models/veriff_config.rs b/rust/src/models/veriff_config.rs index 100127d60..b7c19bc59 100644 --- a/rust/src/models/veriff_config.rs +++ b/rust/src/models/veriff_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct VeriffConfig { @@ -8,6 +11,8 @@ pub struct VeriffConfig { impl VeriffConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/veriff_config_out.rs b/rust/src/models/veriff_config_out.rs index 0e3183406..02ad260fa 100644 --- a/rust/src/models/veriff_config_out.rs +++ b/rust/src/models/veriff_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct VeriffConfigOut {} diff --git a/rust/src/models/zoom_config.rs b/rust/src/models/zoom_config.rs index 748a87ab6..8c507a8b1 100644 --- a/rust/src/models/zoom_config.rs +++ b/rust/src/models/zoom_config.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ZoomConfig { @@ -8,6 +11,8 @@ pub struct ZoomConfig { impl ZoomConfig { pub fn new(secret: String) -> Self { - Self { secret } + Self { + secret, + } } } diff --git a/rust/src/models/zoom_config_out.rs b/rust/src/models/zoom_config_out.rs index aef6f7bdd..f13d1aff7 100644 --- a/rust/src/models/zoom_config_out.rs +++ b/rust/src/models/zoom_config_out.rs @@ -1,5 +1,8 @@ // this file is @generated -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ZoomConfigOut {} diff --git a/rust/src/request.rs b/rust/src/request.rs index 09f31243d..b1a7504ec 100644 --- a/rust/src/request.rs +++ b/rust/src/request.rs @@ -1,17 +1,37 @@ // Modified version of the file openapi-generator would usually put in // apis/request.rs -use std::{collections::HashMap, time::Duration}; - -use http1::header::{HeaderValue, AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, USER_AGENT}; -use http_body_util::{BodyExt as _, Full}; +use std::{ + collections::HashMap, + time::Duration, +}; + +use http1::header::{ + HeaderValue, + AUTHORIZATION, + CONTENT_LENGTH, + CONTENT_TYPE, + USER_AGENT, +}; +use http_body_util::{ + BodyExt as _, + Full, +}; use hyper::body::Bytes; use itertools::Itertools as _; -use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS}; +use percent_encoding::{ + utf8_percent_encode, + AsciiSet, + CONTROLS, +}; use rand::Rng; use serde::de::DeserializeOwned; -use crate::{error::Error, models, Configuration}; +use crate::{ + error::Error, + models, + Configuration, +}; #[allow(dead_code)] pub(crate) enum Auth { @@ -35,7 +55,10 @@ pub(crate) struct Request { } impl Request { - pub fn new(method: http1::Method, path: &'static str) -> Self { + pub fn new( + method: http1::Method, + path: &'static str, + ) -> Self { Request { method, path, @@ -47,7 +70,10 @@ impl Request { } } - pub fn with_body_param(mut self, param: T) -> Self { + pub fn with_body_param( + mut self, + param: T, + ) -> Self { self.serialized_body = Some(serde_json::to_string(¶m).unwrap()); self } @@ -58,13 +84,22 @@ impl Request { param: Option, ) -> Self { if let Some(value) = param { - self.header_params.insert(basename, value); + self.header_params.insert( + basename, value, + ); } self } - pub fn with_query_param(mut self, basename: &'static str, param: impl QueryParamValue) -> Self { - self.query_params.insert(basename, param.encode()); + pub fn with_query_param( + mut self, + basename: &'static str, + param: impl QueryParamValue, + ) -> Self { + self.query_params.insert( + basename, + param.encode(), + ); self } @@ -74,13 +109,22 @@ impl Request { param: Option, ) -> Self { if let Some(value) = param { - self.query_params.insert(basename, value.encode()); + self.query_params.insert( + basename, + value.encode(), + ); } self } - pub fn with_path_param(mut self, basename: &'static str, param: String) -> Self { - self.path_params.insert(basename, param); + pub fn with_path_param( + mut self, + basename: &'static str, + param: String, + ) -> Self { + self.path_params.insert( + basename, param, + ); self } @@ -89,7 +133,10 @@ impl Request { self } - pub async fn execute(self, conf: &Configuration) -> Result { + pub async fn execute( + self, + conf: &Configuration, + ) -> Result { match self.execute_with_backoff(conf).await? { // This is a hack; if there's no_ret_type, T is (), but serde_json gives an // error when deserializing "" into (), so deserialize 'null' into it @@ -102,30 +149,40 @@ impl Request { } } - async fn execute_with_backoff(mut self, conf: &Configuration) -> Result, Error> { + async fn execute_with_backoff( + mut self, + conf: &Configuration, + ) -> Result, Error> { let no_return_type = self.no_return_type; if self.method == http1::Method::POST && !self.header_params.contains_key("idempotency-key") { - self.header_params - .insert("idempotency-key", format!("auto_{}", uuid::Uuid::new_v4())); + self.header_params.insert( + "idempotency-key", + format!( + "auto_{}", + uuid::Uuid::new_v4() + ), + ); } const MAX_BACKOFF: Duration = Duration::from_secs(5); let retry_schedule = match &conf.retry_schedule { Some(schedule) => schedule, - None => &std::iter::successors(Some(Duration::from_millis(20)), |last_backoff| { - Some(MAX_BACKOFF.min(*last_backoff * 2)) - }) + None => &std::iter::successors( + Some(Duration::from_millis(20)), + |last_backoff| Some(MAX_BACKOFF.min(*last_backoff * 2)), + ) .take(conf.num_retries as usize) .collect(), }; let mut retries = retry_schedule.iter(); let mut request = self.build_request(conf)?; - request - .headers_mut() - .insert("svix-req-id", rand::rng().random::().into()); + request.headers_mut().insert( + "svix-req-id", + rand::rng().random::().into(), + ); let mut retry_count = 0; @@ -134,7 +191,13 @@ impl Request { let status = response.status(); if !status.is_success() { - Err(Error::from_response(status, response.into_body()).await) + Err( + Error::from_response( + status, + response.into_body(), + ) + .await, + ) } else if no_return_type { Ok(None) } else { @@ -151,9 +214,12 @@ impl Request { loop { let request_fut = execute_request(request.clone()); let res = if let Some(duration) = conf.timeout { - tokio::time::timeout(duration, request_fut) - .await - .map_err(Error::generic)? + tokio::time::timeout( + duration, + request_fut, + ) + .await + .map_err(Error::generic)? } else { request_fut.await }; @@ -174,13 +240,17 @@ impl Request { tokio::time::sleep(next_backoff.expect("next_backoff is always Some")).await; retry_count += 1; - request - .headers_mut() - .insert("svix-retry-count", retry_count.into()); + request.headers_mut().insert( + "svix-retry-count", + retry_count.into(), + ); } } - fn build_request(self, conf: &Configuration) -> Result>, Error> { + fn build_request( + self, + conf: &Configuration, + ) -> Result>, Error> { const FRAGMENT: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b'<').add(b'>').add(b'`'); const PATH: &AsciiSet = &FRAGMENT.add(b'#').add(b'?').add(b'{').add(b'}'); const PATH_SEGMENT: &AsciiSet = &PATH.add(b'/').add(b'%'); @@ -188,16 +258,27 @@ impl Request { let mut path = self.path.to_owned(); for (k, v) in self.path_params { // replace {id} with the value of the id path param - let percent_encoded_path_param_value = - utf8_percent_encode(&v, PATH_SEGMENT).to_string(); - path = path.replace(&format!("{{{k}}}"), &percent_encoded_path_param_value); + let percent_encoded_path_param_value = utf8_percent_encode( + &v, + PATH_SEGMENT, + ) + .to_string(); + path = path.replace( + &format!("{{{k}}}"), + &percent_encoded_path_param_value, + ); } - let mut uri = format!("{}{}", conf.base_path, path); + let mut uri = format!( + "{}{}", + conf.base_path, path + ); let mut query_string = url::form_urlencoded::Serializer::new("".to_owned()); for (key, val) in self.query_params { - query_string.append_pair(key, &val); + query_string.append_pair( + key, &val, + ); } let query_string_str = query_string.finish(); @@ -211,8 +292,14 @@ impl Request { let mut request = if let Some(body) = self.serialized_body { let req_headers = req_builder.headers_mut().unwrap(); - req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); - req_headers.insert(CONTENT_LENGTH, body.len().into()); + req_headers.insert( + CONTENT_TYPE, + HeaderValue::from_static("application/json"), + ); + req_headers.insert( + CONTENT_LENGTH, + body.len().into(), + ); req_builder.body(Full::from(body)).map_err(Error::generic)? } else { req_builder.body(Full::default()).map_err(Error::generic)? @@ -232,7 +319,10 @@ impl Request { let value = format!("Bearer {token}") .try_into() .map_err(Error::generic)?; - request_headers.insert(AUTHORIZATION, value); + request_headers.insert( + AUTHORIZATION, + value, + ); } } Auth::None => {} @@ -240,12 +330,16 @@ impl Request { if let Some(user_agent) = &conf.user_agent { let value = user_agent.try_into().map_err(Error::generic)?; - request_headers.insert(USER_AGENT, value); + request_headers.insert( + USER_AGENT, value, + ); } for (k, v) in self.header_params { let v = v.try_into().map_err(Error::generic)?; - request_headers.insert(k, v); + request_headers.insert( + k, v, + ); } Ok(request) diff --git a/rust/src/webhooks.rs b/rust/src/webhooks.rs index 7442dd5af..c2c7cecdb 100644 --- a/rust/src/webhooks.rs +++ b/rust/src/webhooks.rs @@ -49,15 +49,29 @@ impl Webhook { let secret = secret.strip_prefix(PREFIX).unwrap_or(secret); let key = base64::decode(secret)?; - Ok(Webhook { key }) + Ok( + Webhook { + key, + }, + ) } pub fn from_bytes(secret: Vec) -> Result { - Ok(Webhook { key: secret }) + Ok( + Webhook { + key: secret, + }, + ) } - pub fn verify(&self, payload: &[u8], headers: &HM) -> Result<(), WebhookError> { - self.verify_inner(payload, headers, /* enforce_tolerance */ true) + pub fn verify( + &self, + payload: &[u8], + headers: &HM, + ) -> Result<(), WebhookError> { + self.verify_inner( + payload, headers, /* enforce_tolerance */ true, + ) } pub fn verify_ignoring_timestamp( @@ -65,7 +79,9 @@ impl Webhook { payload: &[u8], headers: &HM, ) -> Result<(), WebhookError> { - self.verify_inner(payload, headers, /* enforce_tolerance */ false) + self.verify_inner( + payload, headers, /* enforce_tolerance */ false, + ) } fn verify_inner( @@ -74,7 +90,12 @@ impl Webhook { headers: &HM, enforce_tolerance: bool, ) -> Result<(), WebhookError> { - let msg_id = Self::get_header(headers, SVIX_MSG_ID_KEY, UNBRANDED_MSG_ID_KEY, "id")?; + let msg_id = Self::get_header( + headers, + SVIX_MSG_ID_KEY, + UNBRANDED_MSG_ID_KEY, + "id", + )?; let msg_signature = Self::get_header( headers, SVIX_MSG_SIGNATURE_KEY, @@ -93,7 +114,9 @@ impl Webhook { Self::verify_timestamp(msg_ts)?; } - let versioned_signature = self.sign(msg_id, msg_ts, payload)?; + let versioned_signature = self.sign( + msg_id, msg_ts, payload, + )?; let expected_signature = versioned_signature .split_once(',') .map(|x| x.1) @@ -103,15 +126,15 @@ impl Webhook { .split(' ') .filter_map(|x| x.split_once(',')) .filter(|x| x.0 == SIGNATURE_VERSION) - .any(|x| { - (x.1.len() == expected_signature.len()) - && (x - .1 - .bytes() - .zip(expected_signature.bytes()) - .fold(0, |acc, (a, b)| acc | (a ^ b)) - == 0) - }) + .any( + |x| { + (x.1.len() == expected_signature.len()) + && (x.1.bytes().zip(expected_signature.bytes()).fold( + 0, + |acc, (a, b)| acc | (a ^ b), + ) == 0) + }, + ) .then_some(()) .ok_or(WebhookError::InvalidSignature) } @@ -124,7 +147,10 @@ impl Webhook { ) -> Result { let payload = std::str::from_utf8(payload).map_err(|_| WebhookError::InvalidPayload)?; let to_sign = format!("{msg_id}.{timestamp}.{payload}",); - let signed = hmac_sha256::HMAC::mac(to_sign.as_bytes(), &self.key); + let signed = hmac_sha256::HMAC::mac( + to_sign.as_bytes(), + &self.key, + ); let encoded = base64::encode(signed); Ok(format!("{SIGNATURE_VERSION},{encoded}")) @@ -172,18 +198,27 @@ impl HeaderMap for http1::HeaderMap {} mod private { pub trait HeaderMapSealed { type HeaderValue: HeaderValueSealed; - fn _get(&self, name: &str) -> Option<&Self::HeaderValue>; + fn _get( + &self, + name: &str, + ) -> Option<&Self::HeaderValue>; } impl HeaderMapSealed for http02::HeaderMap { type HeaderValue = http02::HeaderValue; - fn _get(&self, name: &str) -> Option<&Self::HeaderValue> { + fn _get( + &self, + name: &str, + ) -> Option<&Self::HeaderValue> { self.get(name) } } impl HeaderMapSealed for http1::HeaderMap { type HeaderValue = http1::HeaderValue; - fn _get(&self, name: &str) -> Option<&Self::HeaderValue> { + fn _get( + &self, + name: &str, + ) -> Option<&Self::HeaderValue> { self.get(name) } } @@ -210,14 +245,28 @@ mod tests { use time::OffsetDateTime; use super::{ - Webhook, SVIX_MSG_ID_KEY, SVIX_MSG_SIGNATURE_KEY, SVIX_MSG_TIMESTAMP_KEY, - UNBRANDED_MSG_ID_KEY, UNBRANDED_MSG_SIGNATURE_KEY, UNBRANDED_MSG_TIMESTAMP_KEY, + Webhook, + SVIX_MSG_ID_KEY, + SVIX_MSG_SIGNATURE_KEY, + SVIX_MSG_TIMESTAMP_KEY, + UNBRANDED_MSG_ID_KEY, + UNBRANDED_MSG_SIGNATURE_KEY, + UNBRANDED_MSG_TIMESTAMP_KEY, }; - fn get_svix_headers(msg_id: &str, signature: &str) -> HeaderMap { + fn get_svix_headers( + msg_id: &str, + signature: &str, + ) -> HeaderMap { let mut headers = HeaderMap::new(); - headers.insert(SVIX_MSG_ID_KEY, msg_id.parse().unwrap()); - headers.insert(SVIX_MSG_SIGNATURE_KEY, signature.parse().unwrap()); + headers.insert( + SVIX_MSG_ID_KEY, + msg_id.parse().unwrap(), + ); + headers.insert( + SVIX_MSG_SIGNATURE_KEY, + signature.parse().unwrap(), + ); headers.insert( SVIX_MSG_TIMESTAMP_KEY, OffsetDateTime::now_utc() @@ -229,10 +278,19 @@ mod tests { headers } - fn get_unbranded_headers(msg_id: &str, signature: &str) -> HeaderMap { + fn get_unbranded_headers( + msg_id: &str, + signature: &str, + ) -> HeaderMap { let mut headers = HeaderMap::new(); - headers.insert(UNBRANDED_MSG_ID_KEY, msg_id.parse().unwrap()); - headers.insert(UNBRANDED_MSG_SIGNATURE_KEY, signature.parse().unwrap()); + headers.insert( + UNBRANDED_MSG_ID_KEY, + msg_id.parse().unwrap(), + ); + headers.insert( + UNBRANDED_MSG_SIGNATURE_KEY, + signature.parse().unwrap(), + ); headers.insert( UNBRANDED_MSG_TIMESTAMP_KEY, OffsetDateTime::now_utc() @@ -266,13 +324,24 @@ mod tests { let wh = Webhook::new(&secret).unwrap(); let signature = wh - .sign(msg_id, OffsetDateTime::now_utc().unix_timestamp(), payload) + .sign( + msg_id, + OffsetDateTime::now_utc().unix_timestamp(), + payload, + ) .unwrap(); for headers in [ - get_svix_headers(msg_id, &signature), - get_unbranded_headers(msg_id, &signature), + get_svix_headers( + msg_id, &signature, + ), + get_unbranded_headers( + msg_id, &signature, + ), ] { - wh.verify(payload, &headers).unwrap(); + wh.verify( + payload, &headers, + ) + .unwrap(); } } @@ -285,8 +354,12 @@ mod tests { let signature = "v1,R3PTzyfHASBKHH98a7yexTwaJ4yNIcGhFQc1yuN+BPU=".to_owned(); for headers in [ - get_svix_headers(msg_id, &signature), - get_unbranded_headers(msg_id, &signature), + get_svix_headers( + msg_id, &signature, + ), + get_unbranded_headers( + msg_id, &signature, + ), ] { assert!(wh.verify(payload, &headers).is_err()); } @@ -300,31 +373,55 @@ mod tests { let wh = Webhook::new(&secret).unwrap(); let signature = wh - .sign(msg_id, OffsetDateTime::now_utc().unix_timestamp(), payload) + .sign( + msg_id, + OffsetDateTime::now_utc().unix_timestamp(), + payload, + ) .unwrap(); // Just `v1,` for mut headers in [ - get_svix_headers(msg_id, &signature), - get_unbranded_headers(msg_id, &signature), + get_svix_headers( + msg_id, &signature, + ), + get_unbranded_headers( + msg_id, &signature, + ), ] { let partial = format!( "{},", signature.split(',').collect::>().first().unwrap() ); - headers.insert(SVIX_MSG_SIGNATURE_KEY, partial.parse().unwrap()); - headers.insert(UNBRANDED_MSG_SIGNATURE_KEY, partial.parse().unwrap()); + headers.insert( + SVIX_MSG_SIGNATURE_KEY, + partial.parse().unwrap(), + ); + headers.insert( + UNBRANDED_MSG_SIGNATURE_KEY, + partial.parse().unwrap(), + ); assert!(wh.verify(payload, &headers).is_err()); } // Non-empty but still partial signature (first few bytes) for mut headers in [ - get_svix_headers(msg_id, &signature), - get_unbranded_headers(msg_id, &signature), + get_svix_headers( + msg_id, &signature, + ), + get_unbranded_headers( + msg_id, &signature, + ), ] { let partial = &signature[0..8]; - headers.insert(SVIX_MSG_SIGNATURE_KEY, partial.parse().unwrap()); - headers.insert(UNBRANDED_MSG_SIGNATURE_KEY, partial.parse().unwrap()); + headers.insert( + SVIX_MSG_SIGNATURE_KEY, + partial.parse().unwrap(), + ); + headers.insert( + UNBRANDED_MSG_SIGNATURE_KEY, + partial.parse().unwrap(), + ); assert!(wh.verify(payload, &headers).is_err()); } } @@ -342,8 +439,14 @@ mod tests { OffsetDateTime::now_utc().unix_timestamp() - (super::TOLERANCE_IN_SECONDS + 1), OffsetDateTime::now_utc().unix_timestamp() + (super::TOLERANCE_IN_SECONDS + 1), ] { - let signature = wh.sign(msg_id, ts, payload).unwrap(); - let mut headers = get_svix_headers(msg_id, &signature); + let signature = wh + .sign( + msg_id, ts, payload, + ) + .unwrap(); + let mut headers = get_svix_headers( + msg_id, &signature, + ); headers.insert( super::SVIX_MSG_TIMESTAMP_KEY, ts.to_string().parse().unwrap(), @@ -355,8 +458,14 @@ mod tests { } let ts = OffsetDateTime::now_utc().unix_timestamp(); - let signature = wh.sign(msg_id, ts, payload).unwrap(); - let mut headers = get_svix_headers(msg_id, &signature); + let signature = wh + .sign( + msg_id, ts, payload, + ) + .unwrap(); + let mut headers = get_svix_headers( + msg_id, &signature, + ); headers.insert( super::SVIX_MSG_TIMESTAMP_KEY, // Timestamp mismatch! @@ -377,7 +486,11 @@ mod tests { let wh = Webhook::new(&secret).unwrap(); let signature = wh - .sign(msg_id, OffsetDateTime::now_utc().unix_timestamp(), payload) + .sign( + msg_id, + OffsetDateTime::now_utc().unix_timestamp(), + payload, + ) .unwrap(); let multi_sig = format!( @@ -388,9 +501,14 @@ mod tests { "v1,9DfC1c3eeOrXB6w/5dIDydLNQaEyww5KalE5jLBZucE=", ); - let headers = get_svix_headers(msg_id, &multi_sig); + let headers = get_svix_headers( + msg_id, &multi_sig, + ); - wh.verify(payload, &headers).unwrap(); + wh.verify( + payload, &headers, + ) + .unwrap(); } #[test] @@ -407,7 +525,10 @@ mod tests { "v1,9DfC1c3eeOrXB6w/5dIDydLNQaEyww5KalE5jLBZucE=", ); - let headers = get_svix_headers(msg_id, &missing_sig); + let headers = get_svix_headers( + msg_id, + &missing_sig, + ); assert!(wh.verify(payload, &headers).is_err()); } @@ -420,11 +541,17 @@ mod tests { let wh = Webhook::new(&secret).unwrap(); let signature = wh - .sign(msg_id, OffsetDateTime::now_utc().unix_timestamp(), payload) + .sign( + msg_id, + OffsetDateTime::now_utc().unix_timestamp(), + payload, + ) .unwrap(); for (mut hdr_map, hdrs) in [ ( - get_svix_headers(msg_id, &signature), + get_svix_headers( + msg_id, &signature, + ), [ SVIX_MSG_ID_KEY, SVIX_MSG_SIGNATURE_KEY, @@ -432,7 +559,9 @@ mod tests { ], ), ( - get_unbranded_headers(msg_id, &signature), + get_unbranded_headers( + msg_id, &signature, + ), [ UNBRANDED_MSG_ID_KEY, UNBRANDED_MSG_SIGNATURE_KEY, diff --git a/rust/tests/it/kitchen_sink.rs b/rust/tests/it/kitchen_sink.rs index 661c2f309..52c5bacc7 100644 --- a/rust/tests/it/kitchen_sink.rs +++ b/rust/tests/it/kitchen_sink.rs @@ -1,10 +1,22 @@ use js_option::JsOption; -use std::{collections::HashSet, time::Duration}; +use std::{ + collections::HashSet, + time::Duration, +}; use svix::{ - api::{ApplicationIn, EndpointIn, EndpointPatch, EventTypeIn}, + api::{ + ApplicationIn, + EndpointIn, + EndpointPatch, + EventTypeIn, + }, error::Error, }; -use wiremock::{Mock, MockServer, ResponseTemplate}; +use wiremock::{ + Mock, + MockServer, + ResponseTemplate, +}; use crate::utils::test_client::TestClientBuilder; @@ -88,8 +100,14 @@ async fn test_endpoint_crud() { .into_iter() .collect(); let got_channels = ep.channels.clone().unwrap().into_iter().collect(); - assert_eq!(want_channels, got_channels); - assert_eq!(0, ep.filter_types.unwrap_or_default().len()); + assert_eq!( + want_channels, + got_channels + ); + assert_eq!( + 0, + ep.filter_types.unwrap_or_default().len() + ); let ep_patched = client .endpoint() @@ -97,10 +115,9 @@ async fn test_endpoint_crud() { app.id.clone(), ep.id.clone(), EndpointPatch { - filter_types: JsOption::Some(vec![ - String::from("event.started"), - String::from("event.ended"), - ]), + filter_types: JsOption::Some( + vec![String::from("event.started"), String::from("event.ended")], + ), ..Default::default() }, ) @@ -118,14 +135,23 @@ async fn test_endpoint_crud() { .unwrap() .into_iter() .collect(); - assert_eq!(want_channels, got_channels); - assert_eq!(want_filter_types, got_filter_types); + assert_eq!( + want_channels, + got_channels + ); + assert_eq!( + want_filter_types, + got_filter_types + ); // Should complete without error if the deserialization handles empty bodies // correctly. client .endpoint() - .delete(app.id.clone(), ep.id) + .delete( + app.id.clone(), + ep.id, + ) .await .unwrap(); @@ -146,7 +172,12 @@ async fn test_default_retries() { Mock::given(wiremock::matchers::method("POST")) .and(wiremock::matchers::path("/api/v1/app")) - .and(wiremock::matchers::header("svix-retry-count", 1)) + .and( + wiremock::matchers::header( + "svix-retry-count", + 1, + ), + ) .and(wiremock::matchers::header_exists("svix-req-id")) .respond_with(ResponseTemplate::new(500)) .up_to_n_times(1) @@ -156,7 +187,12 @@ async fn test_default_retries() { Mock::given(wiremock::matchers::method("POST")) .and(wiremock::matchers::path("/api/v1/app")) - .and(wiremock::matchers::header("svix-retry-count", 2)) + .and( + wiremock::matchers::header( + "svix-retry-count", + 2, + ), + ) .respond_with(ResponseTemplate::new(500)) .up_to_n_times(1) .expect(1) @@ -204,7 +240,12 @@ async fn test_custom_retries() { for i in 1..=num_retries { Mock::given(wiremock::matchers::method("POST")) .and(wiremock::matchers::path("/api/v1/app")) - .and(wiremock::matchers::header("svix-retry-count", i)) + .and( + wiremock::matchers::header( + "svix-retry-count", + i, + ), + ) .respond_with(ResponseTemplate::new(500)) .up_to_n_times(1) .expect(1) @@ -256,7 +297,12 @@ async fn test_custom_retry_schedule() { for i in 1..=retry_schedule_in_ms.len() { Mock::given(wiremock::matchers::method("POST")) .and(wiremock::matchers::path("/api/v1/app")) - .and(wiremock::matchers::header("svix-retry-count", i)) + .and( + wiremock::matchers::header( + "svix-retry-count", + i, + ), + ) .respond_with(ResponseTemplate::new(500)) .up_to_n_times(1) .expect(1) diff --git a/rust/tests/it/model_serialization.rs b/rust/tests/it/model_serialization.rs index 5ddf4a00e..b40a60176 100644 --- a/rust/tests/it/model_serialization.rs +++ b/rust/tests/it/model_serialization.rs @@ -1,10 +1,21 @@ -use std::{collections::HashMap, fmt::Debug}; +use std::{ + collections::HashMap, + fmt::Debug, +}; use serde::de::DeserializeOwned; use serde_json::json; use svix::api::{ - CronConfig, IngestSourceIn, IngestSourceInConfig, IngestSourceOut, IngestSourceOutConfig, - ListResponseApplicationOut, SegmentConfig, SegmentConfigOut, SvixConfig, SvixConfigOut, + CronConfig, + IngestSourceIn, + IngestSourceInConfig, + IngestSourceOut, + IngestSourceOutConfig, + ListResponseApplicationOut, + SegmentConfig, + SegmentConfigOut, + SvixConfig, + SvixConfigOut, }; #[test] @@ -21,7 +32,10 @@ fn test_list_response_xxx_out() { prev_iterator: Some("prevIterator-str".to_string()), }; - assert_eq!(expected_model, loaded_json); + assert_eq!( + expected_model, + loaded_json + ); // without iterator and prevIterator let json_str = r#"{"data":[],"done":true,"iterator":null,"prevIterator":null}"#; @@ -33,18 +47,23 @@ fn test_list_response_xxx_out() { ..Default::default() }; - assert_eq!(expected_model, loaded_json); + assert_eq!( + expected_model, + loaded_json + ); } #[test] fn test_ingest_source_in() { assert_eq!( - json!(IngestSourceIn { - name: "foo".to_owned(), - uid: None, - config: IngestSourceInConfig::GenericWebhook, - metadata: Some(HashMap::new()) - }), + json!( + IngestSourceIn { + name: "foo".to_owned(), + uid: None, + config: IngestSourceInConfig::GenericWebhook, + metadata: Some(HashMap::new()) + } + ), json!({ "name": "foo", "type": "generic-webhook", @@ -53,14 +72,18 @@ fn test_ingest_source_in() { ); assert_eq!( - json!(IngestSourceIn { - name: "foo".to_owned(), - uid: None, - config: IngestSourceInConfig::Svix(SvixConfig { - secret: "xxx".to_owned() - }), - metadata: Some(HashMap::new()) - }), + json!( + IngestSourceIn { + name: "foo".to_owned(), + uid: None, + config: IngestSourceInConfig::Svix( + SvixConfig { + secret: "xxx".to_owned() + } + ), + metadata: Some(HashMap::new()) + } + ), json!({ "name": "foo", "type": "svix", @@ -70,12 +93,18 @@ fn test_ingest_source_in() { ); assert_eq!( - json!(IngestSourceIn { - name: "foo".to_owned(), - uid: None, - config: IngestSourceInConfig::Segment(SegmentConfig { secret: None }), - metadata: Some(HashMap::new()) - }), + json!( + IngestSourceIn { + name: "foo".to_owned(), + uid: None, + config: IngestSourceInConfig::Segment( + SegmentConfig { + secret: None + } + ), + metadata: Some(HashMap::new()) + } + ), json!({ "name": "foo", "type": "segment", @@ -85,16 +114,20 @@ fn test_ingest_source_in() { ); assert_eq!( - json!(IngestSourceIn { - name: "foo".to_owned(), - uid: None, - config: IngestSourceInConfig::Cron(CronConfig { - content_type: None, - payload: "💣".to_owned(), - schedule: "* * * * *".to_owned(), - }), - metadata: Some(HashMap::new()) - }), + json!( + IngestSourceIn { + name: "foo".to_owned(), + uid: None, + config: IngestSourceInConfig::Cron( + CronConfig { + content_type: None, + payload: "💣".to_owned(), + schedule: "* * * * *".to_owned(), + } + ), + metadata: Some(HashMap::new()) + } + ), json!({ "name": "foo", "type": "cron", @@ -197,11 +230,13 @@ fn test_ingest_source_out() { name: "foo".to_owned(), uid: None, updated_at: "2006-01-02T15:04:05Z".to_owned(), - config: IngestSourceOutConfig::Cron(CronConfig { - content_type: None, - payload: "💣".to_owned(), - schedule: "* * * * *".to_owned(), - }), + config: IngestSourceOutConfig::Cron( + CronConfig { + content_type: None, + payload: "💣".to_owned(), + schedule: "* * * * *".to_owned(), + }, + ), metadata: HashMap::new(), }, ); @@ -212,5 +247,8 @@ fn assert_deserializes_to( expected: T, ) { let actual = T::deserialize(value).unwrap(); - assert_eq!(actual, expected); + assert_eq!( + actual, + expected + ); } diff --git a/rust/tests/it/utils/test_client.rs b/rust/tests/it/utils/test_client.rs index c593baab8..60393fb2c 100644 --- a/rust/tests/it/utils/test_client.rs +++ b/rust/tests/it/utils/test_client.rs @@ -1,6 +1,9 @@ use std::time::Duration; -use svix::api::{Svix, SvixOptions}; +use svix::api::{ + Svix, + SvixOptions, +}; pub struct TestClient { pub client: Svix, @@ -24,43 +27,62 @@ impl TestClientBuilder { } #[allow(unused)] - pub fn token(mut self, token: String) -> Self { + pub fn token( + mut self, + token: String, + ) -> Self { self.token = Some(token); self } - pub fn url(mut self, url: String) -> Self { + pub fn url( + mut self, + url: String, + ) -> Self { self.url = Some(url); self } - pub fn retries(mut self, retries: u32) -> Self { + pub fn retries( + mut self, + retries: u32, + ) -> Self { self.retries = Some(retries); self } - pub fn retry_schedule(mut self, retry_schedule: Vec) -> Self { + pub fn retry_schedule( + mut self, + retry_schedule: Vec, + ) -> Self { self.retry_schedule = Some(retry_schedule); self } pub fn build(self) -> TestClient { - let token = self.token.unwrap_or_else(|| { - std::env::var("SVIX_TOKEN").expect("SVIX_TOKEN is required to run this test") - }); - let url = self.url.unwrap_or_else(|| { - std::env::var("SVIX_SERVER_URL").expect("SVIX_SERVER_URL is required to run this test") - }); + let token = self.token.unwrap_or_else( + || std::env::var("SVIX_TOKEN").expect("SVIX_TOKEN is required to run this test"), + ); + let url = self.url.unwrap_or_else( + || { + std::env::var("SVIX_SERVER_URL") + .expect("SVIX_SERVER_URL is required to run this test") + }, + ); let client = Svix::new( token.clone(), - Some(SvixOptions { - server_url: Some(url.clone()), - num_retries: self.retries, - retry_schedule: self.retry_schedule, - ..Default::default() - }), + Some( + SvixOptions { + server_url: Some(url.clone()), + num_retries: self.retries, + retry_schedule: self.retry_schedule, + ..Default::default() + }, + ), ); - TestClient { client } + TestClient { + client, + } } } diff --git a/rust/tests/it/wiremock_tests.rs b/rust/tests/it/wiremock_tests.rs index 68ba3b690..279eb2ac1 100644 --- a/rust/tests/it/wiremock_tests.rs +++ b/rust/tests/it/wiremock_tests.rs @@ -1,8 +1,17 @@ -use svix::api::{MessageListOptions, Svix, SvixOptions}; +use svix::api::{ + MessageListOptions, + Svix, + SvixOptions, +}; use wiremock::{ - matchers::{method, path}, - Mock, MockServer, ResponseTemplate, + matchers::{ + method, + path, + }, + Mock, + MockServer, + ResponseTemplate, }; #[tokio::test] @@ -19,19 +28,23 @@ async fn test_urlencoded_octothorpe() { let svx = Svix::new( "token".to_string(), - Some(SvixOptions { - server_url: Some(mock_server.uri()), - ..Default::default() - }), + Some( + SvixOptions { + server_url: Some(mock_server.uri()), + ..Default::default() + }, + ), ); svx.message() .list( "app_id".to_string(), - Some(MessageListOptions { - tag: Some("test#test".into()), - ..Default::default() - }), + Some( + MessageListOptions { + tag: Some("test#test".into()), + ..Default::default() + }, + ), ) .await .unwrap(); @@ -41,8 +54,14 @@ async fn test_urlencoded_octothorpe() { .await .expect("we should have sent a request"); - assert_eq!(1, requests.len()); - assert_eq!(Some("tag=test%23test"), requests[0].url.query()); + assert_eq!( + 1, + requests.len() + ); + assert_eq!( + Some("tag=test%23test"), + requests[0].url.query() + ); } #[tokio::test] @@ -58,14 +77,19 @@ async fn test_idempotency_key_is_sent_for_create_request() { let svx = Svix::new( "token".to_string(), - Some(SvixOptions { - server_url: Some(mock_server.uri()), - ..Default::default() - }), + Some( + SvixOptions { + server_url: Some(mock_server.uri()), + ..Default::default() + }, + ), ); svx.application() - .create(svix::api::ApplicationIn::new("test app".to_string()), None) + .create( + svix::api::ApplicationIn::new("test app".to_string()), + None, + ) .await .unwrap(); @@ -74,7 +98,10 @@ async fn test_idempotency_key_is_sent_for_create_request() { .await .expect("we should have sent a request"); - assert_eq!(1, requests.len()); + assert_eq!( + 1, + requests.len() + ); let idempotency_key = requests[0] .headers .get("idempotency-key") @@ -98,19 +125,23 @@ async fn test_client_provided_idempotency_key_is_not_overridden() { let svx = Svix::new( "token".to_string(), - Some(SvixOptions { - server_url: Some(mock_server.uri()), - ..Default::default() - }), + Some( + SvixOptions { + server_url: Some(mock_server.uri()), + ..Default::default() + }, + ), ); let client_provided_key = "test-key-123"; svx.application() .create( svix::api::ApplicationIn::new("test app".to_string()), - Some(svix::api::ApplicationCreateOptions { - idempotency_key: Some(client_provided_key.to_string()), - }), + Some( + svix::api::ApplicationCreateOptions { + idempotency_key: Some(client_provided_key.to_string()), + }, + ), ) .await .unwrap(); @@ -120,7 +151,10 @@ async fn test_client_provided_idempotency_key_is_not_overridden() { .await .expect("we should have sent a request"); - assert_eq!(1, requests.len()); + assert_eq!( + 1, + requests.len() + ); let idempotency_key = requests[0] .headers .get("idempotency-key") @@ -147,10 +181,12 @@ async fn test_unknown_keys_are_ignored() { let svx = Svix::new( "token".to_string(), - Some(SvixOptions { - server_url: Some(mock_server.uri()), - ..Default::default() - }), + Some( + SvixOptions { + server_url: Some(mock_server.uri()), + ..Default::default() + }, + ), ); svx.application().list(None).await.unwrap(); diff --git a/svix-cli/.rustfmt.toml b/svix-cli/.rustfmt.toml index 455c8209c..29ee6a8cb 100644 --- a/svix-cli/.rustfmt.toml +++ b/svix-cli/.rustfmt.toml @@ -1,2 +1,6 @@ imports_granularity = "Crate" group_imports = "StdExternalCrate" +fn_params_layout = "Vertical" +struct_lit_width = 0 +imports_layout = "Vertical" +fn_call_width = 0 diff --git a/svix-cli/src/cmds/api/application.rs b/svix-cli/src/cmds/api/application.rs index 8fa8e9912..2e1402147 100644 --- a/svix-cli/src/cmds/api/application.rs +++ b/svix-cli/src/cmds/api/application.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct ApplicationCreateOptions { impl From for svix::api::ApplicationCreateOptions { fn from(value: ApplicationCreateOptions) -> Self { - let ApplicationCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let ApplicationCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -86,9 +93,13 @@ impl ApplicationCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { + options, + } => { let resp = client.application().list(Some(options.into())).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { application_in, @@ -96,22 +107,41 @@ impl ApplicationCommands { } => { let resp = client .application() - .create(application_in.into_inner(), Some(options.into())) + .create( + application_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { id } => { + Self::Get { + id, + } => { let resp = client.application().get(id).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Update { id, application_in } => { + Self::Update { + id, + application_in, + } => { let resp = client .application() - .update(id, application_in.into_inner()) + .update( + id, + application_in.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { id } => { + Self::Delete { + id, + } => { client.application().delete(id).await?; } Self::Patch { @@ -120,9 +150,14 @@ impl ApplicationCommands { } => { let resp = client .application() - .patch(id, application_patch.unwrap_or_default().into_inner()) + .patch( + id, + application_patch.unwrap_or_default().into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/authentication.rs b/svix-cli/src/cmds/api/authentication.rs index 98a05223f..f7d7231bb 100644 --- a/svix-cli/src/cmds/api/authentication.rs +++ b/svix-cli/src/cmds/api/authentication.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -12,8 +15,12 @@ impl From for svix::api::AuthenticationAppPortalAccessOptions { fn from(value: AuthenticationAppPortalAccessOptions) -> Self { - let AuthenticationAppPortalAccessOptions { idempotency_key } = value; - Self { idempotency_key } + let AuthenticationAppPortalAccessOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -25,8 +32,12 @@ pub struct AuthenticationExpireAllOptions { impl From for svix::api::AuthenticationExpireAllOptions { fn from(value: AuthenticationExpireAllOptions) -> Self { - let AuthenticationExpireAllOptions { idempotency_key } = value; - Self { idempotency_key } + let AuthenticationExpireAllOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -38,8 +49,12 @@ pub struct AuthenticationLogoutOptions { impl From for svix::api::AuthenticationLogoutOptions { fn from(value: AuthenticationLogoutOptions) -> Self { - let AuthenticationLogoutOptions { idempotency_key } = value; - Self { idempotency_key } + let AuthenticationLogoutOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -53,8 +68,12 @@ impl From for svix::api::AuthenticationStreamPortalAccessOptions { fn from(value: AuthenticationStreamPortalAccessOptions) -> Self { - let AuthenticationStreamPortalAccessOptions { idempotency_key } = value; - Self { idempotency_key } + let AuthenticationStreamPortalAccessOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -68,8 +87,12 @@ impl From for svix::api::AuthenticationRotateStreamPollerTokenOptions { fn from(value: AuthenticationRotateStreamPollerTokenOptions) -> Self { - let AuthenticationRotateStreamPollerTokenOptions { idempotency_key } = value; - Self { idempotency_key } + let AuthenticationRotateStreamPollerTokenOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -142,7 +165,9 @@ impl AuthenticationCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ExpireAll { app_id, @@ -158,7 +183,9 @@ impl AuthenticationCommands { ) .await?; } - Self::Logout { options } => { + Self::Logout { + options, + } => { client.authentication().logout(Some(options.into())).await?; } Self::StreamPortalAccess { @@ -174,14 +201,23 @@ impl AuthenticationCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::GetStreamPollerToken { stream_id, sink_id } => { + Self::GetStreamPollerToken { + stream_id, + sink_id, + } => { let resp = client .authentication() - .get_stream_poller_token(stream_id, sink_id) + .get_stream_poller_token( + stream_id, sink_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::RotateStreamPollerToken { stream_id, @@ -198,7 +234,9 @@ impl AuthenticationCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/connector.rs b/svix-cli/src/cmds/api/connector.rs index c13bb7a83..5b9b5d6e1 100644 --- a/svix-cli/src/cmds/api/connector.rs +++ b/svix-cli/src/cmds/api/connector.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct ConnectorCreateOptions { impl From for svix::api::ConnectorCreateOptions { fn from(value: ConnectorCreateOptions) -> Self { - let ConnectorCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let ConnectorCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -86,9 +93,13 @@ impl ConnectorCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { + options, + } => { let resp = client.connector().list(Some(options.into())).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { connector_in, @@ -96,13 +107,22 @@ impl ConnectorCommands { } => { let resp = client .connector() - .create(connector_in.into_inner(), Some(options.into())) + .create( + connector_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { id } => { + Self::Get { + id, + } => { let resp = client.connector().get(id).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { id, @@ -110,11 +130,18 @@ impl ConnectorCommands { } => { let resp = client .connector() - .update(id, connector_update.into_inner()) + .update( + id, + connector_update.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { id } => { + Self::Delete { + id, + } => { client.connector().delete(id).await?; } Self::Patch { @@ -123,9 +150,14 @@ impl ConnectorCommands { } => { let resp = client .connector() - .patch(id, connector_patch.unwrap_or_default().into_inner()) + .patch( + id, + connector_patch.unwrap_or_default().into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/endpoint.rs b/svix-cli/src/cmds/api/endpoint.rs index 35035a8cf..4f810e25c 100644 --- a/svix-cli/src/cmds/api/endpoint.rs +++ b/svix-cli/src/cmds/api/endpoint.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct EndpointCreateOptions { impl From for svix::api::EndpointCreateOptions { fn from(value: EndpointCreateOptions) -> Self { - let EndpointCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let EndpointCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -51,8 +58,12 @@ pub struct EndpointRecoverOptions { impl From for svix::api::EndpointRecoverOptions { fn from(value: EndpointRecoverOptions) -> Self { - let EndpointRecoverOptions { idempotency_key } = value; - Self { idempotency_key } + let EndpointRecoverOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -64,8 +75,12 @@ pub struct EndpointReplayMissingOptions { impl From for svix::api::EndpointReplayMissingOptions { fn from(value: EndpointReplayMissingOptions) -> Self { - let EndpointReplayMissingOptions { idempotency_key } = value; - Self { idempotency_key } + let EndpointReplayMissingOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -77,8 +92,12 @@ pub struct EndpointRotateSecretOptions { impl From for svix::api::EndpointRotateSecretOptions { fn from(value: EndpointRotateSecretOptions) -> Self { - let EndpointRotateSecretOptions { idempotency_key } = value; - Self { idempotency_key } + let EndpointRotateSecretOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -90,8 +109,12 @@ pub struct EndpointSendExampleOptions { impl From for svix::api::EndpointSendExampleOptions { fn from(value: EndpointSendExampleOptions) -> Self { - let EndpointSendExampleOptions { idempotency_key } = value; - Self { idempotency_key } + let EndpointSendExampleOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -107,7 +130,10 @@ pub struct EndpointGetStatsOptions { impl From for svix::api::EndpointGetStatsOptions { fn from(value: EndpointGetStatsOptions) -> Self { - let EndpointGetStatsOptions { since, until } = value; + let EndpointGetStatsOptions { + since, + until, + } = value; Self { since: since.map(|dt| dt.to_rfc3339()), until: until.map(|dt| dt.to_rfc3339()), @@ -267,9 +293,20 @@ impl EndpointCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { app_id, options } => { - let resp = client.endpoint().list(app_id, Some(options.into())).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::List { + app_id, + options, + } => { + let resp = client + .endpoint() + .list( + app_id, + Some(options.into()), + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { app_id, @@ -278,13 +315,29 @@ impl EndpointCommands { } => { let resp = client .endpoint() - .create(app_id, endpoint_in.into_inner(), Some(options.into())) + .create( + app_id, + endpoint_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { app_id, id } => { - let resp = client.endpoint().get(app_id, id).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::Get { + app_id, + id, + } => { + let resp = client + .endpoint() + .get( + app_id, id, + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { app_id, @@ -293,12 +346,26 @@ impl EndpointCommands { } => { let resp = client .endpoint() - .update(app_id, id, endpoint_update.into_inner()) + .update( + app_id, + id, + endpoint_update.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { app_id, id } => { - client.endpoint().delete(app_id, id).await?; + Self::Delete { + app_id, + id, + } => { + client + .endpoint() + .delete( + app_id, id, + ) + .await?; } Self::Patch { app_id, @@ -307,13 +374,29 @@ impl EndpointCommands { } => { let resp = client .endpoint() - .patch(app_id, id, endpoint_patch.unwrap_or_default().into_inner()) + .patch( + app_id, + id, + endpoint_patch.unwrap_or_default().into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::GetHeaders { app_id, id } => { - let resp = client.endpoint().get_headers(app_id, id).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::GetHeaders { + app_id, + id, + } => { + let resp = client + .endpoint() + .get_headers( + app_id, id, + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::UpdateHeaders { app_id, @@ -322,7 +405,11 @@ impl EndpointCommands { } => { client .endpoint() - .update_headers(app_id, id, endpoint_headers_in.into_inner()) + .update_headers( + app_id, + id, + endpoint_headers_in.into_inner(), + ) .await?; } Self::PatchHeaders { @@ -332,7 +419,11 @@ impl EndpointCommands { } => { client .endpoint() - .patch_headers(app_id, id, endpoint_headers_patch_in.into_inner()) + .patch_headers( + app_id, + id, + endpoint_headers_patch_in.into_inner(), + ) .await?; } Self::Recover { @@ -343,9 +434,16 @@ impl EndpointCommands { } => { let resp = client .endpoint() - .recover(app_id, id, recover_in.into_inner(), Some(options.into())) + .recover( + app_id, + id, + recover_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ReplayMissing { app_id, @@ -355,13 +453,30 @@ impl EndpointCommands { } => { let resp = client .endpoint() - .replay_missing(app_id, id, replay_in.into_inner(), Some(options.into())) + .replay_missing( + app_id, + id, + replay_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::GetSecret { app_id, id } => { - let resp = client.endpoint().get_secret(app_id, id).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::GetSecret { + app_id, + id, + } => { + let resp = client + .endpoint() + .get_secret( + app_id, id, + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::RotateSecret { app_id, @@ -394,7 +509,9 @@ impl EndpointCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::GetStats { app_id, @@ -403,13 +520,29 @@ impl EndpointCommands { } => { let resp = client .endpoint() - .get_stats(app_id, id, Some(options.into())) + .get_stats( + app_id, + id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::TransformationGet { app_id, id } => { - let resp = client.endpoint().transformation_get(app_id, id).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::TransformationGet { + app_id, + id, + } => { + let resp = client + .endpoint() + .transformation_get( + app_id, id, + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::PatchTransformation { app_id, diff --git a/svix-cli/src/cmds/api/environment.rs b/svix-cli/src/cmds/api/environment.rs index 68bc02de9..2607976e9 100644 --- a/svix-cli/src/cmds/api/environment.rs +++ b/svix-cli/src/cmds/api/environment.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -10,8 +13,12 @@ pub struct EnvironmentExportOptions { impl From for svix::api::EnvironmentExportOptions { fn from(value: EnvironmentExportOptions) -> Self { - let EnvironmentExportOptions { idempotency_key } = value; - Self { idempotency_key } + let EnvironmentExportOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -23,8 +30,12 @@ pub struct EnvironmentImportOptions { impl From for svix::api::EnvironmentImportOptions { fn from(value: EnvironmentImportOptions) -> Self { - let EnvironmentImportOptions { idempotency_key } = value; - Self { idempotency_key } + let EnvironmentImportOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -65,9 +76,13 @@ impl EnvironmentCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::Export { options } => { + Self::Export { + options, + } => { let resp = client.environment().export(Some(options.into())).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Import { environment_in, diff --git a/svix-cli/src/cmds/api/event_type.rs b/svix-cli/src/cmds/api/event_type.rs index a409d0d1f..4ec937f57 100644 --- a/svix-cli/src/cmds/api/event_type.rs +++ b/svix-cli/src/cmds/api/event_type.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -48,8 +51,12 @@ pub struct EventTypeCreateOptions { impl From for svix::api::EventTypeCreateOptions { fn from(value: EventTypeCreateOptions) -> Self { - let EventTypeCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let EventTypeCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -61,8 +68,12 @@ pub struct EventTypeImportOpenapiOptions { impl From for svix::api::EventTypeImportOpenapiOptions { fn from(value: EventTypeImportOpenapiOptions) -> Self { - let EventTypeImportOpenapiOptions { idempotency_key } = value; - Self { idempotency_key } + let EventTypeImportOpenapiOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -75,8 +86,12 @@ pub struct EventTypeDeleteOptions { impl From for svix::api::EventTypeDeleteOptions { fn from(value: EventTypeDeleteOptions) -> Self { - let EventTypeDeleteOptions { expunge } = value; - Self { expunge } + let EventTypeDeleteOptions { + expunge, + } = value; + Self { + expunge, + } } } @@ -146,9 +161,13 @@ impl EventTypeCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { + options, + } => { let resp = client.event_type().list(Some(options.into())).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { event_type_in, @@ -156,9 +175,14 @@ impl EventTypeCommands { } => { let resp = client .event_type() - .create(event_type_in.into_inner(), Some(options.into())) + .create( + event_type_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ImportOpenapi { event_type_import_open_api_in, @@ -173,11 +197,17 @@ impl EventTypeCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { event_type_name } => { + Self::Get { + event_type_name, + } => { let resp = client.event_type().get(event_type_name).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { event_type_name, @@ -185,9 +215,14 @@ impl EventTypeCommands { } => { let resp = client .event_type() - .update(event_type_name, event_type_update.into_inner()) + .update( + event_type_name, + event_type_update.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Delete { event_type_name, @@ -195,7 +230,10 @@ impl EventTypeCommands { } => { client .event_type() - .delete(event_type_name, Some(options.into())) + .delete( + event_type_name, + Some(options.into()), + ) .await?; } Self::Patch { @@ -209,7 +247,9 @@ impl EventTypeCommands { event_type_patch.unwrap_or_default().into_inner(), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/ingest.rs b/svix-cli/src/cmds/api/ingest.rs index 04fd0d8fa..ca63eb8f0 100644 --- a/svix-cli/src/cmds/api/ingest.rs +++ b/svix-cli/src/cmds/api/ingest.rs @@ -1,8 +1,14 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; -use super::{ingest_endpoint::IngestEndpointArgs, ingest_source::IngestSourceArgs}; +use super::{ + ingest_endpoint::IngestEndpointArgs, + ingest_source::IngestSourceArgs, +}; #[derive(Args, Clone)] pub struct IngestDashboardOptions { @@ -12,8 +18,12 @@ pub struct IngestDashboardOptions { impl From for svix::api::IngestDashboardOptions { fn from(value: IngestDashboardOptions) -> Self { - let IngestDashboardOptions { idempotency_key } = value; - Self { idempotency_key } + let IngestDashboardOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -46,10 +56,18 @@ impl IngestCommands { ) -> anyhow::Result<()> { match self { Self::Endpoint(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } Self::Source(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } Self::Dashboard { source_id, @@ -66,7 +84,9 @@ impl IngestCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/ingest_endpoint.rs b/svix-cli/src/cmds/api/ingest_endpoint.rs index 5829e4dc8..10ba9c78f 100644 --- a/svix-cli/src/cmds/api/ingest_endpoint.rs +++ b/svix-cli/src/cmds/api/ingest_endpoint.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct IngestEndpointCreateOptions { impl From for svix::api::IngestEndpointCreateOptions { fn from(value: IngestEndpointCreateOptions) -> Self { - let IngestEndpointCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let IngestEndpointCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -51,8 +58,12 @@ pub struct IngestEndpointRotateSecretOptions { impl From for svix::api::IngestEndpointRotateSecretOptions { fn from(value: IngestEndpointRotateSecretOptions) -> Self { - let IngestEndpointRotateSecretOptions { idempotency_key } = value; - Self { idempotency_key } + let IngestEndpointRotateSecretOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -144,13 +155,21 @@ impl IngestEndpointCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { source_id, options } => { + Self::List { + source_id, + options, + } => { let resp = client .ingest() .endpoint() - .list(source_id, Some(options.into())) + .list( + source_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { source_id, @@ -166,7 +185,9 @@ impl IngestEndpointCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Get { source_id, @@ -175,9 +196,14 @@ impl IngestEndpointCommands { let resp = client .ingest() .endpoint() - .get(source_id, endpoint_id) + .get( + source_id, + endpoint_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { source_id, @@ -187,9 +213,15 @@ impl IngestEndpointCommands { let resp = client .ingest() .endpoint() - .update(source_id, endpoint_id, ingest_endpoint_update.into_inner()) + .update( + source_id, + endpoint_id, + ingest_endpoint_update.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Delete { source_id, @@ -198,7 +230,10 @@ impl IngestEndpointCommands { client .ingest() .endpoint() - .delete(source_id, endpoint_id) + .delete( + source_id, + endpoint_id, + ) .await?; } Self::GetHeaders { @@ -208,9 +243,14 @@ impl IngestEndpointCommands { let resp = client .ingest() .endpoint() - .get_headers(source_id, endpoint_id) + .get_headers( + source_id, + endpoint_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::UpdateHeaders { source_id, @@ -234,9 +274,14 @@ impl IngestEndpointCommands { let resp = client .ingest() .endpoint() - .get_secret(source_id, endpoint_id) + .get_secret( + source_id, + endpoint_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::RotateSecret { source_id, @@ -262,9 +307,14 @@ impl IngestEndpointCommands { let resp = client .ingest() .endpoint() - .get_transformation(source_id, endpoint_id) + .get_transformation( + source_id, + endpoint_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::SetTransformation { source_id, diff --git a/svix-cli/src/cmds/api/ingest_source.rs b/svix-cli/src/cmds/api/ingest_source.rs index d3ad1ed11..597bed10b 100644 --- a/svix-cli/src/cmds/api/ingest_source.rs +++ b/svix-cli/src/cmds/api/ingest_source.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct IngestSourceCreateOptions { impl From for svix::api::IngestSourceCreateOptions { fn from(value: IngestSourceCreateOptions) -> Self { - let IngestSourceCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let IngestSourceCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -51,8 +58,12 @@ pub struct IngestSourceRotateTokenOptions { impl From for svix::api::IngestSourceRotateTokenOptions { fn from(value: IngestSourceRotateTokenOptions) -> Self { - let IngestSourceRotateTokenOptions { idempotency_key } = value; - Self { idempotency_key } + let IngestSourceRotateTokenOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -105,9 +116,13 @@ impl IngestSourceCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { + options, + } => { let resp = client.ingest().source().list(Some(options.into())).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { ingest_source_in, @@ -116,13 +131,22 @@ impl IngestSourceCommands { let resp = client .ingest() .source() - .create(ingest_source_in.into_inner(), Some(options.into())) + .create( + ingest_source_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { source_id } => { + Self::Get { + source_id, + } => { let resp = client.ingest().source().get(source_id).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { source_id, @@ -131,20 +155,35 @@ impl IngestSourceCommands { let resp = client .ingest() .source() - .update(source_id, ingest_source_in.into_inner()) + .update( + source_id, + ingest_source_in.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { source_id } => { + Self::Delete { + source_id, + } => { client.ingest().source().delete(source_id).await?; } - Self::RotateToken { source_id, options } => { + Self::RotateToken { + source_id, + options, + } => { let resp = client .ingest() .source() - .rotate_token(source_id, Some(options.into())) + .rotate_token( + source_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/integration.rs b/svix-cli/src/cmds/api/integration.rs index 7fe9dbd6c..297004f1f 100644 --- a/svix-cli/src/cmds/api/integration.rs +++ b/svix-cli/src/cmds/api/integration.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct IntegrationCreateOptions { impl From for svix::api::IntegrationCreateOptions { fn from(value: IntegrationCreateOptions) -> Self { - let IntegrationCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let IntegrationCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -51,8 +58,12 @@ pub struct IntegrationRotateKeyOptions { impl From for svix::api::IntegrationRotateKeyOptions { fn from(value: IntegrationRotateKeyOptions) -> Self { - let IntegrationRotateKeyOptions { idempotency_key } = value; - Self { idempotency_key } + let IntegrationRotateKeyOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -106,12 +117,20 @@ impl IntegrationCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { app_id, options } => { + Self::List { + app_id, + options, + } => { let resp = client .integration() - .list(app_id, Some(options.into())) + .list( + app_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { app_id, @@ -120,13 +139,29 @@ impl IntegrationCommands { } => { let resp = client .integration() - .create(app_id, integration_in.into_inner(), Some(options.into())) + .create( + app_id, + integration_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { app_id, id } => { - let resp = client.integration().get(app_id, id).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::Get { + app_id, + id, + } => { + let resp = client + .integration() + .get( + app_id, id, + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { app_id, @@ -135,17 +170,41 @@ impl IntegrationCommands { } => { let resp = client .integration() - .update(app_id, id, integration_update.into_inner()) + .update( + app_id, + id, + integration_update.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { app_id, id } => { - client.integration().delete(app_id, id).await?; + Self::Delete { + app_id, + id, + } => { + client + .integration() + .delete( + app_id, id, + ) + .await?; } - Self::GetKey { app_id, id } => { + Self::GetKey { + app_id, + id, + } => { #[allow(deprecated)] - let resp = client.integration().get_key(app_id, id).await?; - crate::json::print_json_output(&resp, color_mode)?; + let resp = client + .integration() + .get_key( + app_id, id, + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::RotateKey { app_id, @@ -154,9 +213,15 @@ impl IntegrationCommands { } => { let resp = client .integration() - .rotate_key(app_id, id, Some(options.into())) + .rotate_key( + app_id, + id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/message.rs b/svix-cli/src/cmds/api/message.rs index be191d69f..e69ecc02e 100644 --- a/svix-cli/src/cmds/api/message.rs +++ b/svix-cli/src/cmds/api/message.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; use super::message_poller::MessagePollerArgs; @@ -88,8 +91,12 @@ pub struct MessageExpungeAllContentsOptions { impl From for svix::api::MessageExpungeAllContentsOptions { fn from(value: MessageExpungeAllContentsOptions) -> Self { - let MessageExpungeAllContentsOptions { idempotency_key } = value; - Self { idempotency_key } + let MessageExpungeAllContentsOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -102,8 +109,12 @@ pub struct MessageGetOptions { impl From for svix::api::MessageGetOptions { fn from(value: MessageGetOptions) -> Self { - let MessageGetOptions { with_content } = value; - Self { with_content } + let MessageGetOptions { + with_content, + } = value; + Self { + with_content, + } } } @@ -191,11 +202,26 @@ impl MessageCommands { ) -> anyhow::Result<()> { match self { Self::Poller(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } - Self::List { app_id, options } => { - let resp = client.message().list(app_id, Some(options.into())).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::List { + app_id, + options, + } => { + let resp = client + .message() + .list( + app_id, + Some(options.into()), + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { app_id, @@ -204,16 +230,30 @@ impl MessageCommands { } => { let resp = client .message() - .create(app_id, message_in.into_inner(), Some(options.into())) + .create( + app_id, + message_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::ExpungeAllContents { app_id, options } => { + Self::ExpungeAllContents { + app_id, + options, + } => { let resp = client .message() - .expunge_all_contents(app_id, Some(options.into())) + .expunge_all_contents( + app_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Get { app_id, @@ -222,12 +262,26 @@ impl MessageCommands { } => { let resp = client .message() - .get(app_id, id, Some(options.into())) + .get( + app_id, + id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::ExpungeContent { app_id, id } => { - client.message().expunge_content(app_id, id).await?; + Self::ExpungeContent { + app_id, + id, + } => { + client + .message() + .expunge_content( + app_id, id, + ) + .await?; } } diff --git a/svix-cli/src/cmds/api/message_attempt.rs b/svix-cli/src/cmds/api/message_attempt.rs index d198c5f1d..8416f00b5 100644 --- a/svix-cli/src/cmds/api/message_attempt.rs +++ b/svix-cli/src/cmds/api/message_attempt.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -212,8 +215,14 @@ impl From for svix::api::MessageAttemptListAttemptedDestinationsOptions { fn from(value: MessageAttemptListAttemptedDestinationsOptions) -> Self { - let MessageAttemptListAttemptedDestinationsOptions { limit, iterator } = value; - Self { limit, iterator } + let MessageAttemptListAttemptedDestinationsOptions { + limit, + iterator, + } = value; + Self { + limit, + iterator, + } } } @@ -225,8 +234,12 @@ pub struct MessageAttemptResendOptions { impl From for svix::api::MessageAttemptResendOptions { fn from(value: MessageAttemptResendOptions) -> Self { - let MessageAttemptResendOptions { idempotency_key } = value; - Self { idempotency_key } + let MessageAttemptResendOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -326,9 +339,15 @@ impl MessageAttemptCommands { } => { let resp = client .message_attempt() - .list_by_endpoint(app_id, endpoint_id, Some(options.into())) + .list_by_endpoint( + app_id, + endpoint_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ListByMsg { app_id, @@ -337,9 +356,15 @@ impl MessageAttemptCommands { } => { let resp = client .message_attempt() - .list_by_msg(app_id, msg_id, Some(options.into())) + .list_by_msg( + app_id, + msg_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ListAttemptedMessages { app_id, @@ -348,9 +373,15 @@ impl MessageAttemptCommands { } => { let resp = client .message_attempt() - .list_attempted_messages(app_id, endpoint_id, Some(options.into())) + .list_attempted_messages( + app_id, + endpoint_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Get { app_id, @@ -359,9 +390,13 @@ impl MessageAttemptCommands { } => { let resp = client .message_attempt() - .get(app_id, msg_id, attempt_id) + .get( + app_id, msg_id, attempt_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ExpungeContent { app_id, @@ -370,7 +405,9 @@ impl MessageAttemptCommands { } => { client .message_attempt() - .expunge_content(app_id, msg_id, attempt_id) + .expunge_content( + app_id, msg_id, attempt_id, + ) .await?; } Self::ListAttemptedDestinations { @@ -380,9 +417,15 @@ impl MessageAttemptCommands { } => { let resp = client .message_attempt() - .list_attempted_destinations(app_id, msg_id, Some(options.into())) + .list_attempted_destinations( + app_id, + msg_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Resend { app_id, @@ -392,7 +435,12 @@ impl MessageAttemptCommands { } => { client .message_attempt() - .resend(app_id, msg_id, endpoint_id, Some(options.into())) + .resend( + app_id, + msg_id, + endpoint_id, + Some(options.into()), + ) .await?; } } diff --git a/svix-cli/src/cmds/api/message_poller.rs b/svix-cli/src/cmds/api/message_poller.rs index 80aa66a88..076008e98 100644 --- a/svix-cli/src/cmds/api/message_poller.rs +++ b/svix-cli/src/cmds/api/message_poller.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -51,8 +54,14 @@ pub struct MessagePollerConsumerPollOptions { impl From for svix::api::MessagePollerConsumerPollOptions { fn from(value: MessagePollerConsumerPollOptions) -> Self { - let MessagePollerConsumerPollOptions { limit, iterator } = value; - Self { limit, iterator } + let MessagePollerConsumerPollOptions { + limit, + iterator, + } = value; + Self { + limit, + iterator, + } } } @@ -64,8 +73,12 @@ pub struct MessagePollerConsumerSeekOptions { impl From for svix::api::MessagePollerConsumerSeekOptions { fn from(value: MessagePollerConsumerSeekOptions) -> Self { - let MessagePollerConsumerSeekOptions { idempotency_key } = value; - Self { idempotency_key } + let MessagePollerConsumerSeekOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -120,9 +133,15 @@ impl MessagePollerCommands { let resp = client .message() .poller() - .poll(app_id, sink_id, Some(options.into())) + .poll( + app_id, + sink_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ConsumerPoll { app_id, @@ -133,9 +152,16 @@ impl MessagePollerCommands { let resp = client .message() .poller() - .consumer_poll(app_id, sink_id, consumer_id, Some(options.into())) + .consumer_poll( + app_id, + sink_id, + consumer_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::ConsumerSeek { app_id, @@ -155,7 +181,9 @@ impl MessagePollerCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/operational_webhook.rs b/svix-cli/src/cmds/api/operational_webhook.rs index 29b8caa32..b1aba7441 100644 --- a/svix-cli/src/cmds/api/operational_webhook.rs +++ b/svix-cli/src/cmds/api/operational_webhook.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; use super::operational_webhook_endpoint::OperationalWebhookEndpointArgs; @@ -24,7 +27,11 @@ impl OperationalWebhookCommands { ) -> anyhow::Result<()> { match self { Self::Endpoint(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } } diff --git a/svix-cli/src/cmds/api/operational_webhook_endpoint.rs b/svix-cli/src/cmds/api/operational_webhook_endpoint.rs index 617d45bde..e637798ad 100644 --- a/svix-cli/src/cmds/api/operational_webhook_endpoint.rs +++ b/svix-cli/src/cmds/api/operational_webhook_endpoint.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -42,8 +45,12 @@ impl From for svix::api::OperationalWebhookEndpointCreateOptions { fn from(value: OperationalWebhookEndpointCreateOptions) -> Self { - let OperationalWebhookEndpointCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let OperationalWebhookEndpointCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -57,8 +64,12 @@ impl From for svix::api::OperationalWebhookEndpointRotateSecretOptions { fn from(value: OperationalWebhookEndpointRotateSecretOptions) -> Self { - let OperationalWebhookEndpointRotateSecretOptions { idempotency_key } = value; - Self { idempotency_key } + let OperationalWebhookEndpointRotateSecretOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -123,13 +134,17 @@ impl OperationalWebhookEndpointCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { + options, + } => { let resp = client .operational_webhook() .endpoint() .list(Some(options.into())) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { operational_webhook_endpoint_in, @@ -143,15 +158,21 @@ impl OperationalWebhookEndpointCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { endpoint_id } => { + Self::Get { + endpoint_id, + } => { let resp = client .operational_webhook() .endpoint() .get(endpoint_id) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { endpoint_id, @@ -165,22 +186,30 @@ impl OperationalWebhookEndpointCommands { operational_webhook_endpoint_update.into_inner(), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { endpoint_id } => { + Self::Delete { + endpoint_id, + } => { client .operational_webhook() .endpoint() .delete(endpoint_id) .await?; } - Self::GetHeaders { endpoint_id } => { + Self::GetHeaders { + endpoint_id, + } => { let resp = client .operational_webhook() .endpoint() .get_headers(endpoint_id) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::UpdateHeaders { endpoint_id, @@ -195,13 +224,17 @@ impl OperationalWebhookEndpointCommands { ) .await?; } - Self::GetSecret { endpoint_id } => { + Self::GetSecret { + endpoint_id, + } => { let resp = client .operational_webhook() .endpoint() .get_secret(endpoint_id) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::RotateSecret { endpoint_id, diff --git a/svix-cli/src/cmds/api/streaming.rs b/svix-cli/src/cmds/api/streaming.rs index c1daf6d6f..4be3eae1a 100644 --- a/svix-cli/src/cmds/api/streaming.rs +++ b/svix-cli/src/cmds/api/streaming.rs @@ -1,10 +1,15 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; use super::{ - streaming_event_type::StreamingEventTypeArgs, streaming_events::StreamingEventsArgs, - streaming_sink::StreamingSinkArgs, streaming_stream::StreamingStreamArgs, + streaming_event_type::StreamingEventTypeArgs, + streaming_events::StreamingEventsArgs, + streaming_sink::StreamingSinkArgs, + streaming_stream::StreamingStreamArgs, }; #[derive(Args)] @@ -46,23 +51,46 @@ impl StreamingCommands { ) -> anyhow::Result<()> { match self { Self::EventType(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } Self::Events(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } Self::Sink(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } Self::Stream(args) => { - args.command.exec(client, color_mode).await?; + args.command + .exec( + client, color_mode, + ) + .await?; } - Self::SinkHeadersGet { stream_id, sink_id } => { + Self::SinkHeadersGet { + stream_id, + sink_id, + } => { let resp = client .streaming() - .sink_headers_get(stream_id, sink_id) + .sink_headers_get( + stream_id, sink_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::SinkHeadersPatch { stream_id, @@ -71,16 +99,29 @@ impl StreamingCommands { } => { let resp = client .streaming() - .sink_headers_patch(stream_id, sink_id, http_sink_headers_patch_in.into_inner()) + .sink_headers_patch( + stream_id, + sink_id, + http_sink_headers_patch_in.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::SinkTransformationGet { stream_id, sink_id } => { + Self::SinkTransformationGet { + stream_id, + sink_id, + } => { let resp = client .streaming() - .sink_transformation_get(stream_id, sink_id) + .sink_transformation_get( + stream_id, sink_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/streaming_event_type.rs b/svix-cli/src/cmds/api/streaming_event_type.rs index 39a8e650b..5f1fbe76f 100644 --- a/svix-cli/src/cmds/api/streaming_event_type.rs +++ b/svix-cli/src/cmds/api/streaming_event_type.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -43,8 +46,12 @@ pub struct StreamingEventTypeCreateOptions { impl From for svix::api::StreamingEventTypeCreateOptions { fn from(value: StreamingEventTypeCreateOptions) -> Self { - let StreamingEventTypeCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let StreamingEventTypeCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -57,8 +64,12 @@ pub struct StreamingEventTypeDeleteOptions { impl From for svix::api::StreamingEventTypeDeleteOptions { fn from(value: StreamingEventTypeDeleteOptions) -> Self { - let StreamingEventTypeDeleteOptions { expunge } = value; - Self { expunge } + let StreamingEventTypeDeleteOptions { + expunge, + } = value; + Self { + expunge, + } } } @@ -109,13 +120,17 @@ impl StreamingEventTypeCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { + options, + } => { let resp = client .streaming() .event_type() .list(Some(options.into())) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { stream_event_type_in, @@ -124,13 +139,22 @@ impl StreamingEventTypeCommands { let resp = client .streaming() .event_type() - .create(stream_event_type_in.into_inner(), Some(options.into())) + .create( + stream_event_type_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { name } => { + Self::Get { + name, + } => { let resp = client.streaming().event_type().get(name).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { name, @@ -139,15 +163,26 @@ impl StreamingEventTypeCommands { let resp = client .streaming() .event_type() - .update(name, stream_event_type_in.into_inner()) + .update( + name, + stream_event_type_in.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { name, options } => { + Self::Delete { + name, + options, + } => { client .streaming() .event_type() - .delete(name, Some(options.into())) + .delete( + name, + Some(options.into()), + ) .await?; } Self::Patch { @@ -162,7 +197,9 @@ impl StreamingEventTypeCommands { stream_event_type_patch.unwrap_or_default().into_inner(), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/streaming_events.rs b/svix-cli/src/cmds/api/streaming_events.rs index aae35d923..83b2e4122 100644 --- a/svix-cli/src/cmds/api/streaming_events.rs +++ b/svix-cli/src/cmds/api/streaming_events.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -10,8 +13,12 @@ pub struct StreamingEventsCreateOptions { impl From for svix::api::StreamingEventsCreateOptions { fn from(value: StreamingEventsCreateOptions) -> Self { - let StreamingEventsCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let StreamingEventsCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -90,7 +97,9 @@ impl StreamingEventsCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Get { stream_id, @@ -100,9 +109,15 @@ impl StreamingEventsCommands { let resp = client .streaming() .events() - .get(stream_id, sink_id, Some(options.into())) + .get( + stream_id, + sink_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/streaming_sink.rs b/svix-cli/src/cmds/api/streaming_sink.rs index d799e805c..7b1f38e9e 100644 --- a/svix-cli/src/cmds/api/streaming_sink.rs +++ b/svix-cli/src/cmds/api/streaming_sink.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct StreamingSinkCreateOptions { impl From for svix::api::StreamingSinkCreateOptions { fn from(value: StreamingSinkCreateOptions) -> Self { - let StreamingSinkCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let StreamingSinkCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -51,8 +58,12 @@ pub struct StreamingSinkRotateSecretOptions { impl From for svix::api::StreamingSinkRotateSecretOptions { fn from(value: StreamingSinkRotateSecretOptions) -> Self { - let StreamingSinkRotateSecretOptions { idempotency_key } = value; - Self { idempotency_key } + let StreamingSinkRotateSecretOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -123,13 +134,21 @@ impl StreamingSinkCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { stream_id, options } => { + Self::List { + stream_id, + options, + } => { let resp = client .streaming() .sink() - .list(stream_id, Some(options.into())) + .list( + stream_id, + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Create { stream_id, @@ -145,11 +164,24 @@ impl StreamingSinkCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { stream_id, sink_id } => { - let resp = client.streaming().sink().get(stream_id, sink_id).await?; - crate::json::print_json_output(&resp, color_mode)?; + Self::Get { + stream_id, + sink_id, + } => { + let resp = client + .streaming() + .sink() + .get( + stream_id, sink_id, + ) + .await?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { stream_id, @@ -165,10 +197,21 @@ impl StreamingSinkCommands { stream_sink_in.unwrap_or_default().into_inner(), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { stream_id, sink_id } => { - client.streaming().sink().delete(stream_id, sink_id).await?; + Self::Delete { + stream_id, + sink_id, + } => { + client + .streaming() + .sink() + .delete( + stream_id, sink_id, + ) + .await?; } Self::Patch { stream_id, @@ -184,15 +227,24 @@ impl StreamingSinkCommands { stream_sink_patch.unwrap_or_default().into_inner(), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::GetSecret { stream_id, sink_id } => { + Self::GetSecret { + stream_id, + sink_id, + } => { let resp = client .streaming() .sink() - .get_secret(stream_id, sink_id) + .get_secret( + stream_id, sink_id, + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::RotateSecret { stream_id, @@ -210,7 +262,9 @@ impl StreamingSinkCommands { Some(options.into()), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::TransformationPartialUpdate { stream_id, @@ -226,7 +280,9 @@ impl StreamingSinkCommands { sink_transform_in.unwrap_or_default().into_inner(), ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/api/streaming_stream.rs b/svix-cli/src/cmds/api/streaming_stream.rs index 573d427e7..d79be4b1b 100644 --- a/svix-cli/src/cmds/api/streaming_stream.rs +++ b/svix-cli/src/cmds/api/streaming_stream.rs @@ -1,5 +1,8 @@ // this file is @generated -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; use svix::api::*; #[derive(Args, Clone)] @@ -38,8 +41,12 @@ pub struct StreamingStreamCreateOptions { impl From for svix::api::StreamingStreamCreateOptions { fn from(value: StreamingStreamCreateOptions) -> Self { - let StreamingStreamCreateOptions { idempotency_key } = value; - Self { idempotency_key } + let StreamingStreamCreateOptions { + idempotency_key, + } = value; + Self { + idempotency_key, + } } } @@ -86,25 +93,41 @@ impl StreamingStreamCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { + options, + } => { let resp = client .streaming() .stream() .list(Some(options.into())) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Create { stream_in, options } => { + Self::Create { + stream_in, + options, + } => { let resp = client .streaming() .stream() - .create(stream_in.into_inner(), Some(options.into())) + .create( + stream_in.into_inner(), + Some(options.into()), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Get { stream_id } => { + Self::Get { + stream_id, + } => { let resp = client.streaming().stream().get(stream_id).await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } Self::Update { stream_id, @@ -113,11 +136,18 @@ impl StreamingStreamCommands { let resp = client .streaming() .stream() - .update(stream_id, stream_in.into_inner()) + .update( + stream_id, + stream_in.into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } - Self::Delete { stream_id } => { + Self::Delete { + stream_id, + } => { client.streaming().stream().delete(stream_id).await?; } Self::Patch { @@ -127,9 +157,14 @@ impl StreamingStreamCommands { let resp = client .streaming() .stream() - .patch(stream_id, stream_patch.unwrap_or_default().into_inner()) + .patch( + stream_id, + stream_patch.unwrap_or_default().into_inner(), + ) .await?; - crate::json::print_json_output(&resp, color_mode)?; + crate::json::print_json_output( + &resp, color_mode, + )?; } } diff --git a/svix-cli/src/cmds/completion.rs b/svix-cli/src/cmds/completion.rs index 04519ce53..2091eaf7b 100644 --- a/svix-cli/src/cmds/completion.rs +++ b/svix-cli/src/cmds/completion.rs @@ -1,6 +1,10 @@ use anyhow::Result; use clap::CommandFactory; -use clap_complete::{generate as generate_, shells, Shell}; +use clap_complete::{ + generate as generate_, + shells, + Shell, +}; use crate::BIN_NAME; @@ -8,11 +12,36 @@ pub fn generate(shell: &Shell) -> Result<()> { let mut writer = std::io::stdout().lock(); let mut cmd = crate::Cli::command(); match shell { - Shell::Bash => generate_(shells::Bash, &mut cmd, BIN_NAME, &mut writer), - Shell::Elvish => generate_(shells::Elvish, &mut cmd, BIN_NAME, &mut writer), - Shell::Fish => generate_(shells::Fish, &mut cmd, BIN_NAME, &mut writer), - Shell::PowerShell => generate_(shells::PowerShell, &mut cmd, BIN_NAME, &mut writer), - Shell::Zsh => generate_(shells::Zsh, &mut cmd, BIN_NAME, &mut writer), + Shell::Bash => generate_( + shells::Bash, + &mut cmd, + BIN_NAME, + &mut writer, + ), + Shell::Elvish => generate_( + shells::Elvish, + &mut cmd, + BIN_NAME, + &mut writer, + ), + Shell::Fish => generate_( + shells::Fish, + &mut cmd, + BIN_NAME, + &mut writer, + ), + Shell::PowerShell => generate_( + shells::PowerShell, + &mut cmd, + BIN_NAME, + &mut writer, + ), + Shell::Zsh => generate_( + shells::Zsh, + &mut cmd, + BIN_NAME, + &mut writer, + ), _ => anyhow::bail!("unsupported shell"), } Ok(()) diff --git a/svix-cli/src/cmds/listen.rs b/svix-cli/src/cmds/listen.rs index 01e70e8c4..709a55c85 100644 --- a/svix-cli/src/cmds/listen.rs +++ b/svix-cli/src/cmds/listen.rs @@ -1,7 +1,13 @@ -use anyhow::{Context, Result}; +use anyhow::{ + Context, + Result, +}; use clap::Args; -use crate::config::{get_config_file_path, Config}; +use crate::config::{ + get_config_file_path, + Config, +}; #[derive(Args)] pub struct ListenArgs { @@ -10,7 +16,10 @@ pub struct ListenArgs { } impl ListenArgs { - pub async fn exec(self, cfg: &Config) -> Result<()> { + pub async fn exec( + self, + cfg: &Config, + ) -> Result<()> { let token = match cfg.relay_token.as_ref() { None => { let token = crate::relay::token::generate_token()?; @@ -18,10 +27,12 @@ impl ListenArgs { updated_cfg.relay_token = Some(token.clone()); let cfg_path = get_config_file_path()?; - if let Err(e) = updated_cfg.save_to_disk(&cfg_path).context(format!( - "failed to save relay token to config file at `{}`", - cfg_path.as_os_str().to_str().unwrap_or_default() - )) { + if let Err(e) = updated_cfg.save_to_disk(&cfg_path).context( + format!( + "failed to save relay token to config file at `{}`", + cfg_path.as_os_str().to_str().unwrap_or_default() + ), + ) { eprintln!("{e}"); } token diff --git a/svix-cli/src/cmds/login.rs b/svix-cli/src/cmds/login.rs index f4bef20a3..e689d489b 100644 --- a/svix-cli/src/cmds/login.rs +++ b/svix-cli/src/cmds/login.rs @@ -1,11 +1,20 @@ -use std::time::{Duration, Instant}; - -use anyhow::{Context, Result}; +use std::time::{ + Duration, + Instant, +}; + +use anyhow::{ + Context, + Result, +}; use dialoguer::Input; use reqwest::Client; use serde::Deserialize; -use crate::{config, config::Config}; +use crate::{ + config, + config::Config, +}; pub async fn prompt(_cfg: &Config) -> Result<()> { print!("Welcome to the Svix CLI!\n\n"); @@ -22,15 +31,17 @@ pub async fn prompt(_cfg: &Config) -> Result<()> { } else { Input::new() .with_prompt("Auth Token") - .validate_with({ - move |input: &String| -> Result<()> { - if !input.trim().is_empty() { - Ok(()) - } else { - Err(anyhow::anyhow!("auth token cannot be empty")) + .validate_with( + { + move |input: &String| -> Result<()> { + if !input.trim().is_empty() { + Ok(()) + } else { + Err(anyhow::anyhow!("auth token cannot be empty")) + } } - } - }) + }, + ) .interact_text()? .trim() .to_string() @@ -111,15 +122,24 @@ pub async fn dashboard_login() -> Result { // First, poll the discovery endpoint to get the region let discovery_poll_url = format!("{LOGIN_SERVER_URL}/dashboard/cli/login/discovery/complete"); - let discovery_data: DiscoverySessionOut = - poll_session(&client, &discovery_poll_url, &session_id).await?; + let discovery_data: DiscoverySessionOut = poll_session( + &client, + &discovery_poll_url, + &session_id, + ) + .await?; let region = discovery_data.region; let region_server_url = format!("https://api.{region}.svix.com"); let token_poll_url = format!("{region_server_url}/dashboard/cli/login/token/complete"); // Then, poll the token endpoint to get the auth token - let token_data: AuthTokenOut = poll_session(&client, &token_poll_url, &session_id).await?; + let token_data: AuthTokenOut = poll_session( + &client, + &token_poll_url, + &session_id, + ) + .await?; println!("Authentication successful!\n"); Ok(token_data.token) @@ -127,7 +147,11 @@ pub async fn dashboard_login() -> Result { const MAX_POLL_TIME: Duration = Duration::from_secs(5 * 60); -async fn poll_session(client: &Client, poll_url: &str, session_id: &str) -> Result +async fn poll_session( + client: &Client, + poll_url: &str, + session_id: &str, +) -> Result where T: for<'de> serde::Deserialize<'de>, { diff --git a/svix-cli/src/cmds/open.rs b/svix-cli/src/cmds/open.rs index eab48f2ff..dd8ebc3bb 100644 --- a/svix-cli/src/cmds/open.rs +++ b/svix-cli/src/cmds/open.rs @@ -1,5 +1,8 @@ use anyhow::Context; -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; #[derive(Args)] #[command(args_conflicts_with_subcommands = true)] @@ -24,14 +27,18 @@ pub enum OpenCommands { impl OpenCommands { pub async fn exec(self) -> anyhow::Result<()> { match self { - OpenCommands::Api => open::that(API_DOCS_URL).context(format!( - "Failed to open link in your default browser.\n + OpenCommands::Api => open::that(API_DOCS_URL).context( + format!( + "Failed to open link in your default browser.\n Try to paste `{API_DOCS_URL}` into your the address bar." - ))?, - OpenCommands::Docs => open::that(DOCS_URL).context(format!( - "Failed to open link in your default browser.\n + ), + )?, + OpenCommands::Docs => open::that(DOCS_URL).context( + format!( + "Failed to open link in your default browser.\n Try to paste `{DOCS_URL}` into your the address bar." - ))?, + ), + )?, } Ok(()) } diff --git a/svix-cli/src/cmds/seed.rs b/svix-cli/src/cmds/seed.rs index 2673f77a7..629b8beba 100644 --- a/svix-cli/src/cmds/seed.rs +++ b/svix-cli/src/cmds/seed.rs @@ -1,7 +1,14 @@ use anyhow::Context; use clap::Args; -use rand::{rngs::StdRng, seq::SliceRandom, SeedableRng}; -use serde::{Deserialize, Serialize}; +use rand::{ + rngs::StdRng, + seq::SliceRandom, + SeedableRng, +}; +use serde::{ + Deserialize, + Serialize, +}; use serde_json::json; use svix::api::*; @@ -71,7 +78,13 @@ pub async fn exec( name: "Test application".to_string(), ..Default::default() }; - let application_out = client.application().create(application_in, None).await?; + let application_out = client + .application() + .create( + application_in, + None, + ) + .await?; seed_out.application = application_out.clone(); @@ -83,9 +96,16 @@ pub async fn exec( let client = client.clone(); let app_id = app_id.clone(); - handles.push(tokio::spawn(async move { - create_endpoint(client, app_id).await - })) + handles.push( + tokio::spawn( + async move { + create_endpoint( + client, app_id, + ) + .await + }, + ), + ) } for h in handles { @@ -100,7 +120,13 @@ pub async fn exec( schemas: Some(json!(schema_example())), ..Default::default() }; - let res = client.event_type().create(event_type_in, None).await; + let res = client + .event_type() + .create( + event_type_in, + None, + ) + .await; match res { Ok(event_type_out) => { @@ -118,9 +144,16 @@ pub async fn exec( let client = client.clone(); let app_id = app_id.clone(); - handles.push(tokio::spawn( - async move { create_message(client, app_id).await }, - )) + handles.push( + tokio::spawn( + async move { + create_message( + client, app_id, + ) + .await + }, + ), + ) } for h in handles { @@ -136,13 +169,18 @@ pub async fn exec( seed_out.application.name ); - crate::json::print_json_output(&seed_out, color_mode)?; + crate::json::print_json_output( + &seed_out, color_mode, + )?; println!("{summary}"); Ok(()) } -async fn create_endpoint(client: Svix, app_id: String) -> anyhow::Result { +async fn create_endpoint( + client: Svix, + app_id: String, +) -> anyhow::Result { let req_client = reqwest::Client::new(); let resp = req_client @@ -154,14 +192,27 @@ async fn create_endpoint(client: Svix, app_id: String) -> anyhow::Result anyhow::Result { +async fn create_message( + client: Svix, + app_id: String, +) -> anyhow::Result { let mut rng = StdRng::from_entropy(); let event_type = USER_EVENT_TYPES @@ -178,7 +229,12 @@ async fn create_message(client: Svix, app_id: String) -> anyhow::Result anyhow::Result<()> { for app_out in resp.data { let client = client.clone(); - handles.push(tokio::spawn(async move { - if let Err(err) = client.application().delete(app_out.id.clone()).await { - eprintln!("Failed to delete application {}: {}", app_out.id, err); - } - })); + handles.push( + tokio::spawn( + async move { + if let Err(err) = client.application().delete(app_out.id.clone()).await { + eprintln!( + "Failed to delete application {}: {}", + app_out.id, err + ); + } + }, + ), + ); } for h in handles { @@ -210,17 +273,21 @@ async fn reset_event_type(client: &Svix) -> anyhow::Result<()> { for event_type_out in resp.data { let client = client.clone(); - let handle = tokio::spawn(async move { - let _ = client - .event_type() - .delete( - event_type_out.name, - Some(EventTypeDeleteOptions { - expunge: Some(true), - }), - ) - .await; - }); + let handle = tokio::spawn( + async move { + let _ = client + .event_type() + .delete( + event_type_out.name, + Some( + EventTypeDeleteOptions { + expunge: Some(true), + }, + ), + ) + .await; + }, + ); handles.push(handle); } diff --git a/svix-cli/src/cmds/signature.rs b/svix-cli/src/cmds/signature.rs index efaccd794..7daee5264 100644 --- a/svix-cli/src/cmds/signature.rs +++ b/svix-cli/src/cmds/signature.rs @@ -1,4 +1,7 @@ -use clap::{Args, Subcommand}; +use clap::{ + Args, + Subcommand, +}; #[derive(Args)] #[command(args_conflicts_with_subcommands = true)] @@ -44,7 +47,11 @@ impl SignatureCommands { payload, } => { let webhook = svix::webhooks::Webhook::new(&secret)?; - let signature = webhook.sign(&msg_id, timestamp, payload.as_bytes())?; + let signature = webhook.sign( + &msg_id, + timestamp, + payload.as_bytes(), + )?; println!("{signature}"); } SignatureCommands::Verify { @@ -56,10 +63,22 @@ impl SignatureCommands { } => { let webhook = svix::webhooks::Webhook::new(&secret)?; let mut headers = http::HeaderMap::with_capacity(3); - headers.insert("svix-id", msg_id.parse()?); - headers.insert("svix-timestamp", timestamp.to_string().parse()?); - headers.insert("svix-signature", signature.parse()?); - webhook.verify_ignoring_timestamp(payload.as_bytes(), &headers)?; + headers.insert( + "svix-id", + msg_id.parse()?, + ); + headers.insert( + "svix-timestamp", + timestamp.to_string().parse()?, + ); + headers.insert( + "svix-signature", + signature.parse()?, + ); + webhook.verify_ignoring_timestamp( + payload.as_bytes(), + &headers, + )?; } } Ok(()) diff --git a/svix-cli/src/config.rs b/svix-cli/src/config.rs index c0a201d7b..a15c6c2c6 100644 --- a/svix-cli/src/config.rs +++ b/svix-cli/src/config.rs @@ -1,15 +1,28 @@ use std::{ - fs::{File, OpenOptions}, + fs::{ + File, + OpenOptions, + }, io::Write, - path::{Path, PathBuf}, + path::{ + Path, + PathBuf, + }, }; use anyhow::Result; use figment::{ - providers::{Env, Format, Toml}, + providers::{ + Env, + Format, + Toml, + }, Figment, }; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct Config { @@ -60,7 +73,10 @@ impl Config { Ok(config) } - pub fn save_to_disk(&self, path: &Path) -> Result<()> { + pub fn save_to_disk( + &self, + path: &Path, + ) -> Result<()> { let mut fh = open_config_file(path)?; let source = &toml::to_string_pretty(self)?; diff --git a/svix-cli/src/json.rs b/svix-cli/src/json.rs index d81e53991..56fbda3f4 100644 --- a/svix-cli/src/json.rs +++ b/svix-cli/src/json.rs @@ -1,8 +1,22 @@ -use std::{io::Read, str::FromStr}; +use std::{ + io::Read, + str::FromStr, +}; -use anyhow::{Context, Error, Result}; -use colored_json::{Color, ColorMode, ToColoredJson}; -use serde::{de::DeserializeOwned, Serialize}; +use anyhow::{ + Context, + Error, + Result, +}; +use colored_json::{ + Color, + ColorMode, + ToColoredJson, +}; +use serde::{ + de::DeserializeOwned, + Serialize, +}; #[derive(Clone, Debug, Default, PartialEq)] pub struct JsonOf(T); @@ -30,7 +44,10 @@ impl JsonOf { } } -pub fn print_json_output(val: &T, color_mode: ColorMode) -> Result<()> +pub fn print_json_output( + val: &T, + color_mode: ColorMode, +) -> Result<()> where T: Serialize, { @@ -42,7 +59,9 @@ where string_include_quotation: true, ..Default::default() }; - let s = serde_json::to_string_pretty(val)?.to_colored_json_with_styler(color_mode, styler)?; + let s = serde_json::to_string_pretty(val)?.to_colored_json_with_styler( + color_mode, styler, + )?; println!("{s}"); Ok(()) diff --git a/svix-cli/src/main.rs b/svix-cli/src/main.rs index de5bef5cd..7156b2dad 100644 --- a/svix-cli/src/main.rs +++ b/svix-cli/src/main.rs @@ -1,17 +1,32 @@ use anyhow::Result; -use clap::{Parser, Subcommand}; +use clap::{ + Parser, + Subcommand, +}; use clap_complete::Shell; -use colored_json::{ColorMode, Output}; -use concolor_clap::{Color, ColorChoice}; +use colored_json::{ + ColorMode, + Output, +}; +use concolor_clap::{ + Color, + ColorChoice, +}; use svix::api::SvixOptions; use self::{ cmds::{ api::{ - application::ApplicationArgs, authentication::AuthenticationArgs, - endpoint::EndpointArgs, environment::EnvironmentArgs, event_type::EventTypeArgs, - ingest::IngestArgs, integration::IntegrationArgs, message::MessageArgs, - message_attempt::MessageAttemptArgs, operational_webhook::OperationalWebhookArgs, + application::ApplicationArgs, + authentication::AuthenticationArgs, + endpoint::EndpointArgs, + environment::EnvironmentArgs, + event_type::EventTypeArgs, + ingest::IngestArgs, + integration::IntegrationArgs, + message::MessageArgs, + message_attempt::MessageAttemptArgs, + operational_webhook::OperationalWebhookArgs, streaming::StreamingArgs, }, listen::ListenArgs, @@ -142,60 +157,113 @@ async fn main() -> Result<()> { // Remote API calls RootCommands::Application(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Authentication(args) => { let cfg = cfg?; let client = get_client(&cfg)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Connector(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::EventType(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Endpoint(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Environment(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Message(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::MessageAttempt(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Ingest(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Integration(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::OperationalWebhook(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Streaming(args) => { let client = get_client(&cfg?)?; - args.command.exec(&client, color_mode).await?; + args.command + .exec( + &client, color_mode, + ) + .await?; } RootCommands::Listen(args) => args.exec(&cfg?).await?, RootCommands::Login => cmds::login::prompt(&cfg?).await?, - RootCommands::Completion { shell } => cmds::completion::generate(&shell)?, + RootCommands::Completion { + shell, + } => cmds::completion::generate(&shell)?, RootCommands::Seed(args) => { let client = get_client(&cfg?)?; - cmds::seed::exec(&client, args, color_mode).await?; + cmds::seed::exec( + &client, args, color_mode, + ) + .await?; } } @@ -203,18 +271,25 @@ async fn main() -> Result<()> { } fn get_client(cfg: &Config) -> Result { - let token = cfg.auth_token.clone().ok_or_else(|| { - anyhow::anyhow!("No auth token set. Try running `{BIN_NAME} login` to get started.") - })?; + let token = cfg.auth_token.clone().ok_or_else( + || anyhow::anyhow!("No auth token set. Try running `{BIN_NAME} login` to get started."), + )?; let opts = get_client_options(cfg)?; - Ok(svix::api::Svix::new(token, Some(opts))) + Ok( + svix::api::Svix::new( + token, + Some(opts), + ), + ) } fn get_client_options(cfg: &Config) -> Result { - Ok(svix::api::SvixOptions { - debug: false, - server_url: cfg.server_url().map(Into::into), - timeout: None, - ..SvixOptions::default() - }) + Ok( + svix::api::SvixOptions { + debug: false, + server_url: cfg.server_url().map(Into::into), + timeout: None, + ..SvixOptions::default() + }, + ) } diff --git a/svix-cli/src/relay/message.rs b/svix-cli/src/relay/message.rs index ac5f6b05e..c617f1ee5 100644 --- a/svix-cli/src/relay/message.rs +++ b/svix-cli/src/relay/message.rs @@ -10,7 +10,10 @@ use std::collections::HashMap; -use serde::{Deserialize, Serialize}; +use serde::{ + Deserialize, + Serialize, +}; pub const VERSION: u16 = 1; diff --git a/svix-cli/src/relay/mod.rs b/svix-cli/src/relay/mod.rs index 46cb8e36a..35ed6d346 100644 --- a/svix-cli/src/relay/mod.rs +++ b/svix-cli/src/relay/mod.rs @@ -1,20 +1,41 @@ use std::{ collections::HashMap, - fmt::{Debug, Display, Formatter}, + fmt::{ + Debug, + Display, + Formatter, + }, time::Duration, }; -use anyhow::{Context, Result}; +use anyhow::{ + Context, + Result, +}; use futures_util::{ - stream::{SplitSink, SplitStream}, - SinkExt, StreamExt, + stream::{ + SplitSink, + SplitStream, + }, + SinkExt, + StreamExt, +}; +use http::{ + HeaderMap, + HeaderName, + HeaderValue, }; -use http::{HeaderMap, HeaderName, HeaderValue}; use indoc::printdoc; -use message::{MessageIn, MessageInEvent}; +use message::{ + MessageIn, + MessageInEvent, +}; use tokio::{ net::TcpStream, - sync::mpsc::{UnboundedReceiver, UnboundedSender}, + sync::mpsc::{ + UnboundedReceiver, + UnboundedSender, + }, task::JoinSet, time::Instant, }; @@ -22,14 +43,24 @@ use tokio_tungstenite::{ connect_async, tungstenite::{ client::IntoClientRequest, - protocol::{frame::coding::CloseCode::Policy, CloseFrame, Message}, - Bytes, Utf8Bytes, + protocol::{ + frame::coding::CloseCode::Policy, + CloseFrame, + Message, + }, + Bytes, + Utf8Bytes, }, - MaybeTlsStream, WebSocketStream, + MaybeTlsStream, + WebSocketStream, }; use crate::relay::{ - message::{MessageOut, MessageOutEvent, MessageOutStart}, + message::{ + MessageOut, + MessageOutEvent, + MessageOutStart, + }, token::generate_token, }; @@ -75,13 +106,19 @@ struct Client { struct TokenInUse; impl Debug for TokenInUse { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt( + &self, + f: &mut Formatter<'_>, + ) -> std::fmt::Result { f.write_str("TokenInUse") } } impl Display for TokenInUse { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt( + &self, + f: &mut Formatter<'_>, + ) -> std::fmt::Result { f.write_str("TokenInUse") } } @@ -89,7 +126,10 @@ impl Display for TokenInUse { impl std::error::Error for TokenInUse {} impl Client { - async fn connect(&mut self, show_welcome_message: bool) -> Result<()> { + async fn connect( + &mut self, + show_welcome_message: bool, + ) -> Result<()> { let mut set = JoinSet::new(); let conn = WsConnection::new(&self.websocket_url).await?; let (mut ws_tx, mut ws_rx) = conn.stream.split(); @@ -98,15 +138,19 @@ impl Client { match tokio::time::timeout( WRITE_WAIT, - ws_tx.send(Message::Text( - serde_json::to_string(&MessageOut::Start { - version: message::VERSION, - data: MessageOutStart { - token: self.token.clone(), - }, - })? - .into(), - )), + ws_tx.send( + Message::Text( + serde_json::to_string( + &MessageOut::Start { + version: message::VERSION, + data: MessageOutStart { + token: self.token.clone(), + }, + }, + )? + .into(), + ), + ), ) .await { @@ -129,7 +173,12 @@ impl Client { } attempts += 1; - match tokio::time::timeout(SERVER_PING_PERIOD, ws_rx.next()).await { + match tokio::time::timeout( + SERVER_PING_PERIOD, + ws_rx.next(), + ) + .await + { Err(_timeout) => continue, Ok(None) => { anyhow::bail!("no response from server for start message"); @@ -137,9 +186,10 @@ impl Client { Ok(Some(msg)) => { let data = match msg? { // Control messages. - Message::Close(Some(CloseFrame { code, reason })) - if code == Policy && reason == SOCKET_IN_USE_REASON => - { + Message::Close(Some(CloseFrame { + code, + reason, + })) if code == Policy && reason == SOCKET_IN_USE_REASON => { return Err(TokenInUse.into()) } Message::Close(_) => { @@ -155,8 +205,13 @@ impl Client { match serde_json::from_slice::(&data)? { // This is what we're waiting to see. A `MessageOut::Start` sent to the writer // should result in a `MessageInStart` coming back on the reader. - MessageIn::Start { data, .. } => break data, - MessageIn::Event { .. } => continue, + MessageIn::Start { + data, + .. + } => break data, + MessageIn::Event { + .. + } => continue, }; } } @@ -185,21 +240,32 @@ impl Client { println!("Connected!"); } - set.spawn({ - let local_url = self.local_url.clone(); - let http_client = self.http_client.clone(); - async move { - read_from_ws_loop(ws_rx, remote_tx, local_url.clone(), http_client.clone()) + set.spawn( + { + let local_url = self.local_url.clone(); + let http_client = self.http_client.clone(); + async move { + read_from_ws_loop( + ws_rx, + remote_tx, + local_url.clone(), + http_client.clone(), + ) .await .inspect_err(|e| eprintln!("read loop terminated: {e}")) - } - }); + } + }, + ); - set.spawn(async move { - send_to_ws_loop(remote_rx, ws_tx) + set.spawn( + async move { + send_to_ws_loop( + remote_rx, ws_tx, + ) .await .inspect_err(|e| eprintln!("write loop terminated: {e}")) - }); + }, + ); // If any task terminates, trash the rest so we can reconnect. if set.join_next().await.is_some() { @@ -270,7 +336,10 @@ pub async fn listen( } let backoff = *backoff_schedule.get(attempt_count).unwrap_or(&MAX_BACKOFF); - eprintln!("Reattempting connection in: {}ms", backoff.as_millis()); + eprintln!( + "Reattempting connection in: {}ms", + backoff.as_millis() + ); attempt_count += 1; last_attempt = Instant::now(); @@ -301,7 +370,11 @@ impl WsConnection { .inspect_err(|e| eprintln!("{e}")) .context("failed to connect to websocket server")?; - Ok(Self { stream }) + Ok( + Self { + stream, + }, + ) } } @@ -320,7 +393,12 @@ async fn read_from_ws_loop( loop { const REMOTE_SERVER_CLOSED: &str = "remote server closed connection"; - match tokio::time::timeout(SERVER_PING_PERIOD, rx.next()).await { + match tokio::time::timeout( + SERVER_PING_PERIOD, + rx.next(), + ) + .await + { Err(_timeout_hit) => { // Generous. 1.5x the ping frequency. If we go that long without // seeing anything from the server, force a reconnect. @@ -343,7 +421,13 @@ async fn read_from_ws_loop( Message::Binary(bytes) => bytes, }; - handle_incoming_message(client.clone(), data, &local_url, tx.clone()).await; + handle_incoming_message( + client.clone(), + data, + &local_url, + tx.clone(), + ) + .await; } } } @@ -358,11 +442,13 @@ async fn send_to_ws_loop( while let Some(msg) = rx.recv().await { tokio::time::timeout( WRITE_WAIT, - tx.send(Message::Binary( - serde_json::to_vec(&msg) - .expect("trivial serialization") - .into(), - )), + tx.send( + Message::Binary( + serde_json::to_vec(&msg) + .expect("trivial serialization") + .into(), + ), + ), ) .await? .context("Websocket write timeout")?; @@ -389,19 +475,27 @@ async fn make_local_request( HeaderValue::try_from(v.as_str())?, ); } - Ok(client - .request(method, url.clone()) - .timeout(DEFAULT_TIMEOUT) - .body(body) - .headers(headers) - .send() - .await?) + Ok( + client + .request( + method, + url.clone(), + ) + .timeout(DEFAULT_TIMEOUT) + .body(body) + .headers(headers) + .send() + .await?, + ) } fn format_resp_headers(headers: &HeaderMap) -> Result> { let mut out = HashMap::new(); for (k, v) in headers { - out.insert(k.to_string(), v.to_str()?.to_string()); + out.insert( + k.to_string(), + v.to_str()?.to_string(), + ); } Ok(out) } @@ -413,21 +507,34 @@ async fn handle_incoming_message( tx: UnboundedSender, ) { match serde_json::from_slice::(&bytes) { - Ok(MessageIn::Event { data, .. }) => { + Ok(MessageIn::Event { + data, + .. + }) => { let msg_id = data.id.clone(); println!("<- Forwarding message id={msg_id} to: {local_url}"); - match make_local_request(client, local_url, data).await { + match make_local_request( + client, local_url, data, + ) + .await + { Err(err) => { eprintln!("Failed to make request to local server: \n{err}"); } Ok(resp) => { - if let Err(err) = process_response(msg_id, resp, tx).await { + if let Err(err) = process_response( + msg_id, resp, tx, + ) + .await + { eprintln!("Failed to read response from local server: \n{err}"); } } } } - Ok(MessageIn::Start { .. }) => { /* nothing to do */ } + Ok(MessageIn::Start { + .. + }) => { /* nothing to do */ } Err(_err) => { eprintln!("Received invalid webhook message... skipping"); } diff --git a/svix-cli/src/relay/token.rs b/svix-cli/src/relay/token.rs index 0cc136797..b5eded738 100644 --- a/svix-cli/src/relay/token.rs +++ b/svix-cli/src/relay/token.rs @@ -1,5 +1,8 @@ use anyhow::Result; -use rand::distributions::{Distribution, Uniform}; +use rand::distributions::{ + Distribution, + Uniform, +}; const BASE62: &[u8; 62] = b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -24,8 +27,17 @@ mod tests { let out3 = generate_token().unwrap(); // Sort of weak as far as assertions go, but this is the least we can expect, right? - assert_ne!(out1, out2, "random tokens should be different"); - assert_ne!(out2, out3, "random tokens should be different"); - assert_ne!(out3, out1, "random tokens should be different"); + assert_ne!( + out1, out2, + "random tokens should be different" + ); + assert_ne!( + out2, out3, + "random tokens should be different" + ); + assert_ne!( + out3, out1, + "random tokens should be different" + ); } }