From 5a652f693d8cfba7ade394fa88118b6623ed75c6 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Mon, 12 Aug 2024 13:13:02 -0700 Subject: [PATCH] fixes Signed-off-by: Jess Frazelle --- twilio/src/default.rs | 9595 +++++++++ twilio/src/types.rs | 43273 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52868 insertions(+) create mode 100644 twilio/src/default.rs create mode 100644 twilio/src/types.rs diff --git a/twilio/src/default.rs b/twilio/src/default.rs new file mode 100644 index 0000000..8097b68 --- /dev/null +++ b/twilio/src/default.rs @@ -0,0 +1,9595 @@ +use anyhow::Result; + +use crate::Client; +#[derive(Clone, Debug)] +pub struct Default { + pub client: Client, +} + +impl Default { + #[doc(hidden)] + pub fn new(client: Client) -> Self { + Self { client } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts.json`.\n\nRetrieves a collection of Accounts belonging to the account used to make the request\n\n**Parameters:**\n\n- `friendly_name: Option`: Only return the Account resources with friendly names that exactly match this name.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `status: Option`: Only return Account resources with the given status. Can be `closed`, `suspended` or `active`.\n\n```rust,no_run\nasync fn example_default_list_account() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAccountResponse = client\n .default()\n .list_account(\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(twilio_api::types::AccountEnumStatus::Closed),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_account<'a>( + &'a self, + friendly_name: Option, + page: Option, + page_size: Option, + page_token: Option, + status: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!("{}/{}", self.client.base_url, "2010-04-01/Accounts.json"), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = status { + query_params.push(("Status", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts.json`.\n\nCreate a new Twilio \ + Subaccount from the account making the request\n\n```rust,no_run\nasync fn \ + example_default_create_account() -> anyhow::Result<()> {\n let client = \ + twilio_api::Client::new_from_env();\n let result: \ + twilio_api::types::ApiV2010Account = client\n .default()\n \ + .create_account(&twilio_api::types::CreateAccountRequest {\n \ + friendly_name: Some(\"some-string\".to_string()),\n })\n .await?;\n \ + println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_account<'a>( + &'a self, + body: &crate::types::CreateAccountRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!("{}/{}", self.client.base_url, "2010-04-01/Accounts.json"), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{Sid}.json`.\n\nFetch the account \ + specified by the provided Account Sid\n\n**Parameters:**\n\n- `sid: &'astr`: The \ + Account Sid that uniquely identifies the account to fetch \ + (required)\n\n```rust,no_run\nasync fn example_default_fetch_account() -> \ + anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let \ + result: twilio_api::types::ApiV2010Account =\n \ + client.default().fetch_account(\"some-string\").await?;\n println!(\"{:?}\", \ + result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_account<'a>( + &'a self, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{Sid}.json".replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{Sid}.json`.\n\nModify the properties of a given Account\n\n**Parameters:**\n\n- `sid: &'astr`: The Account Sid that uniquely identifies the account to update (required)\n\n```rust,no_run\nasync fn example_default_update_account() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010Account = client\n .default()\n .update_account(\n \"some-string\",\n &twilio_api::types::UpdateAccountRequest {\n friendly_name: Some(\"some-string\".to_string()),\n status: Some(twilio_api::types::AccountEnumStatus::Closed),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_account<'a>( + &'a self, + sid: &'a str, + body: &crate::types::UpdateAccountRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{Sid}.json".replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Addresses.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to read. (required)\n- `customer_name: Option`: The `customer_name` of the Address resources to read.\n- `friendly_name: Option`: The string that identifies the Address resources to read.\n- `iso_country: Option`: The ISO country code of the Address resources to read.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAddressResponse = client\n .default()\n .list_address(\n \"some-string\",\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_address<'a>( + &'a self, + account_sid: &'a str, + customer_name: Option, + friendly_name: Option, + iso_country: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Addresses.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = customer_name { + query_params.push(("CustomerName", p)); + } + + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = iso_country { + query_params.push(("IsoCountry", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Addresses.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Address resource. (required)\n\n```rust,no_run\nasync fn example_default_create_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountAddress = client\n .default()\n .create_address(\n \"some-string\",\n &twilio_api::types::CreateAddressRequest {\n customer_name: \"some-string\".to_string(),\n street: \"some-string\".to_string(),\n city: \"some-string\".to_string(),\n region: \"some-string\".to_string(),\n postal_code: \"some-string\".to_string(),\n iso_country: \"some-string\".to_string(),\n friendly_name: Some(\"some-string\".to_string()),\n emergency_enabled: Some(false),\n auto_correct_address: Some(false),\n street_secondary: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_address<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateAddressRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Addresses.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Address resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountAddress = client\n .default()\n .fetch_address(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_address<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Address resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountAddress = client\n .default()\n .update_address(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateAddressRequest {\n friendly_name: Some(\"some-string\".to_string()),\n customer_name: Some(\"some-string\".to_string()),\n street: Some(\"some-string\".to_string()),\n city: Some(\"some-string\".to_string()),\n region: Some(\"some-string\".to_string()),\n postal_code: Some(\"some-string\".to_string()),\n emergency_enabled: Some(false),\n auto_correct_address: Some(false),\n street_secondary: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_address<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateAddressRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Address resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_address(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_address<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Addresses/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Applications.json`.\n\nRetrieve a list of applications representing an application within the requesting account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resources to read. (required)\n- `friendly_name: Option`: The string that identifies the Application resources to read.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_application() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListApplicationResponse = client\n .default()\n .list_application(\n \"some-string\",\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_application<'a>( + &'a self, + account_sid: &'a str, + friendly_name: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Applications.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Applications.json`.\n\nCreate a new application within your account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nasync fn example_default_create_application() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountApplication = client\n .default()\n .create_application(\n \"some-string\",\n &twilio_api::types::CreateApplicationRequest {\n api_version: Some(\"some-string\".to_string()),\n voice_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_method: Some(twilio_api::types::CreateApplicationRequestVoiceMethod::Delete),\n voice_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_fallback_method: Some(\n twilio_api::types::CreateApplicationRequestVoiceFallbackMethod::Delete,\n ),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateApplicationRequestStatusCallbackMethod::Delete,\n ),\n voice_caller_id_lookup: Some(false),\n sms_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_method: Some(twilio_api::types::CreateApplicationRequestSmsMethod::Delete),\n sms_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_fallback_method: Some(\n twilio_api::types::CreateApplicationRequestSmsFallbackMethod::Delete,\n ),\n sms_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n message_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n friendly_name: Some(\"some-string\".to_string()),\n public_application_connect_enabled: Some(false),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_application<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateApplicationRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Applications.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json`.\n\nFetch the application specified by the provided sid\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Application resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_application() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountApplication = client\n .default()\n .fetch_application(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_application<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json`.\n\nUpdates the application's properties\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resources to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Application resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_application() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountApplication = client\n .default()\n .update_application(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateApplicationRequest {\n friendly_name: Some(\"some-string\".to_string()),\n api_version: Some(\"some-string\".to_string()),\n voice_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_method: Some(twilio_api::types::UpdateApplicationRequestVoiceMethod::Delete),\n voice_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_fallback_method: Some(\n twilio_api::types::UpdateApplicationRequestVoiceFallbackMethod::Delete,\n ),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::UpdateApplicationRequestStatusCallbackMethod::Delete,\n ),\n voice_caller_id_lookup: Some(false),\n sms_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_method: Some(twilio_api::types::UpdateApplicationRequestSmsMethod::Delete),\n sms_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_fallback_method: Some(\n twilio_api::types::UpdateApplicationRequestSmsFallbackMethod::Delete,\n ),\n sms_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n message_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n public_application_connect_enabled: Some(false),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_application<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateApplicationRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json`.\n\nDelete the application by the specified application sid\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Application resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_application() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_application(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_application<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AuthorizedConnectApps/{ConnectAppSid}.json`.\n\nFetch an instance of an authorized-connect-app\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resource to fetch. (required)\n- `connect_app_sid: &'astr`: The SID of the Connect App to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_authorized_connect_app() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountAuthorizedConnectApp = client\n .default()\n .fetch_authorized_connect_app(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_authorized_connect_app<'a>( + &'a self, + account_sid: &'a str, + connect_app_sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AuthorizedConnectApps/{ConnectAppSid}.json" + .replace("{AccountSid}", account_sid) + .replace("{ConnectAppSid}", connect_app_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AuthorizedConnectApps.json`.\n\nRetrieve a list of authorized-connect-apps belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_authorized_connect_app() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAuthorizedConnectAppResponse = client\n .default()\n .list_authorized_connect_app(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_authorized_connect_app<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AuthorizedConnectApps.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the available phone number Country resources. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_available_phone_number_country() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberCountryResponse = client\n .default()\n .list_available_phone_number_country(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_country<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the available phone number Country resource. (required)\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. (required)\n\n```rust,no_run\nasync fn example_default_fetch_available_phone_number_country() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountAvailablePhoneNumberCountry = client\n .default()\n .fetch_available_phone_number_country(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_available_phone_number_country<'a>( + &'a self, + account_sid: &'a str, + country_code: &'a str, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}.json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Local.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. (required)\n- `area_code: Option`: The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.\n- `beta: Option`: Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `contains: Option`: The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters.\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. (required)\n- `distance: Option`: The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.\n- `exclude_all_address_required: Option`: Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_foreign_address_required: Option`: Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_local_address_required: Option`: Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `fax_enabled: Option`: Whether the phone numbers can receive faxes. Can be: `true` or `false`.\n- `in_lata: Option`: Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.\n- `in_locality: Option`: Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.\n- `in_postal_code: Option`: Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.\n- `in_rate_center: Option`: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.\n- `in_region: Option`: Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.\n- `mms_enabled: Option`: Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.\n- `near_lat_long: Option`: Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.\n- `near_number: crate::types::phone_number::PhoneNumber`: Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `sms_enabled: Option`: Whether the phone numbers can receive text messages. Can be: `true` or `false`.\n- `voice_enabled: Option`: Whether the phone numbers can receive calls. Can be: `true` or `false`.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_available_phone_number_local() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberLocalResponse = client\n .default()\n .list_available_phone_number_local(\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(\"some-string\".to_string()),\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(false),\n Some(false),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(false),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_local<'a>( + &'a self, + account_sid: &'a str, + area_code: Option, + beta: Option, + contains: Option, + country_code: &'a str, + distance: Option, + exclude_all_address_required: Option, + exclude_foreign_address_required: Option, + exclude_local_address_required: Option, + fax_enabled: Option, + in_lata: Option, + in_locality: Option, + in_postal_code: Option, + in_rate_center: Option, + in_region: Option, + mms_enabled: Option, + near_lat_long: Option, + near_number: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + sms_enabled: Option, + voice_enabled: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Local.json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = area_code { + query_params.push(("AreaCode", format!("{}", p))); + } + + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = contains { + query_params.push(("Contains", p)); + } + + if let Some(p) = distance { + query_params.push(("Distance", format!("{}", p))); + } + + if let Some(p) = exclude_all_address_required { + query_params.push(("ExcludeAllAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_foreign_address_required { + query_params.push(("ExcludeForeignAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_local_address_required { + query_params.push(("ExcludeLocalAddressRequired", format!("{}", p))); + } + + if let Some(p) = fax_enabled { + query_params.push(("FaxEnabled", format!("{}", p))); + } + + if let Some(p) = in_lata { + query_params.push(("InLata", p)); + } + + if let Some(p) = in_locality { + query_params.push(("InLocality", p)); + } + + if let Some(p) = in_postal_code { + query_params.push(("InPostalCode", p)); + } + + if let Some(p) = in_rate_center { + query_params.push(("InRateCenter", p)); + } + + if let Some(p) = in_region { + query_params.push(("InRegion", p)); + } + + if let Some(p) = mms_enabled { + query_params.push(("MmsEnabled", format!("{}", p))); + } + + if let Some(p) = near_lat_long { + query_params.push(("NearLatLong", p)); + } + + if let Some(p) = near_number.0 { + query_params.push(("NearNumber", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = sms_enabled { + query_params.push(("SmsEnabled", format!("{}", p))); + } + + if let Some(p) = voice_enabled { + query_params.push(("VoiceEnabled", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/MachineToMachine.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. (required)\n- `area_code: Option`: The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.\n- `beta: Option`: Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `contains: Option`: The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. (required)\n- `distance: Option`: The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.\n- `exclude_all_address_required: Option`: Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_foreign_address_required: Option`: Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_local_address_required: Option`: Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `fax_enabled: Option`: Whether the phone numbers can receive faxes. Can be: `true` or `false`.\n- `in_lata: Option`: Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.\n- `in_locality: Option`: Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.\n- `in_postal_code: Option`: Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.\n- `in_rate_center: Option`: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.\n- `in_region: Option`: Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.\n- `mms_enabled: Option`: Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.\n- `near_lat_long: Option`: Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.\n- `near_number: crate::types::phone_number::PhoneNumber`: Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `sms_enabled: Option`: Whether the phone numbers can receive text messages. Can be: `true` or `false`.\n- `voice_enabled: Option`: Whether the phone numbers can receive calls. Can be: `true` or `false`.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_available_phone_number_machine_to_machine() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberMachineToMachineResponse = client\n .default()\n .list_available_phone_number_machine_to_machine(\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(\"some-string\".to_string()),\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(false),\n Some(false),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(false),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_machine_to_machine<'a>( + &'a self, + account_sid: &'a str, + area_code: Option, + beta: Option, + contains: Option, + country_code: &'a str, + distance: Option, + exclude_all_address_required: Option, + exclude_foreign_address_required: Option, + exclude_local_address_required: Option, + fax_enabled: Option, + in_lata: Option, + in_locality: Option, + in_postal_code: Option, + in_rate_center: Option, + in_region: Option, + mms_enabled: Option, + near_lat_long: Option, + near_number: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + sms_enabled: Option, + voice_enabled: Option, + ) -> Result< + crate::types::ListAvailablePhoneNumberMachineToMachineResponse, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/\ + MachineToMachine.json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = area_code { + query_params.push(("AreaCode", format!("{}", p))); + } + + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = contains { + query_params.push(("Contains", p)); + } + + if let Some(p) = distance { + query_params.push(("Distance", format!("{}", p))); + } + + if let Some(p) = exclude_all_address_required { + query_params.push(("ExcludeAllAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_foreign_address_required { + query_params.push(("ExcludeForeignAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_local_address_required { + query_params.push(("ExcludeLocalAddressRequired", format!("{}", p))); + } + + if let Some(p) = fax_enabled { + query_params.push(("FaxEnabled", format!("{}", p))); + } + + if let Some(p) = in_lata { + query_params.push(("InLata", p)); + } + + if let Some(p) = in_locality { + query_params.push(("InLocality", p)); + } + + if let Some(p) = in_postal_code { + query_params.push(("InPostalCode", p)); + } + + if let Some(p) = in_rate_center { + query_params.push(("InRateCenter", p)); + } + + if let Some(p) = in_region { + query_params.push(("InRegion", p)); + } + + if let Some(p) = mms_enabled { + query_params.push(("MmsEnabled", format!("{}", p))); + } + + if let Some(p) = near_lat_long { + query_params.push(("NearLatLong", p)); + } + + if let Some(p) = near_number.0 { + query_params.push(("NearNumber", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = sms_enabled { + query_params.push(("SmsEnabled", format!("{}", p))); + } + + if let Some(p) = voice_enabled { + query_params.push(("VoiceEnabled", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Mobile.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. (required)\n- `area_code: Option`: The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.\n- `beta: Option`: Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `contains: Option`: The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. (required)\n- `distance: Option`: The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.\n- `exclude_all_address_required: Option`: Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_foreign_address_required: Option`: Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_local_address_required: Option`: Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `fax_enabled: Option`: Whether the phone numbers can receive faxes. Can be: `true` or `false`.\n- `in_lata: Option`: Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.\n- `in_locality: Option`: Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.\n- `in_postal_code: Option`: Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.\n- `in_rate_center: Option`: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.\n- `in_region: Option`: Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.\n- `mms_enabled: Option`: Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.\n- `near_lat_long: Option`: Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.\n- `near_number: crate::types::phone_number::PhoneNumber`: Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `sms_enabled: Option`: Whether the phone numbers can receive text messages. Can be: `true` or `false`.\n- `voice_enabled: Option`: Whether the phone numbers can receive calls. Can be: `true` or `false`.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_available_phone_number_mobile() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberMobileResponse = client\n .default()\n .list_available_phone_number_mobile(\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(\"some-string\".to_string()),\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(false),\n Some(false),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(false),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_mobile<'a>( + &'a self, + account_sid: &'a str, + area_code: Option, + beta: Option, + contains: Option, + country_code: &'a str, + distance: Option, + exclude_all_address_required: Option, + exclude_foreign_address_required: Option, + exclude_local_address_required: Option, + fax_enabled: Option, + in_lata: Option, + in_locality: Option, + in_postal_code: Option, + in_rate_center: Option, + in_region: Option, + mms_enabled: Option, + near_lat_long: Option, + near_number: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + sms_enabled: Option, + voice_enabled: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Mobile.json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = area_code { + query_params.push(("AreaCode", format!("{}", p))); + } + + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = contains { + query_params.push(("Contains", p)); + } + + if let Some(p) = distance { + query_params.push(("Distance", format!("{}", p))); + } + + if let Some(p) = exclude_all_address_required { + query_params.push(("ExcludeAllAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_foreign_address_required { + query_params.push(("ExcludeForeignAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_local_address_required { + query_params.push(("ExcludeLocalAddressRequired", format!("{}", p))); + } + + if let Some(p) = fax_enabled { + query_params.push(("FaxEnabled", format!("{}", p))); + } + + if let Some(p) = in_lata { + query_params.push(("InLata", p)); + } + + if let Some(p) = in_locality { + query_params.push(("InLocality", p)); + } + + if let Some(p) = in_postal_code { + query_params.push(("InPostalCode", p)); + } + + if let Some(p) = in_rate_center { + query_params.push(("InRateCenter", p)); + } + + if let Some(p) = in_region { + query_params.push(("InRegion", p)); + } + + if let Some(p) = mms_enabled { + query_params.push(("MmsEnabled", format!("{}", p))); + } + + if let Some(p) = near_lat_long { + query_params.push(("NearLatLong", p)); + } + + if let Some(p) = near_number.0 { + query_params.push(("NearNumber", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = sms_enabled { + query_params.push(("SmsEnabled", format!("{}", p))); + } + + if let Some(p) = voice_enabled { + query_params.push(("VoiceEnabled", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/National.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. (required)\n- `area_code: Option`: The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.\n- `beta: Option`: Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `contains: Option`: The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. (required)\n- `distance: Option`: The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.\n- `exclude_all_address_required: Option`: Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_foreign_address_required: Option`: Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_local_address_required: Option`: Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `fax_enabled: Option`: Whether the phone numbers can receive faxes. Can be: `true` or `false`.\n- `in_lata: Option`: Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.\n- `in_locality: Option`: Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.\n- `in_postal_code: Option`: Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.\n- `in_rate_center: Option`: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.\n- `in_region: Option`: Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.\n- `mms_enabled: Option`: Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.\n- `near_lat_long: Option`: Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.\n- `near_number: crate::types::phone_number::PhoneNumber`: Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `sms_enabled: Option`: Whether the phone numbers can receive text messages. Can be: `true` or `false`.\n- `voice_enabled: Option`: Whether the phone numbers can receive calls. Can be: `true` or `false`.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_available_phone_number_national() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberNationalResponse = client\n .default()\n .list_available_phone_number_national(\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(\"some-string\".to_string()),\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(false),\n Some(false),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(false),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_national<'a>( + &'a self, + account_sid: &'a str, + area_code: Option, + beta: Option, + contains: Option, + country_code: &'a str, + distance: Option, + exclude_all_address_required: Option, + exclude_foreign_address_required: Option, + exclude_local_address_required: Option, + fax_enabled: Option, + in_lata: Option, + in_locality: Option, + in_postal_code: Option, + in_rate_center: Option, + in_region: Option, + mms_enabled: Option, + near_lat_long: Option, + near_number: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + sms_enabled: Option, + voice_enabled: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/National.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = area_code { + query_params.push(("AreaCode", format!("{}", p))); + } + + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = contains { + query_params.push(("Contains", p)); + } + + if let Some(p) = distance { + query_params.push(("Distance", format!("{}", p))); + } + + if let Some(p) = exclude_all_address_required { + query_params.push(("ExcludeAllAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_foreign_address_required { + query_params.push(("ExcludeForeignAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_local_address_required { + query_params.push(("ExcludeLocalAddressRequired", format!("{}", p))); + } + + if let Some(p) = fax_enabled { + query_params.push(("FaxEnabled", format!("{}", p))); + } + + if let Some(p) = in_lata { + query_params.push(("InLata", p)); + } + + if let Some(p) = in_locality { + query_params.push(("InLocality", p)); + } + + if let Some(p) = in_postal_code { + query_params.push(("InPostalCode", p)); + } + + if let Some(p) = in_rate_center { + query_params.push(("InRateCenter", p)); + } + + if let Some(p) = in_region { + query_params.push(("InRegion", p)); + } + + if let Some(p) = mms_enabled { + query_params.push(("MmsEnabled", format!("{}", p))); + } + + if let Some(p) = near_lat_long { + query_params.push(("NearLatLong", p)); + } + + if let Some(p) = near_number.0 { + query_params.push(("NearNumber", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = sms_enabled { + query_params.push(("SmsEnabled", format!("{}", p))); + } + + if let Some(p) = voice_enabled { + query_params.push(("VoiceEnabled", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/SharedCost.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. (required)\n- `area_code: Option`: The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.\n- `beta: Option`: Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `contains: Option`: The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. (required)\n- `distance: Option`: The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.\n- `exclude_all_address_required: Option`: Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_foreign_address_required: Option`: Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_local_address_required: Option`: Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `fax_enabled: Option`: Whether the phone numbers can receive faxes. Can be: `true` or `false`.\n- `in_lata: Option`: Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.\n- `in_locality: Option`: Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.\n- `in_postal_code: Option`: Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.\n- `in_rate_center: Option`: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.\n- `in_region: Option`: Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.\n- `mms_enabled: Option`: Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.\n- `near_lat_long: Option`: Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.\n- `near_number: crate::types::phone_number::PhoneNumber`: Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `sms_enabled: Option`: Whether the phone numbers can receive text messages. Can be: `true` or `false`.\n- `voice_enabled: Option`: Whether the phone numbers can receive calls. Can be: `true` or `false`.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_available_phone_number_shared_cost() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberSharedCostResponse = client\n .default()\n .list_available_phone_number_shared_cost(\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(\"some-string\".to_string()),\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(false),\n Some(false),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(false),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_shared_cost<'a>( + &'a self, + account_sid: &'a str, + area_code: Option, + beta: Option, + contains: Option, + country_code: &'a str, + distance: Option, + exclude_all_address_required: Option, + exclude_foreign_address_required: Option, + exclude_local_address_required: Option, + fax_enabled: Option, + in_lata: Option, + in_locality: Option, + in_postal_code: Option, + in_rate_center: Option, + in_region: Option, + mms_enabled: Option, + near_lat_long: Option, + near_number: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + sms_enabled: Option, + voice_enabled: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/SharedCost.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = area_code { + query_params.push(("AreaCode", format!("{}", p))); + } + + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = contains { + query_params.push(("Contains", p)); + } + + if let Some(p) = distance { + query_params.push(("Distance", format!("{}", p))); + } + + if let Some(p) = exclude_all_address_required { + query_params.push(("ExcludeAllAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_foreign_address_required { + query_params.push(("ExcludeForeignAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_local_address_required { + query_params.push(("ExcludeLocalAddressRequired", format!("{}", p))); + } + + if let Some(p) = fax_enabled { + query_params.push(("FaxEnabled", format!("{}", p))); + } + + if let Some(p) = in_lata { + query_params.push(("InLata", p)); + } + + if let Some(p) = in_locality { + query_params.push(("InLocality", p)); + } + + if let Some(p) = in_postal_code { + query_params.push(("InPostalCode", p)); + } + + if let Some(p) = in_rate_center { + query_params.push(("InRateCenter", p)); + } + + if let Some(p) = in_region { + query_params.push(("InRegion", p)); + } + + if let Some(p) = mms_enabled { + query_params.push(("MmsEnabled", format!("{}", p))); + } + + if let Some(p) = near_lat_long { + query_params.push(("NearLatLong", p)); + } + + if let Some(p) = near_number.0 { + query_params.push(("NearNumber", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = sms_enabled { + query_params.push(("SmsEnabled", format!("{}", p))); + } + + if let Some(p) = voice_enabled { + query_params.push(("VoiceEnabled", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/TollFree.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. (required)\n- `area_code: Option`: The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.\n- `beta: Option`: Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `contains: Option`: The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. (required)\n- `distance: Option`: The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.\n- `exclude_all_address_required: Option`: Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_foreign_address_required: Option`: Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_local_address_required: Option`: Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `fax_enabled: Option`: Whether the phone numbers can receive faxes. Can be: `true` or `false`.\n- `in_lata: Option`: Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.\n- `in_locality: Option`: Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.\n- `in_postal_code: Option`: Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.\n- `in_rate_center: Option`: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.\n- `in_region: Option`: Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.\n- `mms_enabled: Option`: Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.\n- `near_lat_long: Option`: Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.\n- `near_number: crate::types::phone_number::PhoneNumber`: Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `sms_enabled: Option`: Whether the phone numbers can receive text messages. Can be: `true` or `false`.\n- `voice_enabled: Option`: Whether the phone numbers can receive calls. Can be: `true` or `false`.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_available_phone_number_toll_free() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberTollFreeResponse = client\n .default()\n .list_available_phone_number_toll_free(\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(\"some-string\".to_string()),\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(false),\n Some(false),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(false),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_toll_free<'a>( + &'a self, + account_sid: &'a str, + area_code: Option, + beta: Option, + contains: Option, + country_code: &'a str, + distance: Option, + exclude_all_address_required: Option, + exclude_foreign_address_required: Option, + exclude_local_address_required: Option, + fax_enabled: Option, + in_lata: Option, + in_locality: Option, + in_postal_code: Option, + in_rate_center: Option, + in_region: Option, + mms_enabled: Option, + near_lat_long: Option, + near_number: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + sms_enabled: Option, + voice_enabled: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/TollFree.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = area_code { + query_params.push(("AreaCode", format!("{}", p))); + } + + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = contains { + query_params.push(("Contains", p)); + } + + if let Some(p) = distance { + query_params.push(("Distance", format!("{}", p))); + } + + if let Some(p) = exclude_all_address_required { + query_params.push(("ExcludeAllAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_foreign_address_required { + query_params.push(("ExcludeForeignAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_local_address_required { + query_params.push(("ExcludeLocalAddressRequired", format!("{}", p))); + } + + if let Some(p) = fax_enabled { + query_params.push(("FaxEnabled", format!("{}", p))); + } + + if let Some(p) = in_lata { + query_params.push(("InLata", p)); + } + + if let Some(p) = in_locality { + query_params.push(("InLocality", p)); + } + + if let Some(p) = in_postal_code { + query_params.push(("InPostalCode", p)); + } + + if let Some(p) = in_rate_center { + query_params.push(("InRateCenter", p)); + } + + if let Some(p) = in_region { + query_params.push(("InRegion", p)); + } + + if let Some(p) = mms_enabled { + query_params.push(("MmsEnabled", format!("{}", p))); + } + + if let Some(p) = near_lat_long { + query_params.push(("NearLatLong", p)); + } + + if let Some(p) = near_number.0 { + query_params.push(("NearNumber", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = sms_enabled { + query_params.push(("SmsEnabled", format!("{}", p))); + } + + if let Some(p) = voice_enabled { + query_params.push(("VoiceEnabled", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Voip.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. (required)\n- `area_code: Option`: The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.\n- `beta: Option`: Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `contains: Option`: The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.\n- `country_code: &'astr`: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. (required)\n- `distance: Option`: The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.\n- `exclude_all_address_required: Option`: Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_foreign_address_required: Option`: Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `exclude_local_address_required: Option`: Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.\n- `fax_enabled: Option`: Whether the phone numbers can receive faxes. Can be: `true` or `false`.\n- `in_lata: Option`: Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.\n- `in_locality: Option`: Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.\n- `in_postal_code: Option`: Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.\n- `in_rate_center: Option`: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.\n- `in_region: Option`: Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.\n- `mms_enabled: Option`: Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.\n- `near_lat_long: Option`: Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.\n- `near_number: crate::types::phone_number::PhoneNumber`: Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `sms_enabled: Option`: Whether the phone numbers can receive text messages. Can be: `true` or `false`.\n- `voice_enabled: Option`: Whether the phone numbers can receive calls. Can be: `true` or `false`.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_available_phone_number_voip() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListAvailablePhoneNumberVoipResponse = client\n .default()\n .list_available_phone_number_voip(\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(\"some-string\".to_string()),\n \"some-string\",\n Some(4 as i64),\n Some(false),\n Some(false),\n Some(false),\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(false),\n Some(false),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_available_phone_number_voip<'a>( + &'a self, + account_sid: &'a str, + area_code: Option, + beta: Option, + contains: Option, + country_code: &'a str, + distance: Option, + exclude_all_address_required: Option, + exclude_foreign_address_required: Option, + exclude_local_address_required: Option, + fax_enabled: Option, + in_lata: Option, + in_locality: Option, + in_postal_code: Option, + in_rate_center: Option, + in_region: Option, + mms_enabled: Option, + near_lat_long: Option, + near_number: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + sms_enabled: Option, + voice_enabled: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/Voip.json" + .replace("{AccountSid}", account_sid) + .replace("{CountryCode}", country_code) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = area_code { + query_params.push(("AreaCode", format!("{}", p))); + } + + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = contains { + query_params.push(("Contains", p)); + } + + if let Some(p) = distance { + query_params.push(("Distance", format!("{}", p))); + } + + if let Some(p) = exclude_all_address_required { + query_params.push(("ExcludeAllAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_foreign_address_required { + query_params.push(("ExcludeForeignAddressRequired", format!("{}", p))); + } + + if let Some(p) = exclude_local_address_required { + query_params.push(("ExcludeLocalAddressRequired", format!("{}", p))); + } + + if let Some(p) = fax_enabled { + query_params.push(("FaxEnabled", format!("{}", p))); + } + + if let Some(p) = in_lata { + query_params.push(("InLata", p)); + } + + if let Some(p) = in_locality { + query_params.push(("InLocality", p)); + } + + if let Some(p) = in_postal_code { + query_params.push(("InPostalCode", p)); + } + + if let Some(p) = in_rate_center { + query_params.push(("InRateCenter", p)); + } + + if let Some(p) = in_region { + query_params.push(("InRegion", p)); + } + + if let Some(p) = mms_enabled { + query_params.push(("MmsEnabled", format!("{}", p))); + } + + if let Some(p) = near_lat_long { + query_params.push(("NearLatLong", p)); + } + + if let Some(p) = near_number.0 { + query_params.push(("NearNumber", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = sms_enabled { + query_params.push(("SmsEnabled", format!("{}", p))); + } + + if let Some(p) = voice_enabled { + query_params.push(("VoiceEnabled", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Balance.json`.\n\nFetch \ + the balance for an Account based on Account Sid. Balance changes may not be reflected \ + immediately. Child accounts do not contain balance \ + information\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique SID identifier \ + of the Account. (required)\n\n```rust,no_run\nasync fn \ + example_default_fetch_balance() -> anyhow::Result<()> {\n let client = \ + twilio_api::Client::new_from_env();\n let result: \ + twilio_api::types::ApiV2010AccountBalance =\n \ + client.default().fetch_balance(\"some-string\").await?;\n println!(\"{:?}\", \ + result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_balance<'a>( + &'a self, + account_sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Balance.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls.json`.\n\nRetrieves a collection of calls made to and from your account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to read. (required)\n- `end_time: Option>`: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date.\n- `from: crate::types::phone_number::PhoneNumber`: Only include calls from this phone number, SIP address, Client identifier or SIM SID.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `parent_call_sid: Option`: Only include calls spawned by calls with this SID.\n- `start_time: Option>`: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date.\n- `status: Option`: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`.\n- `to: crate::types::phone_number::PhoneNumber`: Only show calls made to this phone number, SIP address, Client identifier or SIM SID.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_call() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListCallResponse = client\n .default()\n .list_call(\n \"some-string\",\n Some(chrono::Utc::now()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now()),\n Some(twilio_api::types::CallEnumStatus::Canceled),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_call<'a>( + &'a self, + account_sid: &'a str, + end_time: Option>, + from: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + parent_call_sid: Option, + start_time: Option>, + status: Option, + to: crate::types::phone_number::PhoneNumber, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls.json".replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = end_time { + query_params.push(("EndTime", format!("{}", p))); + } + + if let Some(p) = from.0 { + query_params.push(("From", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = parent_call_sid { + query_params.push(("ParentCallSid", p)); + } + + if let Some(p) = start_time { + query_params.push(("StartTime", format!("{}", p))); + } + + if let Some(p) = status { + query_params.push(("Status", format!("{}", p))); + } + + if let Some(p) = to.0 { + query_params.push(("To", format!("{p}"))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls.json`.\n\nCreate a new outgoing call to phones, SIP-enabled endpoints or Twilio Client connections\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nasync fn example_default_create_call() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCall = client\n .default()\n .create_call(\n \"some-string\",\n &twilio_api::types::CreateCallRequest {\n to: \"some-string\".to_string(),\n from: \"some-string\".to_string(),\n method: Some(twilio_api::types::Method::Delete),\n fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n fallback_method: Some(twilio_api::types::FallbackMethod::Delete),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_event: Some(vec![\"some-string\".to_string()]),\n status_callback_method: Some(\n twilio_api::types::CreateCallRequestStatusCallbackMethod::Delete,\n ),\n send_digits: Some(\"some-string\".to_string()),\n timeout: Some(4 as i64),\n record: Some(false),\n recording_channels: Some(\"some-string\".to_string()),\n recording_status_callback: Some(\"some-string\".to_string()),\n recording_status_callback_method: Some(\n twilio_api::types::RecordingStatusCallbackMethod::Delete,\n ),\n sip_auth_username: Some(\"some-string\".to_string()),\n sip_auth_password: Some(\"some-string\".to_string()),\n machine_detection: Some(\"some-string\".to_string()),\n machine_detection_timeout: Some(4 as i64),\n recording_status_callback_event: Some(vec![\"some-string\".to_string()]),\n trim: Some(\"some-string\".to_string()),\n caller_id: Some(\"some-string\".to_string()),\n machine_detection_speech_threshold: Some(4 as i64),\n machine_detection_speech_end_threshold: Some(4 as i64),\n machine_detection_silence_timeout: Some(4 as i64),\n async_amd: Some(\"some-string\".to_string()),\n async_amd_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n async_amd_status_callback_method: Some(\n twilio_api::types::AsyncAmdStatusCallbackMethod::Delete,\n ),\n byoc: Some(\"some-string\".to_string()),\n call_reason: Some(\"some-string\".to_string()),\n call_token: Some(\"some-string\".to_string()),\n recording_track: Some(\"some-string\".to_string()),\n time_limit: Some(4 as i64),\n url: Some(\"https://example.com/foo/bar\".to_string()),\n twiml: Some(\"some-string\".to_string()),\n application_sid: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_call<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateCallRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls.json".replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json`.\n\nFetch the call specified by the provided Call SID\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to fetch. (required)\n- `sid: &'astr`: The SID of the Call resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_call() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCall = client\n .default()\n .fetch_call(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_call<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json`.\n\nInitiates a call redirect or terminates a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Call resource to update (required)\n\n```rust,no_run\nasync fn example_default_update_call() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCall = client\n .default()\n .update_call(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateCallRequest {\n url: Some(\"https://example.com/foo/bar\".to_string()),\n method: Some(twilio_api::types::UpdateCallRequestMethod::Delete),\n status: Some(twilio_api::types::CallEnumUpdateStatus::Completed),\n fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n fallback_method: Some(twilio_api::types::FallbackMethod::Delete),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::UpdateCallRequestStatusCallbackMethod::Delete,\n ),\n twiml: Some(\"some-string\".to_string()),\n time_limit: Some(4 as i64),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_call<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateCallRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json`.\n\nDelete a Call record from your account. Once the record is deleted, it will no longer appear in the API and Account Portal logs.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to delete. (required)\n- `sid: &'astr`: The Twilio-provided Call SID that uniquely identifies the Call resource to delete (required)\n\n```rust,no_run\nasync fn example_default_delete_call() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_call(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_call<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Events.json`.\n\nRetrieve a list of all events for a call.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique SID identifier of the Account. (required)\n- `call_sid: &'astr`: The unique SID identifier of the Call. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_call_event() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListCallEventResponse = client\n .default()\n .list_call_event(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_call_event<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Events.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Feedback.json`.\n\nFetch a Feedback resource from a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `call_sid: &'astr`: The call sid that uniquely identifies the call (required)\n\n```rust,no_run\nasync fn example_default_fetch_call_feedback() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallFeedback = client\n .default()\n .fetch_call_feedback(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_call_feedback<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Feedback.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Feedback.json`.\n\nUpdate a Feedback resource for a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `call_sid: &'astr`: The call sid that uniquely identifies the call (required)\n\n```rust,no_run\nasync fn example_default_update_call_feedback() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallFeedback = client\n .default()\n .update_call_feedback(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateCallFeedbackRequest {\n quality_score: Some(4 as i64),\n issue: Some(vec![twilio_api::types::CallFeedbackEnumIssues::UnsolicitedCall]),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_call_feedback<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + body: &crate::types::UpdateCallFeedbackRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Feedback.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary.json`.\n\nCreate a FeedbackSummary resource for a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n\n```rust,no_run\nasync fn example_default_create_call_feedback_summary() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallFeedbackSummary = client\n .default()\n .create_call_feedback_summary(\n \"some-string\",\n &twilio_api::types::CreateCallFeedbackSummaryRequest {\n start_date: chrono::Utc::now().date_naive(),\n end_date: chrono::Utc::now().date_naive(),\n include_subaccounts: Some(false),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateCallFeedbackSummaryRequestStatusCallbackMethod::Delete,\n ),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_call_feedback_summary<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateCallFeedbackSummaryRequest, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary/{Sid}.json`.\n\nFetch a FeedbackSummary resource from a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies this resource. (required)\n\n```rust,no_run\nasync fn example_default_fetch_call_feedback_summary() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallFeedbackSummary = client\n .default()\n .fetch_call_feedback_summary(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_call_feedback_summary<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary/{Sid}.json`.\n\nDelete a FeedbackSummary resource from a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies this resource. (required)\n\n```rust,no_run\nasync fn example_default_delete_call_feedback_summary() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_call_feedback_summary(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_call_feedback_summary<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Notifications/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource to fetch. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the Call Notification resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Call Notification resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_call_notification() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallNotificationInstance = client\n .default()\n .fetch_call_notification(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_call_notification<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Notifications/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Notifications.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resources to read. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the Call Notification resources to read. (required)\n- `log: Option`: Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.\n- `message_date: Option`: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_call_notification() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListCallNotificationResponse = client\n .default()\n .list_call_notification(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(chrono::Utc::now().date_naive()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_call_notification<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + log: Option, + message_date: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Notifications.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = log { + query_params.push(("Log", format!("{}", p))); + } + + if let Some(p) = message_date { + query_params.push(("MessageDate", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json`.\n\nRetrieve a list of recordings belonging to the call used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to read. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. (required)\n- `date_created: Option`: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_call_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListCallRecordingResponse = client\n .default()\n .list_call_recording(\n \"some-string\",\n \"some-string\",\n Some(chrono::Utc::now().date_naive()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_call_recording<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + date_created: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = date_created { + query_params.push(("DateCreated", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json`.\n\nCreate a recording for the call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) to associate the resource with. (required)\n\n```rust,no_run\nasync fn example_default_create_call_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallRecording = client\n .default()\n .create_call_recording(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateCallRecordingRequest {\n recording_status_callback_event: Some(vec![\"some-string\".to_string()]),\n recording_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n recording_status_callback_method: Some(\n twilio_api::types::CreateCallRecordingRequestRecordingStatusCallbackMethod::Delete,\n ),\n trim: Some(\"some-string\".to_string()),\n recording_channels: Some(\"some-string\".to_string()),\n recording_track: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_call_recording<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + body: &crate::types::CreateCallRecordingRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json`.\n\nFetch an instance of a recording for a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource to fetch. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_call_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallRecording = client\n .default()\n .fetch_call_recording(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_call_recording<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json`.\n\nChanges the status of the recording to paused, stopped, or in-progress. Note: Pass `Twilio.CURRENT` instead of recording sid to reference current active recording.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource to update. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_call_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallCallRecording = client\n .default()\n .update_call_recording(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateCallRecordingRequest {\n status: twilio_api::types::CallRecordingEnumStatus::Absent,\n pause_behavior: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_call_recording<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateCallRecordingRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json`.\n\nDelete a recording from your account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to delete. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_call_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_call_recording(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_call_recording<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{Sid}.json`.\n\nFetch an instance of a conference\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference resource(s) to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Conference resource to fetch (required)\n\n```rust,no_run\nasync fn example_default_fetch_conference() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConference = client\n .default()\n .fetch_conference(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_conference<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference resource(s) to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Conference resource to update (required)\n\n```rust,no_run\nasync fn example_default_update_conference() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConference = client\n .default()\n .update_conference(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateConferenceRequest {\n status: Some(twilio_api::types::ConferenceEnumUpdateStatus::Completed),\n announce_url: Some(\"https://example.com/foo/bar\".to_string()),\n announce_method: Some(twilio_api::types::AnnounceMethod::Delete),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_conference<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateConferenceRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Conferences.json`.\n\nRetrieve a list of conferences belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference resource(s) to read. (required)\n- `date_created: Option`: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`.\n- `date_updated: Option`: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`.\n- `friendly_name: Option`: The string that identifies the Conference resources to read.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `status: Option`: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`.\n\n```rust,no_run\nasync fn example_default_list_conference() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListConferenceResponse = client\n .default()\n .list_conference(\n \"some-string\",\n Some(chrono::Utc::now().date_naive()),\n Some(chrono::Utc::now().date_naive()),\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(twilio_api::types::ConferenceEnumStatus::Completed),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_conference<'a>( + &'a self, + account_sid: &'a str, + date_created: Option, + date_updated: Option, + friendly_name: Option, + page: Option, + page_size: Option, + page_token: Option, + status: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = date_created { + query_params.push(("DateCreated", format!("{}", p))); + } + + if let Some(p) = date_updated { + query_params.push(("DateUpdated", format!("{}", p))); + } + + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = status { + query_params.push(("Status", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings/{Sid}.json`.\n\nFetch an instance of a recording for a call\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resource to fetch. (required)\n- `conference_sid: &'astr`: The Conference SID that identifies the conference associated with the recording to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Conference Recording resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_conference_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConferenceConferenceRecording = client\n .default()\n .fetch_conference_recording(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_conference_recording<'a>( + &'a self, + account_sid: &'a str, + conference_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountConferenceConferenceRecording, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings/{Sid}.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{ConferenceSid}", conference_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings/{Sid}.json`.\n\nChanges the status of the recording to paused, stopped, or in-progress. Note: To use `Twilio.CURRENT`, pass it as recording sid.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resource to update. (required)\n- `conference_sid: &'astr`: The Conference SID that identifies the conference associated with the recording to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Conference Recording resource to update. Use `Twilio.CURRENT` to reference the current active recording. (required)\n\n```rust,no_run\nasync fn example_default_update_conference_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConferenceConferenceRecording = client\n .default()\n .update_conference_recording(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateConferenceRecordingRequest {\n status: twilio_api::types::ConferenceRecordingEnumStatus::Absent,\n pause_behavior: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_conference_recording<'a>( + &'a self, + account_sid: &'a str, + conference_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateConferenceRecordingRequest, + ) -> Result< + crate::types::ApiV2010AccountConferenceConferenceRecording, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings/{Sid}.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{ConferenceSid}", conference_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings/{Sid}.json`.\n\nDelete a recording from your account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resources to delete. (required)\n- `conference_sid: &'astr`: The Conference SID that identifies the conference associated with the recording to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Conference Recording resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_conference_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_conference_recording(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_conference_recording<'a>( + &'a self, + account_sid: &'a str, + conference_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings/{Sid}.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{ConferenceSid}", conference_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings.json`.\n\nRetrieve a list of recordings belonging to the call used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resources to read. (required)\n- `conference_sid: &'astr`: The Conference SID that identifies the conference associated with the recording to read. (required)\n- `date_created: Option`: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_conference_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListConferenceRecordingResponse = client\n .default()\n .list_conference_recording(\n \"some-string\",\n \"some-string\",\n Some(chrono::Utc::now().date_naive()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_conference_recording<'a>( + &'a self, + account_sid: &'a str, + conference_sid: &'a str, + date_created: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Recordings.json" + .replace("{AccountSid}", account_sid) + .replace("{ConferenceSid}", conference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = date_created { + query_params.push(("DateCreated", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/ConnectApps/{Sid}.json`.\n\nFetch an instance of a connect-app\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_connect_app() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConnectApp = client\n .default()\n .fetch_connect_app(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_connect_app<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/ConnectApps/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/ConnectApps/{Sid}.json`.\n\nUpdate a connect-app with the specified parameters\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resources to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the ConnectApp resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_connect_app() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConnectApp = client\n .default()\n .update_connect_app(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateConnectAppRequest {\n authorize_redirect_url: Some(\"https://example.com/foo/bar\".to_string()),\n company_name: Some(\"some-string\".to_string()),\n deauthorize_callback_method: Some(\n twilio_api::types::UpdateConnectAppRequestDeauthorizeCallbackMethod::Delete,\n ),\n deauthorize_callback_url: Some(\"https://example.com/foo/bar\".to_string()),\n description: Some(\"some-string\".to_string()),\n friendly_name: Some(\"some-string\".to_string()),\n homepage_url: Some(\"https://example.com/foo/bar\".to_string()),\n permissions: Some(vec![twilio_api::types::ConnectAppEnumPermission::PostAll]),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_connect_app<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateConnectAppRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/ConnectApps/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/ConnectApps/{Sid}.json`.\n\nDelete an instance of a connect-app\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_delete_connect_app() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_connect_app(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_connect_app<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/ConnectApps/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/ConnectApps.json`.\n\nRetrieve a list of connect-apps belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_connect_app() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListConnectAppResponse = client\n .default()\n .list_connect_app(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_connect_app<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/ConnectApps.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Addresses/{AddressSid}/DependentPhoneNumbers.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the DependentPhoneNumber resources to read. (required)\n- `address_sid: &'astr`: The SID of the Address resource associated with the phone number. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_dependent_phone_number() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListDependentPhoneNumberResponse = client\n .default()\n .list_dependent_phone_number(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_dependent_phone_number<'a>( + &'a self, + account_sid: &'a str, + address_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Addresses/{AddressSid}/DependentPhoneNumbers.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{AddressSid}", address_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json`.\n\nFetch an incoming-phone-number belonging to the account used to make the request.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_incoming_phone_number() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountIncomingPhoneNumber = client\n .default()\n .fetch_incoming_phone_number(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_incoming_phone_number<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json`.\n\nUpdate an incoming-phone-number instance.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_incoming_phone_number() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountIncomingPhoneNumber = client\n .default()\n .update_incoming_phone_number(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateIncomingPhoneNumberRequest {\n account_sid: Some(\"some-string\".to_string()),\n api_version: Some(\"some-string\".to_string()),\n friendly_name: Some(\"some-string\".to_string()),\n sms_application_sid: Some(\"some-string\".to_string()),\n sms_fallback_method: Some(\n twilio_api::types::UpdateIncomingPhoneNumberRequestSmsFallbackMethod::Delete,\n ),\n sms_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_method: Some(twilio_api::types::UpdateIncomingPhoneNumberRequestSmsMethod::Delete),\n sms_url: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::UpdateIncomingPhoneNumberRequestStatusCallbackMethod::Delete,\n ),\n voice_application_sid: Some(\"some-string\".to_string()),\n voice_caller_id_lookup: Some(false),\n voice_fallback_method: Some(\n twilio_api::types::UpdateIncomingPhoneNumberRequestVoiceFallbackMethod::Delete,\n ),\n voice_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_method: Some(\n twilio_api::types::UpdateIncomingPhoneNumberRequestVoiceMethod::Delete,\n ),\n voice_url: Some(\"https://example.com/foo/bar\".to_string()),\n emergency_status: Some(\n twilio_api::types::IncomingPhoneNumberEnumEmergencyStatus::Inactive,\n ),\n emergency_address_sid: Some(\"some-string\".to_string()),\n trunk_sid: Some(\"some-string\".to_string()),\n voice_receive_mode: Some(\n twilio_api::types::IncomingPhoneNumberEnumVoiceReceiveMode::Fax,\n ),\n identity_sid: Some(\"some-string\".to_string()),\n address_sid: Some(\"some-string\".to_string()),\n bundle_sid: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_incoming_phone_number<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateIncomingPhoneNumberRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json`.\n\nDelete a phone-numbers belonging to the account used to make the request.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_incoming_phone_number() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_incoming_phone_number(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_incoming_phone_number<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json`.\n\nRetrieve a list of incoming-phone-numbers belonging to the account used to make the request.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resources to read. (required)\n- `beta: Option`: Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `friendly_name: Option`: A string that identifies the IncomingPhoneNumber resources to read.\n- `origin: Option`: Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `phone_number: crate::types::phone_number::PhoneNumber`: The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_incoming_phone_number() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListIncomingPhoneNumberResponse = client\n .default()\n .list_incoming_phone_number(\n \"some-string\",\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_incoming_phone_number<'a>( + &'a self, + account_sid: &'a str, + beta: Option, + friendly_name: Option, + origin: Option, + page: Option, + page_size: Option, + page_token: Option, + phone_number: crate::types::phone_number::PhoneNumber, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = origin { + query_params.push(("Origin", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = phone_number.0 { + query_params.push(("PhoneNumber", format!("{p}"))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json`.\n\nPurchase a phone-number for the account.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_create_incoming_phone_number() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountIncomingPhoneNumber = client\n .default()\n .create_incoming_phone_number(\n \"some-string\",\n &twilio_api::types::CreateIncomingPhoneNumberRequest {\n api_version: Some(\"some-string\".to_string()),\n friendly_name: Some(\"some-string\".to_string()),\n sms_application_sid: Some(\"some-string\".to_string()),\n sms_fallback_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberRequestSmsFallbackMethod::Delete,\n ),\n sms_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_method: Some(twilio_api::types::CreateIncomingPhoneNumberRequestSmsMethod::Delete),\n sms_url: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberRequestStatusCallbackMethod::Delete,\n ),\n voice_application_sid: Some(\"some-string\".to_string()),\n voice_caller_id_lookup: Some(false),\n voice_fallback_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberRequestVoiceFallbackMethod::Delete,\n ),\n voice_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberRequestVoiceMethod::Delete,\n ),\n voice_url: Some(\"https://example.com/foo/bar\".to_string()),\n emergency_status: Some(\n twilio_api::types::IncomingPhoneNumberEnumEmergencyStatus::Inactive,\n ),\n emergency_address_sid: Some(\"some-string\".to_string()),\n trunk_sid: Some(\"some-string\".to_string()),\n identity_sid: Some(\"some-string\".to_string()),\n address_sid: Some(\"some-string\".to_string()),\n voice_receive_mode: Some(\n twilio_api::types::IncomingPhoneNumberEnumVoiceReceiveMode::Fax,\n ),\n bundle_sid: Some(\"some-string\".to_string()),\n phone_number: twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n area_code: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_incoming_phone_number<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateIncomingPhoneNumberRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{Sid}.json`.\n\nFetch an instance of an Add-on installation currently assigned to this Number.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource to fetch. (required)\n- `resource_sid: &'astr`: The SID of the Phone Number to which the Add-on is assigned. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_incoming_phone_number_assigned_add_on() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn =\n client\n .default()\n .fetch_incoming_phone_number_assigned_add_on(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_incoming_phone_number_assigned_add_on<'a>( + &'a self, + account_sid: &'a str, + resource_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/\ + AssignedAddOns/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{ResourceSid}", resource_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{Sid}.json`.\n\nRemove the assignment of an Add-on installation from the Number specified.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resources to delete. (required)\n- `resource_sid: &'astr`: The SID of the Phone Number to which the Add-on is assigned. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_incoming_phone_number_assigned_add_on() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_incoming_phone_number_assigned_add_on(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_incoming_phone_number_assigned_add_on<'a>( + &'a self, + account_sid: &'a str, + resource_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/\ + AssignedAddOns/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{ResourceSid}", resource_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns.json`.\n\nRetrieve a list of Add-on installations currently assigned to this Number.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `resource_sid: &'astr`: The SID of the Phone Number to which the Add-on is assigned. (required)\n\n```rust,no_run\nasync fn example_default_list_incoming_phone_number_assigned_add_on() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListIncomingPhoneNumberAssignedAddOnResponse = client\n .default()\n .list_incoming_phone_number_assigned_add_on(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n \"some-string\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_incoming_phone_number_assigned_add_on<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + resource_sid: &'a str, + ) -> Result< + crate::types::ListIncomingPhoneNumberAssignedAddOnResponse, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/\ + AssignedAddOns.json" + .replace("{AccountSid}", account_sid) + .replace("{ResourceSid}", resource_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns.json`.\n\nAssign an Add-on installation to the Number specified.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `resource_sid: &'astr`: The SID of the Phone Number to assign the Add-on. (required)\n\n```rust,no_run\nasync fn example_default_create_incoming_phone_number_assigned_add_on() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn =\n client\n .default()\n .create_incoming_phone_number_assigned_add_on(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateIncomingPhoneNumberAssignedAddOnRequest {\n installed_add_on_sid: \"some-string\".to_string(),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_incoming_phone_number_assigned_add_on<'a>( + &'a self, + account_sid: &'a str, + resource_sid: &'a str, + body: &crate::types::CreateIncomingPhoneNumberAssignedAddOnRequest, + ) -> Result< + crate::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/\ + AssignedAddOns.json" + .replace("{AccountSid}", account_sid) + .replace("{ResourceSid}", resource_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{AssignedAddOnSid}/Extensions/{Sid}.json`.\n\nFetch an instance of an Extension for the Assigned Add-on.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource to fetch. (required)\n- `assigned_add_on_sid: &'astr`: The SID that uniquely identifies the assigned Add-on installation. (required)\n- `resource_sid: &'astr`: The SID of the Phone Number to which the Add-on is assigned. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_incoming_phone_number_assigned_add_on_extension(\n) -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension = client . default () . fetch_incoming_phone_number_assigned_add_on_extension (\"some-string\" , \"some-string\" , \"some-string\" , \"some-string\" ,) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] pub async fn fetch_incoming_phone_number_assigned_add_on_extension < 'a > (& 'a self , account_sid : & 'a str , assigned_add_on_sid : & 'a str , resource_sid : & 'a str , sid : & 'a str) -> Result < crate :: types :: ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension , crate :: types :: error :: Error >{ + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/\ + AssignedAddOns/{AssignedAddOnSid}/Extensions/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{AssignedAddOnSid}", assigned_add_on_sid) + .replace("{ResourceSid}", resource_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{AssignedAddOnSid}/Extensions.json`.\n\nRetrieve a list of Extensions for the Assigned Add-on.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resources to read. (required)\n- `assigned_add_on_sid: &'astr`: The SID that uniquely identifies the assigned Add-on installation. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `resource_sid: &'astr`: The SID of the Phone Number to which the Add-on is assigned. (required)\n\n```rust,no_run\nasync fn example_default_list_incoming_phone_number_assigned_add_on_extension() -> anyhow::Result<()>\n{\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListIncomingPhoneNumberAssignedAddOnExtensionResponse = client\n .default()\n .list_incoming_phone_number_assigned_add_on_extension(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n \"some-string\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_incoming_phone_number_assigned_add_on_extension<'a>( + &'a self, + account_sid: &'a str, + assigned_add_on_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + resource_sid: &'a str, + ) -> Result< + crate::types::ListIncomingPhoneNumberAssignedAddOnExtensionResponse, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/\ + AssignedAddOns/{AssignedAddOnSid}/Extensions.json" + .replace("{AccountSid}", account_sid) + .replace("{AssignedAddOnSid}", assigned_add_on_sid) + .replace("{ResourceSid}", resource_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Local.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resources to read. (required)\n- `beta: Option`: Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `friendly_name: Option`: A string that identifies the resources to read.\n- `origin: Option`: Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `phone_number: crate::types::phone_number::PhoneNumber`: The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_incoming_phone_number_local() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListIncomingPhoneNumberLocalResponse = client\n .default()\n .list_incoming_phone_number_local(\n \"some-string\",\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_incoming_phone_number_local<'a>( + &'a self, + account_sid: &'a str, + beta: Option, + friendly_name: Option, + origin: Option, + page: Option, + page_size: Option, + page_token: Option, + phone_number: crate::types::phone_number::PhoneNumber, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Local.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = origin { + query_params.push(("Origin", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = phone_number.0 { + query_params.push(("PhoneNumber", format!("{p}"))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Local.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_create_incoming_phone_number_local() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocal = client\n .default()\n .create_incoming_phone_number_local(\n \"some-string\",\n &twilio_api::types::CreateIncomingPhoneNumberLocalRequest {\n phone_number: twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n api_version: Some(\"some-string\".to_string()),\n friendly_name: Some(\"some-string\".to_string()),\n sms_application_sid: Some(\"some-string\".to_string()),\n sms_fallback_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberLocalRequestSmsFallbackMethod::Delete,\n ),\n sms_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberLocalRequestSmsMethod::Delete,\n ),\n sms_url: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberLocalRequestStatusCallbackMethod::Delete,\n ),\n voice_application_sid: Some(\"some-string\".to_string()),\n voice_caller_id_lookup: Some(false),\n voice_fallback_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberLocalRequestVoiceFallbackMethod::Delete,\n ),\n voice_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_method: Some(\n twilio_api::types::CreateIncomingPhoneNumberLocalRequestVoiceMethod::Delete,\n ),\n voice_url: Some(\"https://example.com/foo/bar\".to_string()),\n identity_sid: Some(\"some-string\".to_string()),\n address_sid: Some(\"some-string\".to_string()),\n emergency_status: Some(\n twilio_api::types::IncomingPhoneNumberLocalEnumEmergencyStatus::Inactive,\n ),\n emergency_address_sid: Some(\"some-string\".to_string()),\n trunk_sid: Some(\"some-string\".to_string()),\n voice_receive_mode: Some(\n twilio_api::types::IncomingPhoneNumberLocalEnumVoiceReceiveMode::Fax,\n ),\n bundle_sid: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_incoming_phone_number_local<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateIncomingPhoneNumberLocalRequest, + ) -> Result< + crate::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocal, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Local.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Mobile.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resources to read. (required)\n- `beta: Option`: Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `friendly_name: Option`: A string that identifies the resources to read.\n- `origin: Option`: Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `phone_number: crate::types::phone_number::PhoneNumber`: The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_incoming_phone_number_mobile() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListIncomingPhoneNumberMobileResponse = client\n .default()\n .list_incoming_phone_number_mobile(\n \"some-string\",\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_incoming_phone_number_mobile<'a>( + &'a self, + account_sid: &'a str, + beta: Option, + friendly_name: Option, + origin: Option, + page: Option, + page_size: Option, + page_token: Option, + phone_number: crate::types::phone_number::PhoneNumber, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Mobile.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = origin { + query_params.push(("Origin", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = phone_number.0 { + query_params.push(("PhoneNumber", format!("{p}"))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Mobile.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_create_incoming_phone_number_mobile() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobile = client . default () . create_incoming_phone_number_mobile (\"some-string\" , & twilio_api::types::CreateIncomingPhoneNumberMobileRequest { phone_number : twilio_api::types::phone_number :: PhoneNumber :: from_str (\"+1555-555-5555\") ? , api_version : Some (\"some-string\" . to_string ()) , friendly_name : Some (\"some-string\" . to_string ()) , sms_application_sid : Some (\"some-string\" . to_string ()) , sms_fallback_method : Some (twilio_api::types::CreateIncomingPhoneNumberMobileRequestSmsFallbackMethod :: Delete) , sms_fallback_url : Some (\"https://example.com/foo/bar\" . to_string ()) , sms_method : Some (twilio_api::types::CreateIncomingPhoneNumberMobileRequestSmsMethod :: Delete) , sms_url : Some (\"https://example.com/foo/bar\" . to_string ()) , status_callback : Some (\"https://example.com/foo/bar\" . to_string ()) , status_callback_method : Some (twilio_api::types::CreateIncomingPhoneNumberMobileRequestStatusCallbackMethod :: Delete) , voice_application_sid : Some (\"some-string\" . to_string ()) , voice_caller_id_lookup : Some (false) , voice_fallback_method : Some (twilio_api::types::CreateIncomingPhoneNumberMobileRequestVoiceFallbackMethod :: Delete) , voice_fallback_url : Some (\"https://example.com/foo/bar\" . to_string ()) , voice_method : Some (twilio_api::types::CreateIncomingPhoneNumberMobileRequestVoiceMethod :: Delete) , voice_url : Some (\"https://example.com/foo/bar\" . to_string ()) , identity_sid : Some (\"some-string\" . to_string ()) , address_sid : Some (\"some-string\" . to_string ()) , emergency_status : Some (twilio_api::types::IncomingPhoneNumberMobileEnumEmergencyStatus :: Inactive) , emergency_address_sid : Some (\"some-string\" . to_string ()) , trunk_sid : Some (\"some-string\" . to_string ()) , voice_receive_mode : Some (twilio_api::types::IncomingPhoneNumberMobileEnumVoiceReceiveMode :: Fax) , bundle_sid : Some (\"some-string\" . to_string ()) }) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_incoming_phone_number_mobile<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateIncomingPhoneNumberMobileRequest, + ) -> Result< + crate::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobile, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/Mobile.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/TollFree.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resources to read. (required)\n- `beta: Option`: Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`.\n- `friendly_name: Option`: A string that identifies the resources to read.\n- `origin: Option`: Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `phone_number: crate::types::phone_number::PhoneNumber`: The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_incoming_phone_number_toll_free() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListIncomingPhoneNumberTollFreeResponse = client\n .default()\n .list_incoming_phone_number_toll_free(\n \"some-string\",\n Some(false),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_incoming_phone_number_toll_free<'a>( + &'a self, + account_sid: &'a str, + beta: Option, + friendly_name: Option, + origin: Option, + page: Option, + page_size: Option, + page_token: Option, + phone_number: crate::types::phone_number::PhoneNumber, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/TollFree.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = beta { + query_params.push(("Beta", format!("{}", p))); + } + + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = origin { + query_params.push(("Origin", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = phone_number.0 { + query_params.push(("PhoneNumber", format!("{p}"))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/TollFree.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_create_incoming_phone_number_toll_free() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFree = client . default () . create_incoming_phone_number_toll_free (\"some-string\" , & twilio_api::types::CreateIncomingPhoneNumberTollFreeRequest { phone_number : twilio_api::types::phone_number :: PhoneNumber :: from_str (\"+1555-555-5555\") ? , api_version : Some (\"some-string\" . to_string ()) , friendly_name : Some (\"some-string\" . to_string ()) , sms_application_sid : Some (\"some-string\" . to_string ()) , sms_fallback_method : Some (twilio_api::types::CreateIncomingPhoneNumberTollFreeRequestSmsFallbackMethod :: Delete) , sms_fallback_url : Some (\"https://example.com/foo/bar\" . to_string ()) , sms_method : Some (twilio_api::types::CreateIncomingPhoneNumberTollFreeRequestSmsMethod :: Delete) , sms_url : Some (\"https://example.com/foo/bar\" . to_string ()) , status_callback : Some (\"https://example.com/foo/bar\" . to_string ()) , status_callback_method : Some (twilio_api::types::CreateIncomingPhoneNumberTollFreeRequestStatusCallbackMethod :: Delete) , voice_application_sid : Some (\"some-string\" . to_string ()) , voice_caller_id_lookup : Some (false) , voice_fallback_method : Some (twilio_api::types::CreateIncomingPhoneNumberTollFreeRequestVoiceFallbackMethod :: Delete) , voice_fallback_url : Some (\"https://example.com/foo/bar\" . to_string ()) , voice_method : Some (twilio_api::types::CreateIncomingPhoneNumberTollFreeRequestVoiceMethod :: Delete) , voice_url : Some (\"https://example.com/foo/bar\" . to_string ()) , identity_sid : Some (\"some-string\" . to_string ()) , address_sid : Some (\"some-string\" . to_string ()) , emergency_status : Some (twilio_api::types::IncomingPhoneNumberTollFreeEnumEmergencyStatus :: Inactive) , emergency_address_sid : Some (\"some-string\" . to_string ()) , trunk_sid : Some (\"some-string\" . to_string ()) , voice_receive_mode : Some (twilio_api::types::IncomingPhoneNumberTollFreeEnumVoiceReceiveMode :: Fax) , bundle_sid : Some (\"some-string\" . to_string ()) }) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_incoming_phone_number_toll_free<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateIncomingPhoneNumberTollFreeRequest, + ) -> Result< + crate::types::ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFree, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/TollFree.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Key resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountKey = client\n .default()\n .fetch_key(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_key<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Key resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountKey = client\n .default()\n .update_key(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateKeyRequest {\n friendly_name: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_key<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateKeyRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Key resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_key(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_key<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Keys/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Keys.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListKeyResponse = client\n .default()\n .list_key(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_key<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Keys.json".replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Keys.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Key resource. (required)\n\n```rust,no_run\nasync fn example_default_create_new_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountNewKey = client\n .default()\n .create_new_key(\n \"some-string\",\n &twilio_api::types::CreateNewKeyRequest {\n friendly_name: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_new_key<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateNewKeyRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Keys.json".replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media/{Sid}.json`.\n\nFetch a single media instance belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Media resource(s) to fetch. (required)\n- `message_sid: &'astr`: The SID of the Message resource that this Media resource belongs to. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Media resource to fetch (required)\n\n```rust,no_run\nasync fn example_default_fetch_media() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountMessageMedia = client\n .default()\n .fetch_media(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_media<'a>( + &'a self, + account_sid: &'a str, + message_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{MessageSid}", message_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media/{Sid}.json`.\n\nDelete media from your account. Once delete, you will no longer be billed\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Media resource(s) to delete. (required)\n- `message_sid: &'astr`: The SID of the Message resource that this Media resource belongs to. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Media resource to delete (required)\n\n```rust,no_run\nasync fn example_default_delete_media() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_media(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_media<'a>( + &'a self, + account_sid: &'a str, + message_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{MessageSid}", message_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media.json`.\n\nRetrieve a list of Media resources belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Media resource(s) to read. (required)\n- `date_created: Option>`: Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date.\n- `message_sid: &'astr`: The SID of the Message resource that this Media resource belongs to. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_media() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListMediaResponse = client\n .default()\n .list_media(\n \"some-string\",\n Some(chrono::Utc::now()),\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_media<'a>( + &'a self, + account_sid: &'a str, + date_created: Option>, + message_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media.json" + .replace("{AccountSid}", account_sid) + .replace("{MessageSid}", message_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = date_created { + query_params.push(("DateCreated", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members/{CallSid}.json`.\n\nFetch a specific member from the queue\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to fetch. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to fetch. (required)\n- `queue_sid: &'astr`: The SID of the Queue in which to find the members to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_member() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountQueueMember = client\n .default()\n .fetch_member(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_member<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + queue_sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members/{CallSid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{QueueSid}", queue_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members/{CallSid}.json`.\n\nDequeue a member from a queue and have the member's call begin executing the TwiML document at that URL\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to update. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to update. (required)\n- `queue_sid: &'astr`: The SID of the Queue in which to find the members to update. (required)\n\n```rust,no_run\nasync fn example_default_update_member() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountQueueMember = client\n .default()\n .update_member(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateMemberRequest {\n url: \"https://example.com/foo/bar\".to_string(),\n method: Some(twilio_api::types::UpdateMemberRequestMethod::Delete),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_member<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + queue_sid: &'a str, + body: &crate::types::UpdateMemberRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members/{CallSid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{QueueSid}", queue_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members.json`.\n\nRetrieve the members of the queue\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `queue_sid: &'astr`: The SID of the Queue in which to find the members (required)\n\n```rust,no_run\nasync fn example_default_list_member() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListMemberResponse = client\n .default()\n .list_member(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n \"some-string\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_member<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + queue_sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members.json" + .replace("{AccountSid}", account_sid) + .replace("{QueueSid}", queue_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Messages.json`.\n\nRetrieve a list of messages belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Message resources to read. (required)\n- `date_sent: Option>`: The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date.\n- `from: crate::types::phone_number::PhoneNumber`: Read messages sent from only this phone number or alphanumeric sender ID.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `to: crate::types::phone_number::PhoneNumber`: Read messages sent to only this phone number.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_message() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListMessageResponse = client\n .default()\n .list_message(\n \"some-string\",\n Some(chrono::Utc::now()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_message<'a>( + &'a self, + account_sid: &'a str, + date_sent: Option>, + from: crate::types::phone_number::PhoneNumber, + page: Option, + page_size: Option, + page_token: Option, + to: crate::types::phone_number::PhoneNumber, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = date_sent { + query_params.push(("DateSent", format!("{}", p))); + } + + if let Some(p) = from.0 { + query_params.push(("From", format!("{p}"))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = to.0 { + query_params.push(("To", format!("{p}"))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Messages.json`.\n\nSend a message from the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_create_message() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountMessage = client\n .default()\n .create_message(\n \"some-string\",\n &twilio_api::types::CreateMessageRequest {\n to: twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n application_sid: Some(\"some-string\".to_string()),\n max_price: Some(3.14 as f64),\n provide_feedback: Some(false),\n attempt: Some(4 as i64),\n validity_period: Some(4 as i64),\n force_delivery: Some(false),\n content_retention: Some(twilio_api::types::MessageEnumContentRetention::Retain),\n address_retention: Some(twilio_api::types::MessageEnumAddressRetention::Retain),\n smart_encoded: Some(false),\n persistent_action: Some(vec![\"some-string\".to_string()]),\n shorten_urls: Some(false),\n schedule_type: Some(twilio_api::types::MessageEnumScheduleType::Fixed),\n send_at: Some(chrono::Utc::now()),\n send_as_mms: Some(false),\n content_sid: Some(\"some-string\".to_string()),\n content_variables: Some(\"some-string\".to_string()),\n from: twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n messaging_service_sid: Some(\"some-string\".to_string()),\n body: Some(\"some-string\".to_string()),\n media_url: Some(vec![\"https://example.com/foo/bar\".to_string()]),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_message<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateMessageRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json`.\n\nFetch a message belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Message resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Message resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_message() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountMessage = client\n .default()\n .fetch_message(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_message<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json`.\n\nTo redact a message-body from a post-flight message record, post to the message instance resource with an empty body\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Message resources to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Message resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_message() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountMessage = client\n .default()\n .update_message(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateMessageRequest {\n body: Some(\"some-string\".to_string()),\n status: Some(twilio_api::types::MessageEnumUpdateStatus::Canceled),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_message<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateMessageRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json`.\n\nDeletes a message record from your account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Message resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Message resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_message() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_message(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_message<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Feedback.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `message_sid: &'astr`: The SID of the Message resource for which the feedback was provided. (required)\n\n```rust,no_run\nasync fn example_default_create_message_feedback() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountMessageMessageFeedback = client\n .default()\n .create_message_feedback(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateMessageFeedbackRequest {\n outcome: Some(twilio_api::types::MessageFeedbackEnumOutcome::Unconfirmed),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_message_feedback<'a>( + &'a self, + account_sid: &'a str, + message_sid: &'a str, + body: &crate::types::CreateMessageFeedbackRequest, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Feedback.json" + .replace("{AccountSid}", account_sid) + .replace("{MessageSid}", message_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SigningKeys.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_signing_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSigningKeyResponse = client\n .default()\n .list_signing_key(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_signing_key<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SigningKeys.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SigningKeys.json`.\n\nCreate a new Signing Key for the account making the request.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Key resource. (required)\n\n```rust,no_run\nasync fn example_default_create_new_signing_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountNewSigningKey = client\n .default()\n .create_new_signing_key(\n \"some-string\",\n &twilio_api::types::CreateNewSigningKeyRequest {\n friendly_name: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_new_signing_key<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateNewSigningKeyRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SigningKeys.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Notifications/{Sid}.json`.\n\nFetch a notification belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Notification resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_notification() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountNotificationInstance = client\n .default()\n .fetch_notification(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_notification<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Notifications/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Notifications.json`.\n\nRetrieve a list of notifications belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resources to read. (required)\n- `log: Option`: Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.\n- `message_date: Option`: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_notification() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListNotificationResponse = client\n .default()\n .list_notification(\n \"some-string\",\n Some(4 as i64),\n Some(chrono::Utc::now().date_naive()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_notification<'a>( + &'a self, + account_sid: &'a str, + log: Option, + message_date: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Notifications.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = log { + query_params.push(("Log", format!("{}", p))); + } + + if let Some(p) = message_date { + query_params.push(("MessageDate", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds/{Sid}.json`.\n\nFetch an outgoing-caller-id belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_outgoing_caller_id() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountOutgoingCallerId = client\n .default()\n .fetch_outgoing_caller_id(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_outgoing_caller_id<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds/{Sid}.json`.\n\nUpdates the caller-id\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resources to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_outgoing_caller_id() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountOutgoingCallerId = client\n .default()\n .update_outgoing_caller_id(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateOutgoingCallerIdRequest {\n friendly_name: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_outgoing_caller_id<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateOutgoingCallerIdRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds/{Sid}.json`.\n\nDelete the caller-id specified from the account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_outgoing_caller_id() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_outgoing_caller_id(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_outgoing_caller_id<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json`.\n\nRetrieve a list of outgoing-caller-ids belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resources to read. (required)\n- `friendly_name: Option`: The string that identifies the OutgoingCallerId resources to read.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `phone_number: crate::types::phone_number::PhoneNumber`: The phone number of the OutgoingCallerId resources to read.\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_list_outgoing_caller_id() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListOutgoingCallerIdResponse = client\n .default()\n .list_outgoing_caller_id(\n \"some-string\",\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_outgoing_caller_id<'a>( + &'a self, + account_sid: &'a str, + friendly_name: Option, + page: Option, + page_size: Option, + page_token: Option, + phone_number: crate::types::phone_number::PhoneNumber, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = phone_number.0 { + query_params.push(("PhoneNumber", format!("{p}"))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for the new caller ID resource. (required)\n\n```rust,no_run\nuse std::str::FromStr;\nasync fn example_default_create_validation_request() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountValidationRequest = client\n .default()\n .create_validation_request(\n \"some-string\",\n &twilio_api::types::CreateValidationRequestRequest {\n phone_number: twilio_api::types::phone_number::PhoneNumber::from_str(\"+1555-555-5555\")?,\n friendly_name: Some(\"some-string\".to_string()),\n call_delay: Some(4 as i64),\n extension: Some(\"some-string\".to_string()),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateValidationRequestRequestStatusCallbackMethod::Delete,\n ),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_validation_request<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateValidationRequestRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants/{CallSid}.json`.\n\nFetch an instance of a participant\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resource to fetch. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to fetch. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. (required)\n- `conference_sid: &'astr`: The SID of the conference with the participant to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_participant() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConferenceParticipant = client\n .default()\n .fetch_participant(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_participant<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + conference_sid: &'a str, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants/\ + {CallSid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{ConferenceSid}", conference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants/{CallSid}.json`.\n\nUpdate the properties of the participant\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resources to update. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to update. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. (required)\n- `conference_sid: &'astr`: The SID of the conference with the participant to update. (required)\n\n```rust,no_run\nasync fn example_default_update_participant() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConferenceParticipant = client\n .default()\n .update_participant(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateParticipantRequest {\n muted: Some(false),\n hold: Some(false),\n hold_url: Some(\"https://example.com/foo/bar\".to_string()),\n hold_method: Some(twilio_api::types::HoldMethod::Delete),\n announce_url: Some(\"https://example.com/foo/bar\".to_string()),\n announce_method: Some(twilio_api::types::UpdateParticipantRequestAnnounceMethod::Delete),\n wait_url: Some(\"https://example.com/foo/bar\".to_string()),\n wait_method: Some(twilio_api::types::WaitMethod::Delete),\n beep_on_exit: Some(false),\n end_conference_on_exit: Some(false),\n coaching: Some(false),\n call_sid_to_coach: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_participant<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + conference_sid: &'a str, + body: &crate::types::UpdateParticipantRequest, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants/\ + {CallSid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{ConferenceSid}", conference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants/{CallSid}.json`.\n\nKick a participant from a given conference\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resources to delete. (required)\n- `call_sid: &'astr`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to delete. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. (required)\n- `conference_sid: &'astr`: The SID of the conference with the participants to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_participant() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_participant(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_participant<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + conference_sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants/\ + {CallSid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{ConferenceSid}", conference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants.json`.\n\nRetrieve a list of participants belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resources to read. (required)\n- `coaching: Option`: Whether to return only participants who are coaching another call. Can be: `true` or `false`.\n- `conference_sid: &'astr`: The SID of the conference with the participants to read. (required)\n- `hold: Option`: Whether to return only participants that are on hold. Can be: `true` or `false`.\n- `muted: Option`: Whether to return only participants that are muted. Can be: `true` or `false`.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_participant() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListParticipantResponse = client\n .default()\n .list_participant(\n \"some-string\",\n Some(false),\n \"some-string\",\n Some(false),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_participant<'a>( + &'a self, + account_sid: &'a str, + coaching: Option, + conference_sid: &'a str, + hold: Option, + muted: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants.json" + .replace("{AccountSid}", account_sid) + .replace("{ConferenceSid}", conference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = coaching { + query_params.push(("Coaching", format!("{}", p))); + } + + if let Some(p) = hold { + query_params.push(("Hold", format!("{}", p))); + } + + if let Some(p) = muted { + query_params.push(("Muted", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `conference_sid: &'astr`: The SID of the participant's conference. (required)\n\n```rust,no_run\nasync fn example_default_create_participant() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountConferenceParticipant = client\n .default()\n .create_participant(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateParticipantRequest {\n from: \"some-string\".to_string(),\n to: \"some-string\".to_string(),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateParticipantRequestStatusCallbackMethod::Delete,\n ),\n status_callback_event: Some(vec![\"some-string\".to_string()]),\n label: Some(\"some-string\".to_string()),\n timeout: Some(4 as i64),\n record: Some(false),\n muted: Some(false),\n beep: Some(\"some-string\".to_string()),\n start_conference_on_enter: Some(false),\n end_conference_on_exit: Some(false),\n wait_url: Some(\"https://example.com/foo/bar\".to_string()),\n wait_method: Some(twilio_api::types::WaitMethod::Delete),\n early_media: Some(false),\n max_participants: Some(4 as i64),\n conference_record: Some(\"some-string\".to_string()),\n conference_trim: Some(\"some-string\".to_string()),\n conference_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n conference_status_callback_method: Some(\n twilio_api::types::ConferenceStatusCallbackMethod::Delete,\n ),\n conference_status_callback_event: Some(vec![\"some-string\".to_string()]),\n recording_channels: Some(\"some-string\".to_string()),\n recording_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n recording_status_callback_method: Some(\n twilio_api::types::CreateParticipantRequestRecordingStatusCallbackMethod::Delete,\n ),\n sip_auth_username: Some(\"some-string\".to_string()),\n sip_auth_password: Some(\"some-string\".to_string()),\n region: Some(\"some-string\".to_string()),\n conference_recording_status_callback: Some(\n \"https://example.com/foo/bar\".to_string(),\n ),\n conference_recording_status_callback_method: Some(\n twilio_api::types::ConferenceRecordingStatusCallbackMethod::Delete,\n ),\n recording_status_callback_event: Some(vec![\"some-string\".to_string()]),\n conference_recording_status_callback_event: Some(vec![\"some-string\".to_string()]),\n coaching: Some(false),\n call_sid_to_coach: Some(\"some-string\".to_string()),\n jitter_buffer_size: Some(\"some-string\".to_string()),\n byoc: Some(\"some-string\".to_string()),\n caller_id: Some(\"some-string\".to_string()),\n call_reason: Some(\"some-string\".to_string()),\n recording_track: Some(\"some-string\".to_string()),\n time_limit: Some(4 as i64),\n machine_detection: Some(\"some-string\".to_string()),\n machine_detection_timeout: Some(4 as i64),\n machine_detection_speech_threshold: Some(4 as i64),\n machine_detection_speech_end_threshold: Some(4 as i64),\n machine_detection_silence_timeout: Some(4 as i64),\n amd_status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n amd_status_callback_method: Some(twilio_api::types::AmdStatusCallbackMethod::Delete),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_participant<'a>( + &'a self, + account_sid: &'a str, + conference_sid: &'a str, + body: &crate::types::CreateParticipantRequest, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Conferences/{ConferenceSid}/Participants.json" + .replace("{AccountSid}", account_sid) + .replace("{ConferenceSid}", conference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments.json`.\n\ncreate an instance of payments. This will start a new payments session\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `call_sid: &'astr`: The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF. (required)\n\n```rust,no_run\nasync fn example_default_create_payments() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallPayments = client\n .default()\n .create_payments(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreatePaymentsRequest {\n idempotency_key: \"some-string\".to_string(),\n status_callback: \"https://example.com/foo/bar\".to_string(),\n bank_account_type: Some(\n twilio_api::types::PaymentsEnumBankAccountType::CommercialChecking,\n ),\n charge_amount: Some(3.14 as f64),\n currency: Some(\"some-string\".to_string()),\n description: Some(\"some-string\".to_string()),\n input: Some(\"some-string\".to_string()),\n min_postal_code_length: Some(4 as i64),\n parameter: Some(serde_json::Value::String(\"some-string\".to_string())),\n payment_connector: Some(\"some-string\".to_string()),\n payment_method: Some(twilio_api::types::PaymentsEnumPaymentMethod::AchDebit),\n postal_code: Some(false),\n security_code: Some(false),\n timeout: Some(4 as i64),\n token_type: Some(twilio_api::types::PaymentsEnumTokenType::Reusable),\n valid_card_types: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_payments<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + body: &crate::types::CreatePaymentsRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments/{Sid}.json`.\n\nupdate an instance of payments with different phases of payment flows.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will update the resource. (required)\n- `call_sid: &'astr`: The SID of the call that will update the resource. This should be the same call sid that was used to create payments resource. (required)\n- `sid: &'astr`: The SID of Payments session that needs to be updated. (required)\n\n```rust,no_run\nasync fn example_default_update_payments() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallPayments = client\n .default()\n .update_payments(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdatePaymentsRequest {\n idempotency_key: \"some-string\".to_string(),\n status_callback: \"https://example.com/foo/bar\".to_string(),\n capture: Some(twilio_api::types::PaymentsEnumCapture::BankAccountNumber),\n status: Some(twilio_api::types::PaymentsEnumStatus::Cancel),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_payments<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdatePaymentsRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json`.\n\nFetch an instance of a queue identified by the QueueSid\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Queue resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Queue resource to fetch (required)\n\n```rust,no_run\nasync fn example_default_fetch_queue() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountQueue = client\n .default()\n .fetch_queue(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_queue<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json`.\n\nUpdate the queue with the new parameters\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Queue resource to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Queue resource to update (required)\n\n```rust,no_run\nasync fn example_default_update_queue() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountQueue = client\n .default()\n .update_queue(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateQueueRequest {\n friendly_name: Some(\"some-string\".to_string()),\n max_size: Some(4 as i64),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_queue<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateQueueRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json`.\n\nRemove an empty queue\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Queue resource to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Queue resource to delete (required)\n\n```rust,no_run\nasync fn example_default_delete_queue() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_queue(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_queue<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Queues.json`.\n\nRetrieve a list of queues belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Queue resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_queue() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListQueueResponse = client\n .default()\n .list_queue(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_queue<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Queues.json`.\n\nCreate a queue\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nasync fn example_default_create_queue() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountQueue = client\n .default()\n .create_queue(\n \"some-string\",\n &twilio_api::types::CreateQueueRequest {\n friendly_name: \"some-string\".to_string(),\n max_size: Some(4 as i64),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_queue<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateQueueRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Queues.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{Sid}.json`.\n\nFetch an instance of a recording\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource to fetch. (required)\n- `include_soft_deleted: Option`: A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days.\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountRecording = client\n .default()\n .fetch_recording(\"some-string\", Some(false), \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_recording<'a>( + &'a self, + account_sid: &'a str, + include_soft_deleted: Option, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = include_soft_deleted { + query_params.push(("IncludeSoftDeleted", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{Sid}.json`.\n\nDelete a recording from your account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_recording(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_recording<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings.json`.\n\nRetrieve a list of recordings belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to read. (required)\n- `call_sid: Option`: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read.\n- `conference_sid: Option`: The Conference SID that identifies the conference associated with the recording to read.\n- `date_created: Option>`: Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date.\n- `include_soft_deleted: Option`: A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_recording() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListRecordingResponse = client\n .default()\n .list_recording(\n \"some-string\",\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_recording<'a>( + &'a self, + account_sid: &'a str, + call_sid: Option, + conference_sid: Option, + date_created: Option>, + include_soft_deleted: Option, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = call_sid { + query_params.push(("CallSid", p)); + } + + if let Some(p) = conference_sid { + query_params.push(("ConferenceSid", p)); + } + + if let Some(p) = date_created { + query_params.push(("DateCreated", format!("{}", p))); + } + + if let Some(p) = include_soft_deleted { + query_params.push(("IncludeSoftDeleted", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/{Sid}.json`.\n\nFetch an instance of an AddOnResult\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resource to fetch. (required)\n- `reference_sid: &'astr`: The SID of the recording to which the result to fetch belongs. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_recording_add_on_result() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountRecordingRecordingAddOnResult = client\n .default()\n .fetch_recording_add_on_result(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_recording_add_on_result<'a>( + &'a self, + account_sid: &'a str, + reference_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountRecordingRecordingAddOnResult, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/{Sid}.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{ReferenceSid}", reference_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/{Sid}.json`.\n\nDelete a result and purge all associated Payloads\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resources to delete. (required)\n- `reference_sid: &'astr`: The SID of the recording to which the result to delete belongs. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_recording_add_on_result() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_recording_add_on_result(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_recording_add_on_result<'a>( + &'a self, + account_sid: &'a str, + reference_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/{Sid}.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{ReferenceSid}", reference_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults.json`.\n\nRetrieve a list of results belonging to the recording\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `reference_sid: &'astr`: The SID of the recording to which the result to read belongs. (required)\n\n```rust,no_run\nasync fn example_default_list_recording_add_on_result() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListRecordingAddOnResultResponse = client\n .default()\n .list_recording_add_on_result(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n \"some-string\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_recording_add_on_result<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + reference_sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults.json" + .replace("{AccountSid}", account_sid) + .replace("{ReferenceSid}", reference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/{AddOnResultSid}/Payloads/{Sid}.json`.\n\nFetch an instance of a result payload\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resource to fetch. (required)\n- `add_on_result_sid: &'astr`: The SID of the AddOnResult to which the payload to fetch belongs. (required)\n- `reference_sid: &'astr`: The SID of the recording to which the AddOnResult resource that contains the payload to fetch belongs. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_recording_add_on_result_payload() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountRecordingRecordingAddOnResultRecordingAddOnResultPayload = client . default () . fetch_recording_add_on_result_payload (\"some-string\" , \"some-string\" , \"some-string\" , \"some-string\" ,) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_recording_add_on_result_payload<'a>( + &'a self, + account_sid: &'a str, + add_on_result_sid: &'a str, + reference_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountRecordingRecordingAddOnResultRecordingAddOnResultPayload, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/\ + {AddOnResultSid}/Payloads/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{AddOnResultSid}", add_on_result_sid) + .replace("{ReferenceSid}", reference_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/{AddOnResultSid}/Payloads/{Sid}.json`.\n\nDelete a payload from the result along with all associated Data\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resources to delete. (required)\n- `add_on_result_sid: &'astr`: The SID of the AddOnResult to which the payloads to delete belongs. (required)\n- `reference_sid: &'astr`: The SID of the recording to which the AddOnResult resource that contains the payloads to delete belongs. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_recording_add_on_result_payload() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_recording_add_on_result_payload(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n \"some-string\",\n )\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_recording_add_on_result_payload<'a>( + &'a self, + account_sid: &'a str, + add_on_result_sid: &'a str, + reference_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/\ + {AddOnResultSid}/Payloads/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{AddOnResultSid}", add_on_result_sid) + .replace("{ReferenceSid}", reference_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/{AddOnResultSid}/Payloads.json`.\n\nRetrieve a list of payloads belonging to the AddOnResult\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resources to read. (required)\n- `add_on_result_sid: &'astr`: The SID of the AddOnResult to which the payloads to read belongs. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `reference_sid: &'astr`: The SID of the recording to which the AddOnResult resource that contains the payloads to read belongs. (required)\n\n```rust,no_run\nasync fn example_default_list_recording_add_on_result_payload() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListRecordingAddOnResultPayloadResponse = client\n .default()\n .list_recording_add_on_result_payload(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n \"some-string\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_recording_add_on_result_payload<'a>( + &'a self, + account_sid: &'a str, + add_on_result_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + reference_sid: &'a str, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{ReferenceSid}/AddOnResults/\ + {AddOnResultSid}/Payloads.json" + .replace("{AccountSid}", account_sid) + .replace("{AddOnResultSid}", add_on_result_sid) + .replace("{ReferenceSid}", reference_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource to fetch. (required)\n- `recording_sid: &'astr`: The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) that created the transcription to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Transcription resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_recording_transcription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountRecordingRecordingTranscription = client\n .default()\n .fetch_recording_transcription(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_recording_transcription<'a>( + &'a self, + account_sid: &'a str, + recording_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountRecordingRecordingTranscription, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions/{Sid}.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{RecordingSid}", recording_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. (required)\n- `recording_sid: &'astr`: The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) that created the transcription to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Transcription resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_recording_transcription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_recording_transcription(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_recording_transcription<'a>( + &'a self, + account_sid: &'a str, + recording_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions/{Sid}.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{RecordingSid}", recording_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `recording_sid: &'astr`: The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) that created the transcriptions to read. (required)\n\n```rust,no_run\nasync fn example_default_list_recording_transcription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListRecordingTranscriptionResponse = client\n .default()\n .list_recording_transcription(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n \"some-string\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_recording_transcription<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + recording_sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions.json" + .replace("{AccountSid}", account_sid) + .replace("{RecordingSid}", recording_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json`.\n\nFetch an instance of a short code\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource(s) to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the ShortCode resource to fetch (required)\n\n```rust,no_run\nasync fn example_default_fetch_short_code() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountShortCode = client\n .default()\n .fetch_short_code(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_short_code<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json`.\n\nUpdate a short code with the following parameters\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource(s) to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the ShortCode resource to update (required)\n\n```rust,no_run\nasync fn example_default_update_short_code() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountShortCode = client\n .default()\n .update_short_code(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateShortCodeRequest {\n friendly_name: Some(\"some-string\".to_string()),\n api_version: Some(\"some-string\".to_string()),\n sms_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_method: Some(twilio_api::types::UpdateShortCodeRequestSmsMethod::Delete),\n sms_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n sms_fallback_method: Some(\n twilio_api::types::UpdateShortCodeRequestSmsFallbackMethod::Delete,\n ),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_short_code<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateShortCodeRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes.json`.\n\nRetrieve a list of short-codes belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource(s) to read. (required)\n- `friendly_name: Option`: The string that identifies the ShortCode resources to read.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `short_code: Option`: Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit.\n\n```rust,no_run\nasync fn example_default_list_short_code() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListShortCodeResponse = client\n .default()\n .list_short_code(\n \"some-string\",\n Some(\"some-string\".to_string()),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_short_code<'a>( + &'a self, + account_sid: &'a str, + friendly_name: Option, + page: Option, + page_size: Option, + page_token: Option, + short_code: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = friendly_name { + query_params.push(("FriendlyName", p)); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = short_code { + query_params.push(("ShortCode", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: (required)\n- `sid: &'astr`: (required)\n\n```rust,no_run\nasync fn example_default_fetch_signing_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSigningKey = client\n .default()\n .fetch_signing_key(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_signing_key<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: (required)\n- `sid: &'astr`: (required)\n\n```rust,no_run\nasync fn example_default_update_signing_key() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSigningKey = client\n .default()\n .update_signing_key(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateSigningKeyRequest {\n friendly_name: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_signing_key<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateSigningKeyRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to \ + `/2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json`.\n\n\n\n**Parameters:**\n\\ + n- `account_sid: &'astr`: (required)\n- `sid: &'astr`: \ + (required)\n\n```rust,no_run\nasync fn example_default_delete_signing_key() -> \ + anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n \ + client\n .default()\n .delete_signing_key(\"some-string\", \ + \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_signing_key<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SigningKeys/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/CredentialListMappings.json`.\n\nRetrieve a list of credential list mappings belonging to the domain used in the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resources to read. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_auth_calls_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipAuthCallsCredentialListMappingResponse = client\n .default()\n .list_sip_auth_calls_credential_list_mapping(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_auth_calls_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result< + crate::types::ListSipAuthCallsCredentialListMappingResponse, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + CredentialListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/CredentialListMappings.json`.\n\nCreate a new credential list mapping resource\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that will contain the new resource. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_auth_calls_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsCredentialListMapping = client . default () . create_sip_auth_calls_credential_list_mapping (\"some-string\" , \"some-string\" , & twilio_api::types::CreateSipAuthCallsCredentialListMappingRequest { credential_list_sid : \"some-string\" . to_string () }) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] pub async fn create_sip_auth_calls_credential_list_mapping < 'a > (& 'a self , account_sid : & 'a str , domain_sid : & 'a str , body : & crate :: types :: CreateSipAuthCallsCredentialListMappingRequest) -> Result < crate :: types :: ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsCredentialListMapping , crate :: types :: error :: Error >{ + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + CredentialListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/CredentialListMappings/{Sid}.json`.\n\nFetch a specific instance of a credential list mapping\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the CredentialListMapping resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_auth_calls_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsCredentialListMapping = client . default () . fetch_sip_auth_calls_credential_list_mapping (\"some-string\" , \"some-string\" , \"some-string\" ,) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] pub async fn fetch_sip_auth_calls_credential_list_mapping < 'a > (& 'a self , account_sid : & 'a str , domain_sid : & 'a str , sid : & 'a str) -> Result < crate :: types :: ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsCredentialListMapping , crate :: types :: error :: Error >{ + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + CredentialListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/CredentialListMappings/{Sid}.json`.\n\nDelete a credential list mapping from the requested domain\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resources to delete. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resource to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_auth_calls_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_auth_calls_credential_list_mapping(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_auth_calls_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + CredentialListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/IpAccessControlListMappings.json`.\n\nRetrieve a list of IP Access Control List mappings belonging to the domain used in the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resources to read. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_auth_calls_ip_access_control_list_mapping() -> anyhow::Result<()>\n{\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipAuthCallsIpAccessControlListMappingResponse = client\n .default()\n .list_sip_auth_calls_ip_access_control_list_mapping(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_auth_calls_ip_access_control_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result< + crate::types::ListSipAuthCallsIpAccessControlListMappingResponse, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + IpAccessControlListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/IpAccessControlListMappings.json`.\n\nCreate a new IP Access Control List mapping\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that will contain the new resource. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_auth_calls_ip_access_control_list_mapping() -> anyhow::Result<()>\n{\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsIpAccessControlListMapping = client . default () . create_sip_auth_calls_ip_access_control_list_mapping (\"some-string\" , \"some-string\" , & twilio_api::types::CreateSipAuthCallsIpAccessControlListMappingRequest { ip_access_control_list_sid : \"some-string\" . to_string () }) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] pub async fn create_sip_auth_calls_ip_access_control_list_mapping < 'a > (& 'a self , account_sid : & 'a str , domain_sid : & 'a str , body : & crate :: types :: CreateSipAuthCallsIpAccessControlListMappingRequest) -> Result < crate :: types :: ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsIpAccessControlListMapping , crate :: types :: error :: Error >{ + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + IpAccessControlListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/IpAccessControlListMappings/{Sid}.json`.\n\nFetch a specific instance of an IP Access Control List mapping\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resource to fetch. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_auth_calls_ip_access_control_list_mapping() -> anyhow::Result<()>\n{\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsIpAccessControlListMapping = client . default () . fetch_sip_auth_calls_ip_access_control_list_mapping (\"some-string\" , \"some-string\" , \"some-string\" ,) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] pub async fn fetch_sip_auth_calls_ip_access_control_list_mapping < 'a > (& 'a self , account_sid : & 'a str , domain_sid : & 'a str , sid : & 'a str) -> Result < crate :: types :: ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsIpAccessControlListMapping , crate :: types :: error :: Error >{ + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + IpAccessControlListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/IpAccessControlListMappings/{Sid}.json`.\n\nDelete an IP Access Control List mapping from the requested domain\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resources to delete. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_auth_calls_ip_access_control_list_mapping() -> anyhow::Result<()>\n{\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_auth_calls_ip_access_control_list_mapping(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n )\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_auth_calls_ip_access_control_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Calls/\ + IpAccessControlListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/CredentialListMappings.json`.\n\nRetrieve a list of credential list mappings belonging to the domain used in the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resources to read. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_auth_registrations_credential_list_mapping() -> anyhow::Result<()>\n{\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipAuthRegistrationsCredentialListMappingResponse = client\n .default()\n .list_sip_auth_registrations_credential_list_mapping(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_auth_registrations_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result< + crate::types::ListSipAuthRegistrationsCredentialListMappingResponse, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/\ + CredentialListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/CredentialListMappings.json`.\n\nCreate a new credential list mapping resource\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that will contain the new resource. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_auth_registrations_credential_list_mapping(\n) -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping = client . default () . create_sip_auth_registrations_credential_list_mapping (\"some-string\" , \"some-string\" , & twilio_api::types::CreateSipAuthRegistrationsCredentialListMappingRequest { credential_list_sid : \"some-string\" . to_string () }) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] pub async fn create_sip_auth_registrations_credential_list_mapping < 'a > (& 'a self , account_sid : & 'a str , domain_sid : & 'a str , body : & crate :: types :: CreateSipAuthRegistrationsCredentialListMappingRequest) -> Result < crate :: types :: ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping , crate :: types :: error :: Error >{ + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/\ + CredentialListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/CredentialListMappings/{Sid}.json`.\n\nFetch a specific instance of a credential list mapping\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the CredentialListMapping resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_auth_registrations_credential_list_mapping() -> anyhow::Result<()>\n{\n let client = twilio_api::Client::new_from_env();\n let result : twilio_api::types::ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping = client . default () . fetch_sip_auth_registrations_credential_list_mapping (\"some-string\" , \"some-string\" , \"some-string\" ,) . await ? ;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] pub async fn fetch_sip_auth_registrations_credential_list_mapping < 'a > (& 'a self , account_sid : & 'a str , domain_sid : & 'a str , sid : & 'a str) -> Result < crate :: types :: ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping , crate :: types :: error :: Error >{ + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/\ + CredentialListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/CredentialListMappings/{Sid}.json`.\n\nDelete a credential list mapping from the requested domain\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resources to delete. (required)\n- `domain_sid: &'astr`: The SID of the SIP domain that contains the resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_auth_registrations_credential_list_mapping(\n) -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_auth_registrations_credential_list_mapping(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n )\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_auth_registrations_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/Auth/Registrations/\ + CredentialListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials.json`.\n\nRetrieve a list of credentials.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `credential_list_sid: &'astr`: The unique id that identifies the credential list that contains the desired credentials. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_credential() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipCredentialResponse = client\n .default()\n .list_sip_credential(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_credential<'a>( + &'a self, + account_sid: &'a str, + credential_list_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials.json" + .replace("{AccountSid}", account_sid) + .replace("{CredentialListSid}", credential_list_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to \ + `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials.json`.\n\nCreate a new credential resource.\n\n**Parameters:**\n\n- \ + `account_sid: &'astr`: The unique id of the Account that is responsible for this \ + resource. (required)\n- `credential_list_sid: &'astr`: The unique id that identifies \ + the credential list to include the created credential. \ + (required)\n\n```rust,no_run\nasync fn example_default_create_sip_credential() -> \ + anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let \ + result: twilio_api::types::ApiV2010AccountSipSipCredentialListSipCredential = \ + client\n .default()\n .create_sip_credential(\n \ + \"some-string\",\n \"some-string\",\n \ + &twilio_api::types::CreateSipCredentialRequest {\n username: \ + \"some-string\".to_string(),\n password: \ + \"some-string\".to_string(),\n },\n )\n .await?;\n \ + println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_sip_credential<'a>( + &'a self, + account_sid: &'a str, + credential_list_sid: &'a str, + body: &crate::types::CreateSipCredentialRequest, + ) -> Result< + crate::types::ApiV2010AccountSipSipCredentialListSipCredential, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials.json" + .replace("{AccountSid}", account_sid) + .replace("{CredentialListSid}", credential_list_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to \ + `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials/{Sid}.json`.\n\nFetch a single credential.\n\n**Parameters:**\n\n- \ + `account_sid: &'astr`: The unique id of the Account that is responsible for this \ + resource. (required)\n- `credential_list_sid: &'astr`: The unique id that identifies \ + the credential list that contains the desired credential. (required)\n- `sid: \ + &'astr`: The unique id that identifies the resource to fetch. \ + (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_credential() -> \ + anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let \ + result: twilio_api::types::ApiV2010AccountSipSipCredentialListSipCredential = \ + client\n .default()\n .fetch_sip_credential(\"some-string\", \ + \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", \ + result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_sip_credential<'a>( + &'a self, + account_sid: &'a str, + credential_list_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountSipSipCredentialListSipCredential, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CredentialListSid}", credential_list_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/Credentials/{Sid}.json`.\n\nUpdate a credential resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `credential_list_sid: &'astr`: The unique id that identifies the credential list that includes this credential. (required)\n- `sid: &'astr`: The unique id that identifies the resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_sip_credential() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipCredentialListSipCredential = client\n .default()\n .update_sip_credential(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateSipCredentialRequest {\n password: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_sip_credential<'a>( + &'a self, + account_sid: &'a str, + credential_list_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateSipCredentialRequest, + ) -> Result< + crate::types::ApiV2010AccountSipSipCredentialListSipCredential, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CredentialListSid}", credential_list_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to \ + `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials/{Sid}.json`.\n\nDelete a credential resource.\n\n**Parameters:**\n\n- \ + `account_sid: &'astr`: The unique id of the Account that is responsible for this \ + resource. (required)\n- `credential_list_sid: &'astr`: The unique id that identifies \ + the credential list that contains the desired credentials. (required)\n- `sid: \ + &'astr`: The unique id that identifies the resource to delete. \ + (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_credential() -> \ + anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n \ + client\n .default()\n .delete_sip_credential(\"some-string\", \ + \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_credential<'a>( + &'a self, + account_sid: &'a str, + credential_list_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{CredentialListSid}/\ + Credentials/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CredentialListSid}", credential_list_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists.json`.\n\nGet All Credential Lists\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_credential_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipCredentialListResponse = client\n .default()\n .list_sip_credential_list(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_credential_list<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists.json`.\n\nCreate a Credential List\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_credential_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipCredentialList = client\n .default()\n .create_sip_credential_list(\n \"some-string\",\n &twilio_api::types::CreateSipCredentialListRequest {\n friendly_name: \"some-string\".to_string(),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_sip_credential_list<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateSipCredentialListRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json`.\n\nGet a Credential List\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `sid: &'astr`: The credential list Sid that uniquely identifies this resource (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_credential_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipCredentialList = client\n .default()\n .fetch_sip_credential_list(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_sip_credential_list<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json`.\n\nUpdate a Credential List\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `sid: &'astr`: The credential list Sid that uniquely identifies this resource (required)\n\n```rust,no_run\nasync fn example_default_update_sip_credential_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipCredentialList = client\n .default()\n .update_sip_credential_list(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateSipCredentialListRequest {\n friendly_name: \"some-string\".to_string(),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_sip_credential_list<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateSipCredentialListRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to \ + `/2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json`.\n\nDelete a \ + Credential List\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the \ + Account that is responsible for this resource. (required)\n- `sid: &'astr`: The \ + credential list Sid that uniquely identifies this resource \ + (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_credential_list() \ + -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n \ + client\n .default()\n .delete_sip_credential_list(\"some-string\", \ + \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_credential_list<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/CredentialLists/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings.json`.\n\nRead multiple CredentialListMapping resources from an account.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP Domain that includes the resource to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipCredentialListMappingResponse = client\n .default()\n .list_sip_credential_list_mapping(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings.json`.\n\nCreate a CredentialListMapping resource for an account.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP Domain for which the CredentialList resource will be mapped. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipDomainSipCredentialListMapping = client\n .default()\n .create_sip_credential_list_mapping(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateSipCredentialListMappingRequest {\n credential_list_sid: \"some-string\".to_string(),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_sip_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + body: &crate::types::CreateSipCredentialListMappingRequest, + ) -> Result< + crate::types::ApiV2010AccountSipSipDomainSipCredentialListMapping, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings/{Sid}.json`.\n\nFetch a single CredentialListMapping resource from an account.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP Domain that includes the resource to fetch. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipDomainSipCredentialListMapping = client\n .default()\n .fetch_sip_credential_list_mapping(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_sip_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountSipSipDomainSipCredentialListMapping, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings/\ + {Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings/{Sid}.json`.\n\nDelete a CredentialListMapping resource from an account.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP Domain that includes the resource to delete. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_credential_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_credential_list_mapping(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_credential_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/CredentialListMappings/\ + {Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json`.\n\nRetrieve a list of domains belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_domain() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipDomainResponse = client\n .default()\n .list_sip_domain(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_domain<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json`.\n\nCreate a new Domain\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_domain() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipDomain = client\n .default()\n .create_sip_domain(\n \"some-string\",\n &twilio_api::types::CreateSipDomainRequest {\n domain_name: \"some-string\".to_string(),\n friendly_name: Some(\"some-string\".to_string()),\n voice_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_method: Some(twilio_api::types::CreateSipDomainRequestVoiceMethod::Delete),\n voice_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_fallback_method: Some(\n twilio_api::types::CreateSipDomainRequestVoiceFallbackMethod::Delete,\n ),\n voice_status_callback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_status_callback_method: Some(\n twilio_api::types::CreateSipDomainRequestVoiceStatusCallbackMethod::Delete,\n ),\n sip_registration: Some(false),\n emergency_calling_enabled: Some(false),\n secure: Some(false),\n byoc_trunk_sid: Some(\"some-string\".to_string()),\n emergency_caller_sid: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_sip_domain<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateSipDomainRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json`.\n\nFetch an instance of a Domain\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the SipDomain resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_domain() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipDomain = client\n .default()\n .fetch_sip_domain(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_sip_domain<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json`.\n\nUpdate the attributes of a domain\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resource to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the SipDomain resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_sip_domain() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipDomain = client\n .default()\n .update_sip_domain(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateSipDomainRequest {\n friendly_name: Some(\"some-string\".to_string()),\n voice_fallback_method: Some(\n twilio_api::types::UpdateSipDomainRequestVoiceFallbackMethod::Delete,\n ),\n voice_fallback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_method: Some(twilio_api::types::UpdateSipDomainRequestVoiceMethod::Delete),\n voice_status_callback_method: Some(\n twilio_api::types::UpdateSipDomainRequestVoiceStatusCallbackMethod::Delete,\n ),\n voice_status_callback_url: Some(\"https://example.com/foo/bar\".to_string()),\n voice_url: Some(\"https://example.com/foo/bar\".to_string()),\n sip_registration: Some(false),\n domain_name: Some(\"some-string\".to_string()),\n emergency_calling_enabled: Some(false),\n secure: Some(false),\n byoc_trunk_sid: Some(\"some-string\".to_string()),\n emergency_caller_sid: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_sip_domain<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateSipDomainRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json`.\n\nDelete an instance of a Domain\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the SipDomain resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_domain() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_domain(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_domain<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists.json`.\n\nRetrieve a list of IpAccessControlLists that belong to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_ip_access_control_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipIpAccessControlListResponse = client\n .default()\n .list_sip_ip_access_control_list(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_ip_access_control_list<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists.json`.\n\nCreate a new IpAccessControlList resource\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_ip_access_control_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipIpAccessControlList = client\n .default()\n .create_sip_ip_access_control_list(\n \"some-string\",\n &twilio_api::types::CreateSipIpAccessControlListRequest {\n friendly_name: \"some-string\".to_string(),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_sip_ip_access_control_list<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateSipIpAccessControlListRequest, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{Sid}.json`.\n\nFetch a specific instance of an IpAccessControlList\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_ip_access_control_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipIpAccessControlList = client\n .default()\n .fetch_sip_ip_access_control_list(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_sip_ip_access_control_list<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{Sid}.json`.\n\nRename an IpAccessControlList\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to udpate. (required)\n\n```rust,no_run\nasync fn example_default_update_sip_ip_access_control_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipIpAccessControlList = client\n .default()\n .update_sip_ip_access_control_list(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateSipIpAccessControlListRequest {\n friendly_name: \"some-string\".to_string(),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_sip_ip_access_control_list<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateSipIpAccessControlListRequest, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{Sid}.json`.\n\nDelete an IpAccessControlList from the requested account\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_ip_access_control_list() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_ip_access_control_list(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_ip_access_control_list<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/IpAccessControlListMappings/{Sid}.json`.\n\nFetch an IpAccessControlListMapping resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP domain. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_ip_access_control_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipDomainSipIpAccessControlListMapping = client\n .default()\n .fetch_sip_ip_access_control_list_mapping(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_sip_ip_access_control_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountSipSipDomainSipIpAccessControlListMapping, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/\ + IpAccessControlListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/IpAccessControlListMappings/{Sid}.json`.\n\nDelete an IpAccessControlListMapping resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP domain. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_ip_access_control_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_ip_access_control_list_mapping(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_ip_access_control_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/\ + IpAccessControlListMappings/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/IpAccessControlListMappings.json`.\n\nRetrieve a list of IpAccessControlListMapping resources.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP domain. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_ip_access_control_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipIpAccessControlListMappingResponse = client\n .default()\n .list_sip_ip_access_control_list_mapping(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_ip_access_control_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/\ + IpAccessControlListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/IpAccessControlListMappings.json`.\n\nCreate a new IpAccessControlListMapping resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the Account that is responsible for this resource. (required)\n- `domain_sid: &'astr`: A 34 character string that uniquely identifies the SIP domain. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_ip_access_control_list_mapping() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipDomainSipIpAccessControlListMapping = client\n .default()\n .create_sip_ip_access_control_list_mapping(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateSipIpAccessControlListMappingRequest {\n ip_access_control_list_sid: \"some-string\".to_string(),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_sip_ip_access_control_list_mapping<'a>( + &'a self, + account_sid: &'a str, + domain_sid: &'a str, + body: &crate::types::CreateSipIpAccessControlListMappingRequest, + ) -> Result< + crate::types::ApiV2010AccountSipSipDomainSipIpAccessControlListMapping, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/Domains/{DomainSid}/\ + IpAccessControlListMappings.json" + .replace("{AccountSid}", account_sid) + .replace("{DomainSid}", domain_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{IpAccessControlListSid}/IpAddresses.json`.\n\nRead multiple IpAddress resources.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `ip_access_control_list_sid: &'astr`: The IpAccessControlList Sid that identifies the IpAddress resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_sip_ip_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListSipIpAddressResponse = client\n .default()\n .list_sip_ip_address(\n \"some-string\",\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_sip_ip_address<'a>( + &'a self, + account_sid: &'a str, + ip_access_control_list_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/\ + {IpAccessControlListSid}/IpAddresses.json" + .replace("{AccountSid}", account_sid) + .replace("{IpAccessControlListSid}", ip_access_control_list_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{IpAccessControlListSid}/IpAddresses.json`.\n\nCreate a new IpAddress resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `ip_access_control_list_sid: &'astr`: The IpAccessControlList Sid with which to associate the created IpAddress resource. (required)\n\n```rust,no_run\nasync fn example_default_create_sip_ip_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipIpAccessControlListSipIpAddress = client\n .default()\n .create_sip_ip_address(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateSipIpAddressRequest {\n friendly_name: \"some-string\".to_string(),\n ip_address: \"some-string\".to_string(),\n cidr_prefix_length: Some(4 as i64),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_sip_ip_address<'a>( + &'a self, + account_sid: &'a str, + ip_access_control_list_sid: &'a str, + body: &crate::types::CreateSipIpAddressRequest, + ) -> Result< + crate::types::ApiV2010AccountSipSipIpAccessControlListSipIpAddress, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/\ + {IpAccessControlListSid}/IpAddresses.json" + .replace("{AccountSid}", account_sid) + .replace("{IpAccessControlListSid}", ip_access_control_list_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{IpAccessControlListSid}/IpAddresses/{Sid}.json`.\n\nRead one IpAddress resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `ip_access_control_list_sid: &'astr`: The IpAccessControlList Sid that identifies the IpAddress resources to fetch. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the IpAddress resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_sip_ip_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipIpAccessControlListSipIpAddress = client\n .default()\n .fetch_sip_ip_address(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_sip_ip_address<'a>( + &'a self, + account_sid: &'a str, + ip_access_control_list_sid: &'a str, + sid: &'a str, + ) -> Result< + crate::types::ApiV2010AccountSipSipIpAccessControlListSipIpAddress, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/\ + {IpAccessControlListSid}/IpAddresses/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{IpAccessControlListSid}", ip_access_control_list_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{IpAccessControlListSid}/IpAddresses/{Sid}.json`.\n\nUpdate an IpAddress resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `ip_access_control_list_sid: &'astr`: The IpAccessControlList Sid that identifies the IpAddress resources to update. (required)\n- `sid: &'astr`: A 34 character string that identifies the IpAddress resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_sip_ip_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountSipSipIpAccessControlListSipIpAddress = client\n .default()\n .update_sip_ip_address(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateSipIpAddressRequest {\n ip_address: Some(\"some-string\".to_string()),\n friendly_name: Some(\"some-string\".to_string()),\n cidr_prefix_length: Some(4 as i64),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_sip_ip_address<'a>( + &'a self, + account_sid: &'a str, + ip_access_control_list_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateSipIpAddressRequest, + ) -> Result< + crate::types::ApiV2010AccountSipSipIpAccessControlListSipIpAddress, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/\ + {IpAccessControlListSid}/IpAddresses/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{IpAccessControlListSid}", ip_access_control_list_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/{IpAccessControlListSid}/IpAddresses/{Sid}.json`.\n\nDelete an IpAddress resource.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. (required)\n- `ip_access_control_list_sid: &'astr`: The IpAccessControlList Sid that identifies the IpAddress resources to delete. (required)\n- `sid: &'astr`: A 34 character string that uniquely identifies the resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_sip_ip_address() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_sip_ip_address(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_sip_ip_address<'a>( + &'a self, + account_sid: &'a str, + ip_access_control_list_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/SIP/IpAccessControlLists/\ + {IpAccessControlListSid}/IpAddresses/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{IpAccessControlListSid}", ip_access_control_list_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Siprec.json`.\n\nCreate a Siprec\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Siprec resource. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Siprec resource is associated with. (required)\n\n```rust,no_run\nasync fn example_default_create_siprec() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallSiprec = client\n .default()\n .create_siprec(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateSiprecRequest {\n name: Some(\"some-string\".to_string()),\n connector_name: Some(\"some-string\".to_string()),\n track: Some(twilio_api::types::SiprecEnumTrack::BothTracks),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateSiprecRequestStatusCallbackMethod::Delete,\n ),\n parameter_1_name: Some(\"some-string\".to_string()),\n parameter_1_value: Some(\"some-string\".to_string()),\n parameter_2_name: Some(\"some-string\".to_string()),\n parameter_2_value: Some(\"some-string\".to_string()),\n parameter_3_name: Some(\"some-string\".to_string()),\n parameter_3_value: Some(\"some-string\".to_string()),\n parameter_4_name: Some(\"some-string\".to_string()),\n parameter_4_value: Some(\"some-string\".to_string()),\n parameter_5_name: Some(\"some-string\".to_string()),\n parameter_5_value: Some(\"some-string\".to_string()),\n parameter_6_name: Some(\"some-string\".to_string()),\n parameter_6_value: Some(\"some-string\".to_string()),\n parameter_7_name: Some(\"some-string\".to_string()),\n parameter_7_value: Some(\"some-string\".to_string()),\n parameter_8_name: Some(\"some-string\".to_string()),\n parameter_8_value: Some(\"some-string\".to_string()),\n parameter_9_name: Some(\"some-string\".to_string()),\n parameter_9_value: Some(\"some-string\".to_string()),\n parameter_10_name: Some(\"some-string\".to_string()),\n parameter_10_value: Some(\"some-string\".to_string()),\n parameter_11_name: Some(\"some-string\".to_string()),\n parameter_11_value: Some(\"some-string\".to_string()),\n parameter_12_name: Some(\"some-string\".to_string()),\n parameter_12_value: Some(\"some-string\".to_string()),\n parameter_13_name: Some(\"some-string\".to_string()),\n parameter_13_value: Some(\"some-string\".to_string()),\n parameter_14_name: Some(\"some-string\".to_string()),\n parameter_14_value: Some(\"some-string\".to_string()),\n parameter_15_name: Some(\"some-string\".to_string()),\n parameter_15_value: Some(\"some-string\".to_string()),\n parameter_16_name: Some(\"some-string\".to_string()),\n parameter_16_value: Some(\"some-string\".to_string()),\n parameter_17_name: Some(\"some-string\".to_string()),\n parameter_17_value: Some(\"some-string\".to_string()),\n parameter_18_name: Some(\"some-string\".to_string()),\n parameter_18_value: Some(\"some-string\".to_string()),\n parameter_19_name: Some(\"some-string\".to_string()),\n parameter_19_value: Some(\"some-string\".to_string()),\n parameter_20_name: Some(\"some-string\".to_string()),\n parameter_20_value: Some(\"some-string\".to_string()),\n parameter_21_name: Some(\"some-string\".to_string()),\n parameter_21_value: Some(\"some-string\".to_string()),\n parameter_22_name: Some(\"some-string\".to_string()),\n parameter_22_value: Some(\"some-string\".to_string()),\n parameter_23_name: Some(\"some-string\".to_string()),\n parameter_23_value: Some(\"some-string\".to_string()),\n parameter_24_name: Some(\"some-string\".to_string()),\n parameter_24_value: Some(\"some-string\".to_string()),\n parameter_25_name: Some(\"some-string\".to_string()),\n parameter_25_value: Some(\"some-string\".to_string()),\n parameter_26_name: Some(\"some-string\".to_string()),\n parameter_26_value: Some(\"some-string\".to_string()),\n parameter_27_name: Some(\"some-string\".to_string()),\n parameter_27_value: Some(\"some-string\".to_string()),\n parameter_28_name: Some(\"some-string\".to_string()),\n parameter_28_value: Some(\"some-string\".to_string()),\n parameter_29_name: Some(\"some-string\".to_string()),\n parameter_29_value: Some(\"some-string\".to_string()),\n parameter_30_name: Some(\"some-string\".to_string()),\n parameter_30_value: Some(\"some-string\".to_string()),\n parameter_31_name: Some(\"some-string\".to_string()),\n parameter_31_value: Some(\"some-string\".to_string()),\n parameter_32_name: Some(\"some-string\".to_string()),\n parameter_32_value: Some(\"some-string\".to_string()),\n parameter_33_name: Some(\"some-string\".to_string()),\n parameter_33_value: Some(\"some-string\".to_string()),\n parameter_34_name: Some(\"some-string\".to_string()),\n parameter_34_value: Some(\"some-string\".to_string()),\n parameter_35_name: Some(\"some-string\".to_string()),\n parameter_35_value: Some(\"some-string\".to_string()),\n parameter_36_name: Some(\"some-string\".to_string()),\n parameter_36_value: Some(\"some-string\".to_string()),\n parameter_37_name: Some(\"some-string\".to_string()),\n parameter_37_value: Some(\"some-string\".to_string()),\n parameter_38_name: Some(\"some-string\".to_string()),\n parameter_38_value: Some(\"some-string\".to_string()),\n parameter_39_name: Some(\"some-string\".to_string()),\n parameter_39_value: Some(\"some-string\".to_string()),\n parameter_40_name: Some(\"some-string\".to_string()),\n parameter_40_value: Some(\"some-string\".to_string()),\n parameter_41_name: Some(\"some-string\".to_string()),\n parameter_41_value: Some(\"some-string\".to_string()),\n parameter_42_name: Some(\"some-string\".to_string()),\n parameter_42_value: Some(\"some-string\".to_string()),\n parameter_43_name: Some(\"some-string\".to_string()),\n parameter_43_value: Some(\"some-string\".to_string()),\n parameter_44_name: Some(\"some-string\".to_string()),\n parameter_44_value: Some(\"some-string\".to_string()),\n parameter_45_name: Some(\"some-string\".to_string()),\n parameter_45_value: Some(\"some-string\".to_string()),\n parameter_46_name: Some(\"some-string\".to_string()),\n parameter_46_value: Some(\"some-string\".to_string()),\n parameter_47_name: Some(\"some-string\".to_string()),\n parameter_47_value: Some(\"some-string\".to_string()),\n parameter_48_name: Some(\"some-string\".to_string()),\n parameter_48_value: Some(\"some-string\".to_string()),\n parameter_49_name: Some(\"some-string\".to_string()),\n parameter_49_value: Some(\"some-string\".to_string()),\n parameter_50_name: Some(\"some-string\".to_string()),\n parameter_50_value: Some(\"some-string\".to_string()),\n parameter_51_name: Some(\"some-string\".to_string()),\n parameter_51_value: Some(\"some-string\".to_string()),\n parameter_52_name: Some(\"some-string\".to_string()),\n parameter_52_value: Some(\"some-string\".to_string()),\n parameter_53_name: Some(\"some-string\".to_string()),\n parameter_53_value: Some(\"some-string\".to_string()),\n parameter_54_name: Some(\"some-string\".to_string()),\n parameter_54_value: Some(\"some-string\".to_string()),\n parameter_55_name: Some(\"some-string\".to_string()),\n parameter_55_value: Some(\"some-string\".to_string()),\n parameter_56_name: Some(\"some-string\".to_string()),\n parameter_56_value: Some(\"some-string\".to_string()),\n parameter_57_name: Some(\"some-string\".to_string()),\n parameter_57_value: Some(\"some-string\".to_string()),\n parameter_58_name: Some(\"some-string\".to_string()),\n parameter_58_value: Some(\"some-string\".to_string()),\n parameter_59_name: Some(\"some-string\".to_string()),\n parameter_59_value: Some(\"some-string\".to_string()),\n parameter_60_name: Some(\"some-string\".to_string()),\n parameter_60_value: Some(\"some-string\".to_string()),\n parameter_61_name: Some(\"some-string\".to_string()),\n parameter_61_value: Some(\"some-string\".to_string()),\n parameter_62_name: Some(\"some-string\".to_string()),\n parameter_62_value: Some(\"some-string\".to_string()),\n parameter_63_name: Some(\"some-string\".to_string()),\n parameter_63_value: Some(\"some-string\".to_string()),\n parameter_64_name: Some(\"some-string\".to_string()),\n parameter_64_value: Some(\"some-string\".to_string()),\n parameter_65_name: Some(\"some-string\".to_string()),\n parameter_65_value: Some(\"some-string\".to_string()),\n parameter_66_name: Some(\"some-string\".to_string()),\n parameter_66_value: Some(\"some-string\".to_string()),\n parameter_67_name: Some(\"some-string\".to_string()),\n parameter_67_value: Some(\"some-string\".to_string()),\n parameter_68_name: Some(\"some-string\".to_string()),\n parameter_68_value: Some(\"some-string\".to_string()),\n parameter_69_name: Some(\"some-string\".to_string()),\n parameter_69_value: Some(\"some-string\".to_string()),\n parameter_70_name: Some(\"some-string\".to_string()),\n parameter_70_value: Some(\"some-string\".to_string()),\n parameter_71_name: Some(\"some-string\".to_string()),\n parameter_71_value: Some(\"some-string\".to_string()),\n parameter_72_name: Some(\"some-string\".to_string()),\n parameter_72_value: Some(\"some-string\".to_string()),\n parameter_73_name: Some(\"some-string\".to_string()),\n parameter_73_value: Some(\"some-string\".to_string()),\n parameter_74_name: Some(\"some-string\".to_string()),\n parameter_74_value: Some(\"some-string\".to_string()),\n parameter_75_name: Some(\"some-string\".to_string()),\n parameter_75_value: Some(\"some-string\".to_string()),\n parameter_76_name: Some(\"some-string\".to_string()),\n parameter_76_value: Some(\"some-string\".to_string()),\n parameter_77_name: Some(\"some-string\".to_string()),\n parameter_77_value: Some(\"some-string\".to_string()),\n parameter_78_name: Some(\"some-string\".to_string()),\n parameter_78_value: Some(\"some-string\".to_string()),\n parameter_79_name: Some(\"some-string\".to_string()),\n parameter_79_value: Some(\"some-string\".to_string()),\n parameter_80_name: Some(\"some-string\".to_string()),\n parameter_80_value: Some(\"some-string\".to_string()),\n parameter_81_name: Some(\"some-string\".to_string()),\n parameter_81_value: Some(\"some-string\".to_string()),\n parameter_82_name: Some(\"some-string\".to_string()),\n parameter_82_value: Some(\"some-string\".to_string()),\n parameter_83_name: Some(\"some-string\".to_string()),\n parameter_83_value: Some(\"some-string\".to_string()),\n parameter_84_name: Some(\"some-string\".to_string()),\n parameter_84_value: Some(\"some-string\".to_string()),\n parameter_85_name: Some(\"some-string\".to_string()),\n parameter_85_value: Some(\"some-string\".to_string()),\n parameter_86_name: Some(\"some-string\".to_string()),\n parameter_86_value: Some(\"some-string\".to_string()),\n parameter_87_name: Some(\"some-string\".to_string()),\n parameter_87_value: Some(\"some-string\".to_string()),\n parameter_88_name: Some(\"some-string\".to_string()),\n parameter_88_value: Some(\"some-string\".to_string()),\n parameter_89_name: Some(\"some-string\".to_string()),\n parameter_89_value: Some(\"some-string\".to_string()),\n parameter_90_name: Some(\"some-string\".to_string()),\n parameter_90_value: Some(\"some-string\".to_string()),\n parameter_91_name: Some(\"some-string\".to_string()),\n parameter_91_value: Some(\"some-string\".to_string()),\n parameter_92_name: Some(\"some-string\".to_string()),\n parameter_92_value: Some(\"some-string\".to_string()),\n parameter_93_name: Some(\"some-string\".to_string()),\n parameter_93_value: Some(\"some-string\".to_string()),\n parameter_94_name: Some(\"some-string\".to_string()),\n parameter_94_value: Some(\"some-string\".to_string()),\n parameter_95_name: Some(\"some-string\".to_string()),\n parameter_95_value: Some(\"some-string\".to_string()),\n parameter_96_name: Some(\"some-string\".to_string()),\n parameter_96_value: Some(\"some-string\".to_string()),\n parameter_97_name: Some(\"some-string\".to_string()),\n parameter_97_value: Some(\"some-string\".to_string()),\n parameter_98_name: Some(\"some-string\".to_string()),\n parameter_98_value: Some(\"some-string\".to_string()),\n parameter_99_name: Some(\"some-string\".to_string()),\n parameter_99_value: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_siprec<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + body: &crate::types::CreateSiprecRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Siprec.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Siprec/{Sid}.json`.\n\nStop a Siprec using either the SID of the Siprec resource or the `name` used when creating the resource\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Siprec resource. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Siprec resource is associated with. (required)\n- `sid: &'astr`: The SID of the Siprec resource, or the `name` used when creating the resource (required)\n\n```rust,no_run\nasync fn example_default_update_siprec() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallSiprec = client\n .default()\n .update_siprec(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateSiprecRequest {\n status: twilio_api::types::SiprecEnumUpdateStatus::Stopped,\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_siprec<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateSiprecRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Siprec/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Streams.json`.\n\nCreate a Stream\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. (required)\n\n```rust,no_run\nasync fn example_default_create_stream() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallStream = client\n .default()\n .create_stream(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateStreamRequest {\n url: \"https://example.com/foo/bar\".to_string(),\n name: Some(\"some-string\".to_string()),\n track: Some(twilio_api::types::StreamEnumTrack::BothTracks),\n status_callback: Some(\"https://example.com/foo/bar\".to_string()),\n status_callback_method: Some(\n twilio_api::types::CreateStreamRequestStatusCallbackMethod::Delete,\n ),\n parameter_1_name: Some(\"some-string\".to_string()),\n parameter_1_value: Some(\"some-string\".to_string()),\n parameter_2_name: Some(\"some-string\".to_string()),\n parameter_2_value: Some(\"some-string\".to_string()),\n parameter_3_name: Some(\"some-string\".to_string()),\n parameter_3_value: Some(\"some-string\".to_string()),\n parameter_4_name: Some(\"some-string\".to_string()),\n parameter_4_value: Some(\"some-string\".to_string()),\n parameter_5_name: Some(\"some-string\".to_string()),\n parameter_5_value: Some(\"some-string\".to_string()),\n parameter_6_name: Some(\"some-string\".to_string()),\n parameter_6_value: Some(\"some-string\".to_string()),\n parameter_7_name: Some(\"some-string\".to_string()),\n parameter_7_value: Some(\"some-string\".to_string()),\n parameter_8_name: Some(\"some-string\".to_string()),\n parameter_8_value: Some(\"some-string\".to_string()),\n parameter_9_name: Some(\"some-string\".to_string()),\n parameter_9_value: Some(\"some-string\".to_string()),\n parameter_10_name: Some(\"some-string\".to_string()),\n parameter_10_value: Some(\"some-string\".to_string()),\n parameter_11_name: Some(\"some-string\".to_string()),\n parameter_11_value: Some(\"some-string\".to_string()),\n parameter_12_name: Some(\"some-string\".to_string()),\n parameter_12_value: Some(\"some-string\".to_string()),\n parameter_13_name: Some(\"some-string\".to_string()),\n parameter_13_value: Some(\"some-string\".to_string()),\n parameter_14_name: Some(\"some-string\".to_string()),\n parameter_14_value: Some(\"some-string\".to_string()),\n parameter_15_name: Some(\"some-string\".to_string()),\n parameter_15_value: Some(\"some-string\".to_string()),\n parameter_16_name: Some(\"some-string\".to_string()),\n parameter_16_value: Some(\"some-string\".to_string()),\n parameter_17_name: Some(\"some-string\".to_string()),\n parameter_17_value: Some(\"some-string\".to_string()),\n parameter_18_name: Some(\"some-string\".to_string()),\n parameter_18_value: Some(\"some-string\".to_string()),\n parameter_19_name: Some(\"some-string\".to_string()),\n parameter_19_value: Some(\"some-string\".to_string()),\n parameter_20_name: Some(\"some-string\".to_string()),\n parameter_20_value: Some(\"some-string\".to_string()),\n parameter_21_name: Some(\"some-string\".to_string()),\n parameter_21_value: Some(\"some-string\".to_string()),\n parameter_22_name: Some(\"some-string\".to_string()),\n parameter_22_value: Some(\"some-string\".to_string()),\n parameter_23_name: Some(\"some-string\".to_string()),\n parameter_23_value: Some(\"some-string\".to_string()),\n parameter_24_name: Some(\"some-string\".to_string()),\n parameter_24_value: Some(\"some-string\".to_string()),\n parameter_25_name: Some(\"some-string\".to_string()),\n parameter_25_value: Some(\"some-string\".to_string()),\n parameter_26_name: Some(\"some-string\".to_string()),\n parameter_26_value: Some(\"some-string\".to_string()),\n parameter_27_name: Some(\"some-string\".to_string()),\n parameter_27_value: Some(\"some-string\".to_string()),\n parameter_28_name: Some(\"some-string\".to_string()),\n parameter_28_value: Some(\"some-string\".to_string()),\n parameter_29_name: Some(\"some-string\".to_string()),\n parameter_29_value: Some(\"some-string\".to_string()),\n parameter_30_name: Some(\"some-string\".to_string()),\n parameter_30_value: Some(\"some-string\".to_string()),\n parameter_31_name: Some(\"some-string\".to_string()),\n parameter_31_value: Some(\"some-string\".to_string()),\n parameter_32_name: Some(\"some-string\".to_string()),\n parameter_32_value: Some(\"some-string\".to_string()),\n parameter_33_name: Some(\"some-string\".to_string()),\n parameter_33_value: Some(\"some-string\".to_string()),\n parameter_34_name: Some(\"some-string\".to_string()),\n parameter_34_value: Some(\"some-string\".to_string()),\n parameter_35_name: Some(\"some-string\".to_string()),\n parameter_35_value: Some(\"some-string\".to_string()),\n parameter_36_name: Some(\"some-string\".to_string()),\n parameter_36_value: Some(\"some-string\".to_string()),\n parameter_37_name: Some(\"some-string\".to_string()),\n parameter_37_value: Some(\"some-string\".to_string()),\n parameter_38_name: Some(\"some-string\".to_string()),\n parameter_38_value: Some(\"some-string\".to_string()),\n parameter_39_name: Some(\"some-string\".to_string()),\n parameter_39_value: Some(\"some-string\".to_string()),\n parameter_40_name: Some(\"some-string\".to_string()),\n parameter_40_value: Some(\"some-string\".to_string()),\n parameter_41_name: Some(\"some-string\".to_string()),\n parameter_41_value: Some(\"some-string\".to_string()),\n parameter_42_name: Some(\"some-string\".to_string()),\n parameter_42_value: Some(\"some-string\".to_string()),\n parameter_43_name: Some(\"some-string\".to_string()),\n parameter_43_value: Some(\"some-string\".to_string()),\n parameter_44_name: Some(\"some-string\".to_string()),\n parameter_44_value: Some(\"some-string\".to_string()),\n parameter_45_name: Some(\"some-string\".to_string()),\n parameter_45_value: Some(\"some-string\".to_string()),\n parameter_46_name: Some(\"some-string\".to_string()),\n parameter_46_value: Some(\"some-string\".to_string()),\n parameter_47_name: Some(\"some-string\".to_string()),\n parameter_47_value: Some(\"some-string\".to_string()),\n parameter_48_name: Some(\"some-string\".to_string()),\n parameter_48_value: Some(\"some-string\".to_string()),\n parameter_49_name: Some(\"some-string\".to_string()),\n parameter_49_value: Some(\"some-string\".to_string()),\n parameter_50_name: Some(\"some-string\".to_string()),\n parameter_50_value: Some(\"some-string\".to_string()),\n parameter_51_name: Some(\"some-string\".to_string()),\n parameter_51_value: Some(\"some-string\".to_string()),\n parameter_52_name: Some(\"some-string\".to_string()),\n parameter_52_value: Some(\"some-string\".to_string()),\n parameter_53_name: Some(\"some-string\".to_string()),\n parameter_53_value: Some(\"some-string\".to_string()),\n parameter_54_name: Some(\"some-string\".to_string()),\n parameter_54_value: Some(\"some-string\".to_string()),\n parameter_55_name: Some(\"some-string\".to_string()),\n parameter_55_value: Some(\"some-string\".to_string()),\n parameter_56_name: Some(\"some-string\".to_string()),\n parameter_56_value: Some(\"some-string\".to_string()),\n parameter_57_name: Some(\"some-string\".to_string()),\n parameter_57_value: Some(\"some-string\".to_string()),\n parameter_58_name: Some(\"some-string\".to_string()),\n parameter_58_value: Some(\"some-string\".to_string()),\n parameter_59_name: Some(\"some-string\".to_string()),\n parameter_59_value: Some(\"some-string\".to_string()),\n parameter_60_name: Some(\"some-string\".to_string()),\n parameter_60_value: Some(\"some-string\".to_string()),\n parameter_61_name: Some(\"some-string\".to_string()),\n parameter_61_value: Some(\"some-string\".to_string()),\n parameter_62_name: Some(\"some-string\".to_string()),\n parameter_62_value: Some(\"some-string\".to_string()),\n parameter_63_name: Some(\"some-string\".to_string()),\n parameter_63_value: Some(\"some-string\".to_string()),\n parameter_64_name: Some(\"some-string\".to_string()),\n parameter_64_value: Some(\"some-string\".to_string()),\n parameter_65_name: Some(\"some-string\".to_string()),\n parameter_65_value: Some(\"some-string\".to_string()),\n parameter_66_name: Some(\"some-string\".to_string()),\n parameter_66_value: Some(\"some-string\".to_string()),\n parameter_67_name: Some(\"some-string\".to_string()),\n parameter_67_value: Some(\"some-string\".to_string()),\n parameter_68_name: Some(\"some-string\".to_string()),\n parameter_68_value: Some(\"some-string\".to_string()),\n parameter_69_name: Some(\"some-string\".to_string()),\n parameter_69_value: Some(\"some-string\".to_string()),\n parameter_70_name: Some(\"some-string\".to_string()),\n parameter_70_value: Some(\"some-string\".to_string()),\n parameter_71_name: Some(\"some-string\".to_string()),\n parameter_71_value: Some(\"some-string\".to_string()),\n parameter_72_name: Some(\"some-string\".to_string()),\n parameter_72_value: Some(\"some-string\".to_string()),\n parameter_73_name: Some(\"some-string\".to_string()),\n parameter_73_value: Some(\"some-string\".to_string()),\n parameter_74_name: Some(\"some-string\".to_string()),\n parameter_74_value: Some(\"some-string\".to_string()),\n parameter_75_name: Some(\"some-string\".to_string()),\n parameter_75_value: Some(\"some-string\".to_string()),\n parameter_76_name: Some(\"some-string\".to_string()),\n parameter_76_value: Some(\"some-string\".to_string()),\n parameter_77_name: Some(\"some-string\".to_string()),\n parameter_77_value: Some(\"some-string\".to_string()),\n parameter_78_name: Some(\"some-string\".to_string()),\n parameter_78_value: Some(\"some-string\".to_string()),\n parameter_79_name: Some(\"some-string\".to_string()),\n parameter_79_value: Some(\"some-string\".to_string()),\n parameter_80_name: Some(\"some-string\".to_string()),\n parameter_80_value: Some(\"some-string\".to_string()),\n parameter_81_name: Some(\"some-string\".to_string()),\n parameter_81_value: Some(\"some-string\".to_string()),\n parameter_82_name: Some(\"some-string\".to_string()),\n parameter_82_value: Some(\"some-string\".to_string()),\n parameter_83_name: Some(\"some-string\".to_string()),\n parameter_83_value: Some(\"some-string\".to_string()),\n parameter_84_name: Some(\"some-string\".to_string()),\n parameter_84_value: Some(\"some-string\".to_string()),\n parameter_85_name: Some(\"some-string\".to_string()),\n parameter_85_value: Some(\"some-string\".to_string()),\n parameter_86_name: Some(\"some-string\".to_string()),\n parameter_86_value: Some(\"some-string\".to_string()),\n parameter_87_name: Some(\"some-string\".to_string()),\n parameter_87_value: Some(\"some-string\".to_string()),\n parameter_88_name: Some(\"some-string\".to_string()),\n parameter_88_value: Some(\"some-string\".to_string()),\n parameter_89_name: Some(\"some-string\".to_string()),\n parameter_89_value: Some(\"some-string\".to_string()),\n parameter_90_name: Some(\"some-string\".to_string()),\n parameter_90_value: Some(\"some-string\".to_string()),\n parameter_91_name: Some(\"some-string\".to_string()),\n parameter_91_value: Some(\"some-string\".to_string()),\n parameter_92_name: Some(\"some-string\".to_string()),\n parameter_92_value: Some(\"some-string\".to_string()),\n parameter_93_name: Some(\"some-string\".to_string()),\n parameter_93_value: Some(\"some-string\".to_string()),\n parameter_94_name: Some(\"some-string\".to_string()),\n parameter_94_value: Some(\"some-string\".to_string()),\n parameter_95_name: Some(\"some-string\".to_string()),\n parameter_95_value: Some(\"some-string\".to_string()),\n parameter_96_name: Some(\"some-string\".to_string()),\n parameter_96_value: Some(\"some-string\".to_string()),\n parameter_97_name: Some(\"some-string\".to_string()),\n parameter_97_value: Some(\"some-string\".to_string()),\n parameter_98_name: Some(\"some-string\".to_string()),\n parameter_98_value: Some(\"some-string\".to_string()),\n parameter_99_name: Some(\"some-string\".to_string()),\n parameter_99_value: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_stream<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + body: &crate::types::CreateStreamRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Streams.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Streams/{Sid}.json`.\n\nStop a Stream using either the SID of the Stream resource or the `name` used when creating the resource\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. (required)\n- `sid: &'astr`: The SID of the Stream resource, or the `name` used when creating the resource (required)\n\n```rust,no_run\nasync fn example_default_update_stream() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallStream = client\n .default()\n .update_stream(\n \"some-string\",\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateStreamRequest {\n status: twilio_api::types::StreamEnumUpdateStatus::Stopped,\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_stream<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateStreamRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Streams/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Tokens.json`.\n\nCreate a new token for ICE servers\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nasync fn example_default_create_token() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountToken = client\n .default()\n .create_token(\n \"some-string\",\n &twilio_api::types::CreateTokenRequest {\n ttl: Some(4 as i64),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_token<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateTokenRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Tokens.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Transcriptions/{Sid}.json`.\n\nFetch an instance of a Transcription\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Transcription resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_transcription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountTranscription = client\n .default()\n .fetch_transcription(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_transcription<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Transcriptions/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Transcriptions/{Sid}.json`.\n\nDelete a transcription from the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the Transcription resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_transcription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_transcription(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_transcription<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Transcriptions/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Transcriptions.json`.\n\nRetrieve a list of transcriptions belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n\n```rust,no_run\nasync fn example_default_list_transcription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListTranscriptionResponse = client\n .default()\n .list_transcription(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_transcription<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Transcriptions.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records.json`.\n\nRetrieve a list of usage-records belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordResponse = client\n .default()\n .list_usage_record(\n \"some-string\",\n Some(twilio_api::types::UsageRecordEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/AllTime.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_all_time() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordAllTimeResponse = client\n .default()\n .list_usage_record_all_time(\n \"some-string\",\n Some(twilio_api::types::UsageRecordAllTimeEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_all_time<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/AllTime.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/Daily.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_daily() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordDailyResponse = client\n .default()\n .list_usage_record_daily(\n \"some-string\",\n Some(twilio_api::types::UsageRecordDailyEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_daily<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/Daily.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/LastMonth.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_last_month() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordLastMonthResponse = client\n .default()\n .list_usage_record_last_month(\n \"some-string\",\n Some(twilio_api::types::UsageRecordLastMonthEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_last_month<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/LastMonth.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/Monthly.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_monthly() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordMonthlyResponse = client\n .default()\n .list_usage_record_monthly(\n \"some-string\",\n Some(twilio_api::types::UsageRecordMonthlyEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_monthly<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/Monthly.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/ThisMonth.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_this_month() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordThisMonthResponse = client\n .default()\n .list_usage_record_this_month(\n \"some-string\",\n Some(twilio_api::types::UsageRecordThisMonthEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_this_month<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/ThisMonth.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/Today.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_today() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordTodayResponse = client\n .default()\n .list_usage_record_today(\n \"some-string\",\n Some(twilio_api::types::UsageRecordTodayEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_today<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/Today.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/Yearly.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_yearly() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordYearlyResponse = client\n .default()\n .list_usage_record_yearly(\n \"some-string\",\n Some(twilio_api::types::UsageRecordYearlyEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_yearly<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/Yearly.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Records/Yesterday.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. (required)\n- `category: Option`: The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.\n- `end_date: Option`: Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.\n- `include_subaccounts: Option`: Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `start_date: Option`: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.\n\n```rust,no_run\nasync fn example_default_list_usage_record_yesterday() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageRecordYesterdayResponse = client\n .default()\n .list_usage_record_yesterday(\n \"some-string\",\n Some(twilio_api::types::UsageRecordYesterdayEnumCategory::WirelessOrdersStarter),\n Some(chrono::Utc::now().date_naive()),\n Some(false),\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_record_yesterday<'a>( + &'a self, + account_sid: &'a str, + category: Option, + end_date: Option, + include_subaccounts: Option, + page: Option, + page_size: Option, + page_token: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Records/Yesterday.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = category { + query_params.push(("Category", format!("{}", p))); + } + + if let Some(p) = end_date { + query_params.push(("EndDate", format!("{}", p))); + } + + if let Some(p) = include_subaccounts { + query_params.push(("IncludeSubaccounts", format!("{}", p))); + } + + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = start_date { + query_params.push(("StartDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json`.\n\nFetch and instance of a usage-trigger\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resource to fetch. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the UsageTrigger resource to fetch. (required)\n\n```rust,no_run\nasync fn example_default_fetch_usage_trigger() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountUsageUsageTrigger = client\n .default()\n .fetch_usage_trigger(\"some-string\", \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn fetch_usage_trigger<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json`.\n\nUpdate an instance of a usage trigger\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resources to update. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the UsageTrigger resource to update. (required)\n\n```rust,no_run\nasync fn example_default_update_usage_trigger() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountUsageUsageTrigger = client\n .default()\n .update_usage_trigger(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::UpdateUsageTriggerRequest {\n callback_method: Some(\n twilio_api::types::UpdateUsageTriggerRequestCallbackMethod::Delete,\n ),\n callback_url: Some(\"https://example.com/foo/bar\".to_string()),\n friendly_name: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn update_usage_trigger<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + body: &crate::types::UpdateUsageTriggerRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json`.\n\n\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resources to delete. (required)\n- `sid: &'astr`: The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. (required)\n\n```rust,no_run\nasync fn example_default_delete_usage_trigger() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_usage_trigger(\"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_usage_trigger<'a>( + &'a self, + account_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `GET` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json`.\n\nRetrieve a list of usage-triggers belonging to the account used to make the request\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resources to read. (required)\n- `page: Option`: The page index. This value is simply for client state.\n- `page_size: Option`: How many resources to return in each list page. The default is 50, and the maximum is 1000.\n- `page_token: Option`: The page token. This is provided by the API.\n- `recurring: Option`: The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers.\n- `trigger_by: Option`: The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price).\n- `usage_category: Option`: The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories).\n\n```rust,no_run\nasync fn example_default_list_usage_trigger() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ListUsageTriggerResponse = client\n .default()\n .list_usage_trigger(\n \"some-string\",\n Some(4 as i64),\n Some(4 as i64),\n Some(\"some-string\".to_string()),\n Some(twilio_api::types::UsageTriggerEnumRecurring::Alltime),\n Some(twilio_api::types::UsageTriggerEnumTriggerField::Price),\n Some(twilio_api::types::UsageTriggerEnumUsageCategory::WirelessOrdersStarter),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn list_usage_trigger<'a>( + &'a self, + account_sid: &'a str, + page: Option, + page_size: Option, + page_token: Option, + recurring: Option, + trigger_by: Option, + usage_category: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let mut query_params = vec![]; + if let Some(p) = page { + query_params.push(("Page", format!("{}", p))); + } + + if let Some(p) = page_size { + query_params.push(("PageSize", format!("{}", p))); + } + + if let Some(p) = page_token { + query_params.push(("PageToken", p)); + } + + if let Some(p) = recurring { + query_params.push(("Recurring", format!("{}", p))); + } + + if let Some(p) = trigger_by { + query_params.push(("TriggerBy", format!("{}", p))); + } + + if let Some(p) = usage_category { + query_params.push(("UsageCategory", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json`.\n\nCreate a new UsageTrigger\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. (required)\n\n```rust,no_run\nasync fn example_default_create_usage_trigger() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountUsageUsageTrigger = client\n .default()\n .create_usage_trigger(\n \"some-string\",\n &twilio_api::types::CreateUsageTriggerRequest {\n callback_url: \"https://example.com/foo/bar\".to_string(),\n trigger_value: \"some-string\".to_string(),\n usage_category: twilio_api::types::UsageTriggerEnumUsageCategory::WirelessOrdersStarter,\n callback_method: Some(\n twilio_api::types::CreateUsageTriggerRequestCallbackMethod::Delete,\n ),\n friendly_name: Some(\"some-string\".to_string()),\n recurring: Some(twilio_api::types::UsageTriggerEnumRecurring::Alltime),\n trigger_by: Some(twilio_api::types::UsageTriggerEnumTriggerField::Price),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_usage_trigger<'a>( + &'a self, + account_sid: &'a str, + body: &crate::types::CreateUsageTriggerRequest, + ) -> Result { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json" + .replace("{AccountSid}", account_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessages.json`.\n\nCreate a new User Defined Message for the given Call SID.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created User Defined Message. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message is associated with. (required)\n\n```rust,no_run\nasync fn example_default_create_user_defined_message() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallUserDefinedMessage = client\n .default()\n .create_user_defined_message(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateUserDefinedMessageRequest {\n content: \"some-string\".to_string(),\n idempotency_key: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_user_defined_message<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + body: &crate::types::CreateUserDefinedMessageRequest, + ) -> Result + { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessages.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `POST` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions.json`.\n\nSubscribe to User Defined Messages for a given Call SID.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Messages subscription is associated with. This refers to the Call SID that is producing the user defined messages. (required)\n\n```rust,no_run\nasync fn example_default_create_user_defined_message_subscription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n let result: twilio_api::types::ApiV2010AccountCallUserDefinedMessageSubscription = client\n .default()\n .create_user_defined_message_subscription(\n \"some-string\",\n \"some-string\",\n &twilio_api::types::CreateUserDefinedMessageSubscriptionRequest {\n callback: \"https://example.com/foo/bar\".to_string(),\n idempotency_key: Some(\"some-string\".to_string()),\n method: Some(\n twilio_api::types::CreateUserDefinedMessageSubscriptionRequestMethod::Delete,\n ),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn create_user_defined_message_subscription<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + body: &crate::types::CreateUserDefinedMessageSubscriptionRequest, + ) -> Result< + crate::types::ApiV2010AccountCallUserDefinedMessageSubscription, + crate::types::error::Error, + > { + let mut req = self.client.client.request( + http::Method::POST, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions.\ + json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + req = req.form(body); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "Perform a `DELETE` request to `/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions/{Sid}.json`.\n\nDelete a specific User Defined Message Subscription.\n\n**Parameters:**\n\n- `account_sid: &'astr`: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. (required)\n- `call_sid: &'astr`: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message Subscription is associated with. This refers to the Call SID that is producing the User Defined Messages. (required)\n- `sid: &'astr`: The SID that uniquely identifies this User Defined Message Subscription. (required)\n\n```rust,no_run\nasync fn example_default_delete_user_defined_message_subscription() -> anyhow::Result<()> {\n let client = twilio_api::Client::new_from_env();\n client\n .default()\n .delete_user_defined_message_subscription(\"some-string\", \"some-string\", \"some-string\")\n .await?;\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn delete_user_defined_message_subscription<'a>( + &'a self, + account_sid: &'a str, + call_sid: &'a str, + sid: &'a str, + ) -> Result<(), crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::DELETE, + &format!( + "{}/{}", + self.client.base_url, + "2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessageSubscriptions/\ + {Sid}.json" + .replace("{AccountSid}", account_sid) + .replace("{CallSid}", call_sid) + .replace("{Sid}", sid) + ), + ); + req = req.basic_auth(&self.client.username, Some(&self.client.password)); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + Ok(()) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } +} diff --git a/twilio/src/types.rs b/twilio/src/types.rs new file mode 100644 index 0000000..9f3e914 --- /dev/null +++ b/twilio/src/types.rs @@ -0,0 +1,43273 @@ +#![doc = r" This module contains the generated types for the library."] +pub mod base64 { + #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"] + #![doc = " base64 implementations to account for various clients and libraries. Compatible"] + #![doc = " with serde and JsonSchema."] + use std::{convert::TryFrom, fmt}; + + use serde::{ + de::{Error, Unexpected, Visitor}, + Deserialize, Deserializer, Serialize, Serializer, + }; + static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[ + data_encoding::BASE64, + data_encoding::BASE64URL, + data_encoding::BASE64URL_NOPAD, + data_encoding::BASE64_MIME, + data_encoding::BASE64_NOPAD, + ]; + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"] + #[doc = " when deserializing, will decode from many different types of base64 possible."] + pub struct Base64Data(pub Vec); + impl Base64Data { + #[doc = " Return is the data is empty."] + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + } + + impl fmt::Display for Base64Data { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0)) + } + } + + impl From for Vec { + fn from(data: Base64Data) -> Vec { + data.0 + } + } + + impl From> for Base64Data { + fn from(data: Vec) -> Base64Data { + Base64Data(data) + } + } + + impl AsRef<[u8]> for Base64Data { + fn as_ref(&self) -> &[u8] { + &self.0 + } + } + + impl TryFrom<&str> for Base64Data { + type Error = anyhow::Error; + fn try_from(v: &str) -> Result { + for config in ALLOWED_DECODING_FORMATS { + if let Ok(data) = config.decode(v.as_bytes()) { + return Ok(Base64Data(data)); + } + } + anyhow::bail!("Could not decode base64 data: {}", v); + } + } + + struct Base64DataVisitor; + impl<'de> Visitor<'de> for Base64DataVisitor { + type Value = Base64Data; + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a base64 encoded string") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + for config in ALLOWED_DECODING_FORMATS { + if let Ok(data) = config.decode(v.as_bytes()) { + return Ok(Base64Data(data)); + } + } + Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self)) + } + } + + impl<'de> Deserialize<'de> for Base64Data { + fn deserialize(deserializer: D) -> Result>::Error> + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(Base64DataVisitor) + } + } + + impl Serialize for Base64Data { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0); + serializer.serialize_str(&encoded) + } + } + + impl schemars::JsonSchema for Base64Data { + fn schema_name() -> String { + "Base64Data".to_string() + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let mut obj = gen.root_schema_for::().schema; + obj.format = Some("byte".to_string()); + schemars::schema::Schema::Object(obj) + } + + fn is_referenceable() -> bool { + false + } + } + + #[cfg(test)] + mod tests { + use std::convert::TryFrom; + + use super::Base64Data; + #[test] + fn test_base64_try_from() { + assert!(Base64Data::try_from("aGVsbG8=").is_ok()); + assert!(Base64Data::try_from("abcdefghij").is_err()); + } + } +} + +#[cfg(feature = "requests")] +pub mod multipart { + #![doc = " Multipart form data types."] + #[doc = " An attachement to a multipart form."] + #[derive(Debug, Clone, PartialEq, Eq, Hash)] + pub struct Attachment { + #[doc = " The name of the field."] + pub name: String, + #[doc = " The filename of the attachment."] + pub filename: Option, + #[doc = " The content type of the attachment."] + pub content_type: Option, + #[doc = " The data of the attachment."] + pub data: Vec, + } + + impl std::convert::TryFrom for reqwest::multipart::Part { + type Error = reqwest::Error; + fn try_from(attachment: Attachment) -> Result { + let mut part = reqwest::multipart::Part::bytes(attachment.data); + if let Some(filename) = attachment.filename { + part = part.file_name(filename); + } + if let Some(content_type) = attachment.content_type { + part = part.mime_str(&content_type)?; + } + Ok(part) + } + } + + impl std::convert::TryFrom for Attachment { + type Error = std::io::Error; + fn try_from(path: std::path::PathBuf) -> Result { + let filename = path + .file_name() + .ok_or_else(|| { + std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename") + })? + .to_str() + .ok_or_else(|| { + std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename") + })? + .to_string(); + let content_type = mime_guess::from_path(&path).first_raw(); + let data = std::fs::read(path)?; + Ok(Attachment { + name: "file".to_string(), + filename: Some(filename), + content_type: content_type.map(|s| s.to_string()), + data, + }) + } + } +} + +#[cfg(feature = "requests")] +pub mod paginate { + #![doc = " Utility functions used for pagination."] + use anyhow::Result; + #[doc = " A trait for types that allow pagination."] + pub trait Pagination { + #[doc = " The item that is paginated."] + type Item: serde::de::DeserializeOwned; + #[doc = " Returns true if the response has more pages."] + fn has_more_pages(&self) -> bool; + #[doc = " Returns the next page token."] + fn next_page_token(&self) -> Option; + #[doc = " Modify a request to get the next page."] + fn next_page( + &self, + req: reqwest::Request, + ) -> Result; + #[doc = " Get the items from a page."] + fn items(&self) -> Vec; + } +} + +pub mod phone_number { + #![doc = " A library to implement phone numbers for our database and JSON serialization and \ + deserialization."] + use std::str::FromStr; + + use schemars::JsonSchema; + #[doc = " A phone number."] + #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)] + pub struct PhoneNumber(pub Option); + impl From for PhoneNumber { + fn from(id: phonenumber::PhoneNumber) -> PhoneNumber { + PhoneNumber(Some(id)) + } + } + + impl AsRef> for PhoneNumber { + fn as_ref(&self) -> &Option { + &self.0 + } + } + + impl std::ops::Deref for PhoneNumber { + type Target = Option; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + impl serde::ser::Serialize for PhoneNumber { + fn serialize(&self, serializer: S) -> Result + where + S: serde::ser::Serializer, + { + serializer.serialize_str(&self.to_string()) + } + } + + impl<'de> serde::de::Deserialize<'de> for PhoneNumber { + fn deserialize(deserializer: D) -> Result + where + D: serde::de::Deserializer<'de>, + { + let s = String::deserialize(deserializer).unwrap_or_default(); + PhoneNumber::from_str(&s).map_err(serde::de::Error::custom) + } + } + + impl std::str::FromStr for PhoneNumber { + type Err = anyhow::Error; + fn from_str(s: &str) -> Result { + if s.trim().is_empty() { + return Ok(PhoneNumber(None)); + } + let s = if !s.trim().starts_with('+') { + format!("+1{s}") + } else { + s.to_string() + } + .replace(['-', '(', ')', ' '], ""); + Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err( + |e| anyhow::anyhow!("invalid phone number `{}`: {}", s, e), + )?))) + } + } + + impl std::fmt::Display for PhoneNumber { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let s = if let Some(phone) = &self.0 { + phone + .format() + .mode(phonenumber::Mode::International) + .to_string() + } else { + String::new() + }; + write!(f, "{}", s) + } + } + + impl JsonSchema for PhoneNumber { + fn schema_name() -> String { + "PhoneNumber".to_string() + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let mut obj = gen.root_schema_for::().schema; + obj.format = Some("phone".to_string()); + schemars::schema::Schema::Object(obj) + } + + fn is_referenceable() -> bool { + false + } + } + + #[cfg(test)] + mod test { + use pretty_assertions::assert_eq; + + use super::PhoneNumber; + #[test] + fn test_parse_phone_number() { + let mut phone = "+1-555-555-5555"; + let mut phone_parsed: PhoneNumber = + serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); + assert_eq!(phone_parsed, expected); + let mut expected_str = "+1 555-555-5555"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "555-555-5555"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "+1 555-555-5555"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "5555555555"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "(510) 864-1234"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap())); + assert_eq!(phone_parsed, expected); + expected_str = "+1 510-864-1234"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "(510)8641234"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + expected_str = "+1 510-864-1234"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = ""; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, PhoneNumber(None)); + assert_eq!("", serde_json::json!(phone_parsed)); + phone = "+49 30 1234 1234"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); + assert_eq!(phone_parsed, expected); + expected_str = "+49 30 12341234"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + } + } +} + +#[cfg(feature = "requests")] +pub mod error { + #![doc = " Error methods."] + #[doc = " Error produced by generated client methods."] + pub enum Error { + #[doc = " The request did not conform to API requirements."] + InvalidRequest(String), + #[cfg(feature = "retry")] + #[doc = " A server error either due to the data, or with the connection."] + CommunicationError(reqwest_middleware::Error), + #[doc = " A request error, caused when building the request."] + RequestError(reqwest::Error), + #[doc = " An expected response whose deserialization failed."] + SerdeError { + #[doc = " The error."] + error: format_serde_error::SerdeError, + #[doc = " The response status."] + status: reqwest::StatusCode, + }, + #[doc = " An expected error response."] + InvalidResponsePayload { + #[cfg(feature = "retry")] + #[doc = " The error."] + error: reqwest_middleware::Error, + #[cfg(not(feature = "retry"))] + #[doc = " The error."] + error: reqwest::Error, + #[doc = " The full response."] + response: reqwest::Response, + }, + #[doc = " An error from the server."] + Server { + #[doc = " The text from the body."] + body: String, + #[doc = " The response status."] + status: reqwest::StatusCode, + }, + #[doc = " A response not listed in the API description. This may represent a"] + #[doc = " success or failure response; check `status().is_success()`."] + UnexpectedResponse(reqwest::Response), + } + + impl Error { + #[doc = " Returns the status code, if the error was generated from a response."] + pub fn status(&self) -> Option { + match self { + Error::InvalidRequest(_) => None, + Error::RequestError(e) => e.status(), + #[cfg(feature = "retry")] + Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(), + #[cfg(feature = "retry")] + Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None, + Error::SerdeError { error: _, status } => Some(*status), + Error::InvalidResponsePayload { error: _, response } => Some(response.status()), + Error::Server { body: _, status } => Some(*status), + Error::UnexpectedResponse(r) => Some(r.status()), + } + } + + #[doc = " Creates a new error from a response status and a serde error."] + pub fn from_serde_error( + e: format_serde_error::SerdeError, + status: reqwest::StatusCode, + ) -> Self { + Self::SerdeError { error: e, status } + } + } + + #[cfg(feature = "retry")] + impl From for Error { + fn from(e: reqwest_middleware::Error) -> Self { + Self::CommunicationError(e) + } + } + + impl From for Error { + fn from(e: reqwest::Error) -> Self { + Self::RequestError(e) + } + } + + impl From for Error { + fn from(e: serde_json::Error) -> Self { + Self::SerdeError { + error: format_serde_error::SerdeError::new(String::new(), e), + status: reqwest::StatusCode::INTERNAL_SERVER_ERROR, + } + } + } + + impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Error::InvalidRequest(s) => { + write!(f, "Invalid Request: {}", s) + } + #[cfg(feature = "retry")] + Error::CommunicationError(e) => { + write!(f, "Communication Error: {}", e) + } + Error::RequestError(e) => { + write!(f, "Request Error: {}", e) + } + Error::SerdeError { error, status: _ } => { + write!(f, "Serde Error: {}", error) + } + Error::InvalidResponsePayload { error, response: _ } => { + write!(f, "Invalid Response Payload: {}", error) + } + Error::Server { body, status } => { + write!(f, "Server Error: {} {}", status, body) + } + Error::UnexpectedResponse(r) => { + write!(f, "Unexpected Response: {:?}", r) + } + } + } + } + + impl std::fmt::Debug for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self, f) + } + } + + impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + #[cfg(feature = "retry")] + Error::CommunicationError(e) => Some(e), + Error::SerdeError { error, status: _ } => Some(error), + Error::InvalidResponsePayload { error, response: _ } => Some(error), + _ => None, + } + } + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct SubresourceUris {} + +impl std::fmt::Display for SubresourceUris { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for SubresourceUris { + const LENGTH: usize = 0; + fn fields(&self) -> Vec> { + vec![] + } + + fn headers() -> Vec> { + vec![] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010Account { + #[doc = "The authorization token for this account. This token should be kept a secret, so no \ + sharing."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub auth_token: Option, + #[doc = "The date that this account was created, in GMT in RFC 2822 format"] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this account was last updated, in GMT in RFC 2822 format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A human readable description of this account, up to 64 characters long. By default \ + the FriendlyName is your email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The unique 34 character id that represents the parent of this account. The \ + OwnerAccountSid of a parent account is it's own sid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner_account_sid: Option, + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "A Map of various subresources available for the given Account Instance"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The URI for this resource, relative to `https://api.twilio.com`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010Account { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010Account { + const LENGTH: usize = 10; + fn fields(&self) -> Vec> { + vec![ + if let Some(auth_token) = &self.auth_token { + format!("{:?}", auth_token).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(owner_account_sid) = &self.owner_account_sid { + format!("{:?}", owner_account_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "auth_token".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "owner_account_sid".into(), + "sid".into(), + "status".into(), + "subresource_uris".into(), + "type_".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AccountEnumStatus { + #[serde(rename = "active")] + #[display("active")] + Active, + #[serde(rename = "suspended")] + #[display("suspended")] + Suspended, + #[serde(rename = "closed")] + #[display("closed")] + Closed, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AccountEnumType { + Trial, + Full, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAddress { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is \ + responsible for the Address resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The city in which the address is located."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + #[doc = "The name associated with the address.This property has a maximum length of 16 4-byte \ + characters, or 21 3-byte characters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub customer_name: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The ISO country code of the address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The postal code of the address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The state or region of the address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The unique string that that we created to identify the Address resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The number and street address of the address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "Whether emergency calling has been enabled on this number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_enabled: Option, + #[doc = "Whether the address has been validated to comply with local regulation. In countries \ + that require valid addresses, an invalid address will not be accepted. `true` \ + indicates the Address has been validated. `false` indicate the country doesn't \ + require validation or the Address is not valid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validated: Option, + #[doc = "Whether the address has been verified to comply with regulation. In countries that \ + require valid addresses, an invalid address will not be accepted. `true` indicates \ + the Address has been verified. `false` indicate the country doesn't require verified \ + or the Address is not valid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub verified: Option, + #[doc = "The additional number and street address of the address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street_secondary: Option, +} + +impl std::fmt::Display for ApiV2010AccountAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAddress { + const LENGTH: usize = 16; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(city) = &self.city { + format!("{:?}", city).into() + } else { + String::new().into() + }, + if let Some(customer_name) = &self.customer_name { + format!("{:?}", customer_name).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(street) = &self.street { + format!("{:?}", street).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(emergency_enabled) = &self.emergency_enabled { + format!("{:?}", emergency_enabled).into() + } else { + String::new().into() + }, + if let Some(validated) = &self.validated { + format!("{:?}", validated).into() + } else { + String::new().into() + }, + if let Some(verified) = &self.verified { + format!("{:?}", verified).into() + } else { + String::new().into() + }, + if let Some(street_secondary) = &self.street_secondary { + format!("{:?}", street_secondary).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "city".into(), + "customer_name".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "iso_country".into(), + "postal_code".into(), + "region".into(), + "sid".into(), + "street".into(), + "uri".into(), + "emergency_enabled".into(), + "validated".into(), + "verified".into(), + "street_secondary".into(), + ] + } +} + +#[doc = "The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum SmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum SmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum StatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum VoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum VoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountApplication { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Application resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to start a new TwiML session."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The URL we call using a POST method to send message status information to your \ + application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_status_callback: Option, + #[doc = "The unique string that that we created to identify the Application resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_method: Option, + #[doc = "The URL that we call when an error occurs while retrieving or executing the TwiML \ + from `sms_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we call using a POST method to send status information to your application \ + about SMS messages that refer to the application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_status_callback: Option, + #[doc = "The URL we call when the phone number receives an incoming SMS message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we call using the `status_callback_method` to send status information to \ + your application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback: Option, + #[doc = "The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback_method: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "Whether we look up the caller's caller-ID name from the CNAM database (additional \ + charges apply). Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_method: Option, + #[doc = "The URL that we call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_method: Option, + #[doc = "The URL we call when the phone number assigned to this application receives a call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub public_application_connect_enabled: Option, +} + +impl std::fmt::Display for ApiV2010AccountApplication { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountApplication { + const LENGTH: usize = 21; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(message_status_callback) = &self.message_status_callback { + format!("{:?}", message_status_callback).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_status_callback) = &self.sms_status_callback { + format!("{:?}", sms_status_callback).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(public_application_connect_enabled) = + &self.public_application_connect_enabled + { + format!("{:?}", public_application_connect_enabled).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "message_status_callback".into(), + "sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_status_callback".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "uri".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "public_application_connect_enabled".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAuthorizedConnectApp { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the AuthorizedConnectApp resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The company name set for the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub connect_app_company_name: Option, + #[doc = "A detailed description of the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub connect_app_description: Option, + #[doc = "The name of the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub connect_app_friendly_name: Option, + #[doc = "The public URL for the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub connect_app_homepage_url: Option, + #[doc = "The SID that we assigned to the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub connect_app_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The set of permissions that you authorized for the Connect App. Can be: `get-all` \ + or `post-all`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountAuthorizedConnectApp { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAuthorizedConnectApp { + const LENGTH: usize = 10; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(connect_app_company_name) = &self.connect_app_company_name { + format!("{:?}", connect_app_company_name).into() + } else { + String::new().into() + }, + if let Some(connect_app_description) = &self.connect_app_description { + format!("{:?}", connect_app_description).into() + } else { + String::new().into() + }, + if let Some(connect_app_friendly_name) = &self.connect_app_friendly_name { + format!("{:?}", connect_app_friendly_name).into() + } else { + String::new().into() + }, + if let Some(connect_app_homepage_url) = &self.connect_app_homepage_url { + format!("{:?}", connect_app_homepage_url).into() + } else { + String::new().into() + }, + if let Some(connect_app_sid) = &self.connect_app_sid { + format!("{:?}", connect_app_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(permissions) = &self.permissions { + format!("{:?}", permissions).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "connect_app_company_name".into(), + "connect_app_description".into(), + "connect_app_friendly_name".into(), + "connect_app_homepage_url".into(), + "connect_app_sid".into(), + "date_created".into(), + "date_updated".into(), + "permissions".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AuthorizedConnectAppEnumPermission { + #[serde(rename = "get-all")] + #[display("get-all")] + GetAll, + #[serde(rename = "post-all")] + #[display("post-all")] + PostAll, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountry { + #[doc = "The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of \ + the country."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country_code: Option, + #[doc = "The name of the country."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + #[doc = "The URI of the Country resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "Whether all phone numbers available in the country are new to the Twilio platform. \ + `true` if they are and `false` if all numbers are not in the Twilio Phone Number \ + Beta program."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "A list of related AvailablePhoneNumber resources identified by their URIs relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, +} + +impl std::fmt::Display for ApiV2010AccountAvailablePhoneNumberCountry { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAvailablePhoneNumberCountry { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(country_code) = &self.country_code { + format!("{:?}", country_code).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "country_code".into(), + "country".into(), + "uri".into(), + "beta".into(), + "subresource_uris".into(), + ] + } +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Capabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display for Capabilities { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Capabilities { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberLocal { + #[doc = "A formatted version of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this \ + phone number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lata: Option, + #[doc = "The locality or city of this phone number's location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone \ + number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate_center: Option, + #[doc = "The latitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "The longitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, + #[doc = "The two-letter state or province abbreviation of this phone number's location. \ + Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal or ZIP code of this phone number's location. Available for only phone \ + numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this \ + phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the \ + phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no \ + address is required. `any` means an address is required, but it can be anywhere in \ + the world. `local` means an address in the phone number's country is required. \ + `foreign` means an address outside of the phone number's country is required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option, +} + +impl std::fmt::Display for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberLocal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberLocal { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(lata) = &self.lata { + format!("{:?}", lata).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(rate_center) = &self.rate_center { + format!("{:?}", rate_center).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "phone_number".into(), + "lata".into(), + "locality".into(), + "rate_center".into(), + "latitude".into(), + "longitude".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "address_requirements".into(), + "beta".into(), + "capabilities".into(), + ] + } +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMachineToMachineCapabilities +{ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMachineToMachineCapabilities +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMachineToMachineCapabilities +{ + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMachineToMachine { + #[doc = "A formatted version of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this \ + phone number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lata: Option, + #[doc = "The locality or city of this phone number's location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone \ + number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate_center: Option, + #[doc = "The latitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "The longitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, + #[doc = "The two-letter state or province abbreviation of this phone number's location. \ + Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal or ZIP code of this phone number's location. Available for only phone \ + numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this \ + phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the \ + phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no \ + address is required. `any` means an address is required, but it can be anywhere in \ + the world. `local` means an address in the phone number's country is required. \ + `foreign` means an address outside of the phone number's country is required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option< + ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMachineToMachineCapabilities, + >, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMachineToMachine +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMachineToMachine +{ + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(lata) = &self.lata { + format!("{:?}", lata).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(rate_center) = &self.rate_center { + format!("{:?}", rate_center).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "phone_number".into(), + "lata".into(), + "locality".into(), + "rate_center".into(), + "latitude".into(), + "longitude".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "address_requirements".into(), + "beta".into(), + "capabilities".into(), + ] + } +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMobileCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMobileCapabilities +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMobileCapabilities +{ + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMobile { + #[doc = "A formatted version of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this \ + phone number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lata: Option, + #[doc = "The locality or city of this phone number's location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone \ + number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate_center: Option, + #[doc = "The latitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "The longitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, + #[doc = "The two-letter state or province abbreviation of this phone number's location. \ + Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal or ZIP code of this phone number's location. Available for only phone \ + numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this \ + phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the \ + phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no \ + address is required. `any` means an address is required, but it can be anywhere in \ + the world. `local` means an address in the phone number's country is required. \ + `foreign` means an address outside of the phone number's country is required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: + Option, +} + +impl std::fmt::Display for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMobile { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberMobile { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(lata) = &self.lata { + format!("{:?}", lata).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(rate_center) = &self.rate_center { + format!("{:?}", rate_center).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "phone_number".into(), + "lata".into(), + "locality".into(), + "rate_center".into(), + "latitude".into(), + "longitude".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "address_requirements".into(), + "beta".into(), + "capabilities".into(), + ] + } +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberNationalCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberNationalCapabilities +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberNationalCapabilities +{ + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberNational { + #[doc = "A formatted version of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this \ + phone number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lata: Option, + #[doc = "The locality or city of this phone number's location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone \ + number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate_center: Option, + #[doc = "The latitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "The longitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, + #[doc = "The two-letter state or province abbreviation of this phone number's location. \ + Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal or ZIP code of this phone number's location. Available for only phone \ + numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this \ + phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the \ + phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no \ + address is required. `any` means an address is required, but it can be anywhere in \ + the world. `local` means an address in the phone number's country is required. \ + `foreign` means an address outside of the phone number's country is required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: + Option, +} + +impl std::fmt::Display for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberNational { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberNational { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(lata) = &self.lata { + format!("{:?}", lata).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(rate_center) = &self.rate_center { + format!("{:?}", rate_center).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "phone_number".into(), + "lata".into(), + "locality".into(), + "rate_center".into(), + "latitude".into(), + "longitude".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "address_requirements".into(), + "beta".into(), + "capabilities".into(), + ] + } +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberSharedCostCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberSharedCostCapabilities +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberSharedCostCapabilities +{ + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberSharedCost { + #[doc = "A formatted version of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this \ + phone number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lata: Option, + #[doc = "The locality or city of this phone number's location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone \ + number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate_center: Option, + #[doc = "The latitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "The longitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, + #[doc = "The two-letter state or province abbreviation of this phone number's location. \ + Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal or ZIP code of this phone number's location. Available for only phone \ + numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this \ + phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the \ + phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no \ + address is required. `any` means an address is required, but it can be anywhere in \ + the world. `local` means an address in the phone number's country is required. \ + `foreign` means an address outside of the phone number's country is required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option< + ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberSharedCostCapabilities, + >, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberSharedCost +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberSharedCost { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(lata) = &self.lata { + format!("{:?}", lata).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(rate_center) = &self.rate_center { + format!("{:?}", rate_center).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "phone_number".into(), + "lata".into(), + "locality".into(), + "rate_center".into(), + "latitude".into(), + "longitude".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "address_requirements".into(), + "beta".into(), + "capabilities".into(), + ] + } +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberTollFreeCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberTollFreeCapabilities +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberTollFreeCapabilities +{ + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberTollFree { + #[doc = "A formatted version of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this \ + phone number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lata: Option, + #[doc = "The locality or city of this phone number's location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone \ + number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate_center: Option, + #[doc = "The latitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "The longitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, + #[doc = "The two-letter state or province abbreviation of this phone number's location. \ + Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal or ZIP code of this phone number's location. Available for only phone \ + numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this \ + phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the \ + phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no \ + address is required. `any` means an address is required, but it can be anywhere in \ + the world. `local` means an address in the phone number's country is required. \ + `foreign` means an address outside of the phone number's country is required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: + Option, +} + +impl std::fmt::Display for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberTollFree { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberTollFree { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(lata) = &self.lata { + format!("{:?}", lata).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(rate_center) = &self.rate_center { + format!("{:?}", rate_center).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "phone_number".into(), + "lata".into(), + "locality".into(), + "rate_center".into(), + "latitude".into(), + "longitude".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "address_requirements".into(), + "beta".into(), + "capabilities".into(), + ] + } +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberVoipCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberVoipCapabilities +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberVoipCapabilities +{ + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberVoip { + #[doc = "A formatted version of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this \ + phone number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lata: Option, + #[doc = "The locality or city of this phone number's location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone \ + number. Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate_center: Option, + #[doc = "The latitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "The longitude of this phone number's location. Available for only phone numbers from \ + the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, + #[doc = "The two-letter state or province abbreviation of this phone number's location. \ + Available for only phone numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal or ZIP code of this phone number's location. Available for only phone \ + numbers from the US and Canada."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this \ + phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_country: Option, + #[doc = "The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the \ + phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no \ + address is required. `any` means an address is required, but it can be anywhere in \ + the world. `local` means an address in the phone number's country is required. \ + `foreign` means an address outside of the phone number's country is required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are: `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: + Option, +} + +impl std::fmt::Display for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberVoip { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAvailablePhoneNumberCountryAvailablePhoneNumberVoip { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(lata) = &self.lata { + format!("{:?}", lata).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(rate_center) = &self.rate_center { + format!("{:?}", rate_center).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(iso_country) = &self.iso_country { + format!("{:?}", iso_country).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "phone_number".into(), + "lata".into(), + "locality".into(), + "rate_center".into(), + "latitude".into(), + "longitude".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "address_requirements".into(), + "beta".into(), + "capabilities".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountBalance { + #[doc = "The unique SID identifier of the Account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The balance of the Account, in units specified by the unit parameter. Balance \ + changes may not be reflected immediately. Child accounts do not contain balance \ + information"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub balance: Option, + #[doc = "The units of currency for the account balance"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, +} + +impl std::fmt::Display for ApiV2010AccountBalance { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountBalance { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(balance) = &self.balance { + format!("{:?}", balance).into() + } else { + String::new().into() + }, + if let Some(currency) = &self.currency { + format!("{:?}", currency).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["account_sid".into(), "balance".into(), "currency".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCall { + #[doc = "The unique string that we created to identify this Call resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The SID that identifies the call that created this leg."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_call_sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this Call resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The phone number, SIP address, Client identifier or SIM SID that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. SIM SIDs are formatted as `sim:sid`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub to: Option, + #[doc = "The phone number, SIP address or Client identifier that received this call. Formatted for display. Non-North American phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub to_formatted: Option, + #[doc = "The phone number, SIP address, Client identifier or SIM SID that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. SIM SIDs are formatted as `sim:sid`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: Option, + #[doc = "The calling phone number, SIP address, or Client identifier formatted for display. Non-North American phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from_formatted: Option, + #[doc = "If the call was inbound, this is the SID of the IncomingPhoneNumber resource that \ + received the call. If the call was outbound, it is the SID of the OutgoingCallerId \ + resource from which the call was placed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The start time of the call, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub start_time: Option>, + #[doc = "The time the call ended, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub end_time: Option>, + #[doc = "The length of the call in seconds. This value is empty for busy, failed, unanswered, \ + or ongoing calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[doc = "The charge for this call, in the currency associated with the account. Populated \ + after the call is completed. May not be immediately available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `Price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g., `USD`, `EUR`, `JPY`). Always capitalized for calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "A string describing the direction of the call. Can be: `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `` verb. Using [Elastic SIP Trunking](https://www.twilio.com/docs/sip-trunking), the values can be [`trunking-terminating`](https://www.twilio.com/docs/sip-trunking#termination) for outgoing calls from your communications infrastructure to the PSTN or [`trunking-originating`](https://www.twilio.com/docs/sip-trunking#origination) for incoming calls to your communications infrastructure from the PSTN."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub direction: Option, + #[doc = "Either `human` or `machine` if this call was initiated with answering machine \ + detection. Empty otherwise."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub answered_by: Option, + #[doc = "The API version used to create the call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The forwarding phone number if this call was an incoming call forwarded from another \ + number (depends on carrier supporting forwarding). Otherwise, empty."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub forwarded_from: Option, + #[doc = "The Group SID associated with this call. If no Group is associated with the call, \ + the field is empty."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group_sid: Option, + #[doc = "The caller's name if this call was an incoming call to a phone number with caller ID \ + Lookup enabled. Otherwise, empty."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub caller_name: Option, + #[doc = "The wait time in milliseconds before the call is placed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue_time: Option, + #[doc = "The unique identifier of the trunk resource that was used for this call. The field \ + is empty if the call was not made using a SIP trunk or if the call is not terminated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[doc = "The URI of this resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "A list of subresources available to this call, identified by their URIs relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, +} + +impl std::fmt::Display for ApiV2010AccountCall { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCall { + const LENGTH: usize = 26; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(parent_call_sid) = &self.parent_call_sid { + format!("{:?}", parent_call_sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(to) = &self.to { + format!("{:?}", to).into() + } else { + String::new().into() + }, + if let Some(to_formatted) = &self.to_formatted { + format!("{:?}", to_formatted).into() + } else { + String::new().into() + }, + if let Some(from) = &self.from { + format!("{:?}", from).into() + } else { + String::new().into() + }, + if let Some(from_formatted) = &self.from_formatted { + format!("{:?}", from_formatted).into() + } else { + String::new().into() + }, + if let Some(phone_number_sid) = &self.phone_number_sid { + format!("{:?}", phone_number_sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() + } else { + String::new().into() + }, + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(direction) = &self.direction { + format!("{:?}", direction).into() + } else { + String::new().into() + }, + if let Some(answered_by) = &self.answered_by { + format!("{:?}", answered_by).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(forwarded_from) = &self.forwarded_from { + format!("{:?}", forwarded_from).into() + } else { + String::new().into() + }, + if let Some(group_sid) = &self.group_sid { + format!("{:?}", group_sid).into() + } else { + String::new().into() + }, + if let Some(caller_name) = &self.caller_name { + format!("{:?}", caller_name).into() + } else { + String::new().into() + }, + if let Some(queue_time) = &self.queue_time { + format!("{:?}", queue_time).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "date_created".into(), + "date_updated".into(), + "parent_call_sid".into(), + "account_sid".into(), + "to".into(), + "to_formatted".into(), + "from".into(), + "from_formatted".into(), + "phone_number_sid".into(), + "status".into(), + "start_time".into(), + "end_time".into(), + "duration".into(), + "price".into(), + "price_unit".into(), + "direction".into(), + "answered_by".into(), + "api_version".into(), + "forwarded_from".into(), + "group_sid".into(), + "caller_name".into(), + "queue_time".into(), + "trunk_sid".into(), + "uri".into(), + "subresource_uris".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallEnumEvent { + #[serde(rename = "initiated")] + #[display("initiated")] + Initiated, + #[serde(rename = "ringing")] + #[display("ringing")] + Ringing, + #[serde(rename = "answered")] + #[display("answered")] + Answered, + #[serde(rename = "completed")] + #[display("completed")] + Completed, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallEnumStatus { + #[serde(rename = "queued")] + #[display("queued")] + Queued, + #[serde(rename = "ringing")] + #[display("ringing")] + Ringing, + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "busy")] + #[display("busy")] + Busy, + #[serde(rename = "failed")] + #[display("failed")] + Failed, + #[serde(rename = "no-answer")] + #[display("no-answer")] + NoAnswer, + #[serde(rename = "canceled")] + #[display("canceled")] + Canceled, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallEnumUpdateStatus { + #[serde(rename = "canceled")] + #[display("canceled")] + Canceled, + #[serde(rename = "completed")] + #[display("completed")] + Completed, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallCallEvent { + #[doc = "Contains a dictionary representing the request of the call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request: Option, + #[doc = "Contains a dictionary representing the call response, including a list of the call \ + events."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub response: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallCallEvent { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallCallEvent { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(request) = &self.request { + format!("{:?}", request).into() + } else { + String::new().into() + }, + if let Some(response) = &self.response { + format!("{:?}", response).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["request".into(), "response".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallCallFeedback { + #[doc = "The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) \ + responsible for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A list of issues experienced during the call. The issues can be: `imperfect-audio`, \ + `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, \ + `audio-latency`, `unsolicited-call`, or `one-way-audio`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issues: Option>, + #[doc = "`1` to `5` quality score where `1` represents imperfect experience and `5` \ + represents a perfect call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality_score: Option, + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallCallFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallCallFeedback { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(issues) = &self.issues { + format!("{:?}", issues).into() + } else { + String::new().into() + }, + if let Some(quality_score) = &self.quality_score { + format!("{:?}", quality_score).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "issues".into(), + "quality_score".into(), + "sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallFeedbackEnumIssues { + #[serde(rename = "audio-latency")] + #[display("audio-latency")] + AudioLatency, + #[serde(rename = "digits-not-captured")] + #[display("digits-not-captured")] + DigitsNotCaptured, + #[serde(rename = "dropped-call")] + #[display("dropped-call")] + DroppedCall, + #[serde(rename = "imperfect-audio")] + #[display("imperfect-audio")] + ImperfectAudio, + #[serde(rename = "incorrect-caller-id")] + #[display("incorrect-caller-id")] + IncorrectCallerId, + #[serde(rename = "one-way-audio")] + #[display("one-way-audio")] + OneWayAudio, + #[serde(rename = "post-dial-delay")] + #[display("post-dial-delay")] + PostDialDelay, + #[serde(rename = "unsolicited-call")] + #[display("unsolicited-call")] + UnsolicitedCall, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallCallFeedbackSummary { + #[doc = "The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) \ + responsible for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The total number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_count: Option, + #[doc = "The total number of calls with a feedback entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_feedback_count: Option, + #[doc = "The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The last date for which feedback entries are included in this Feedback Summary, \ + formatted as `YYYY-MM-DD` and specified in UTC."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "Whether the feedback summary includes subaccounts; `true` if it does, otherwise \ + `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub include_subaccounts: Option, + #[doc = "A list of issues experienced during the call. The issues can be: `imperfect-audio`, \ + `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, \ + `audio-latency`, or `one-way-audio`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issues: Option>, + #[doc = "The average QualityScore of the feedback entries."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality_score_average: Option, + #[doc = "The median QualityScore of the feedback entries."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality_score_median: Option, + #[doc = "The standard deviation of the quality scores."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quality_score_standard_deviation: Option, + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The first date for which feedback entries are included in this feedback summary, \ + formatted as `YYYY-MM-DD` and specified in UTC."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallCallFeedbackSummary { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallCallFeedbackSummary { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_count) = &self.call_count { + format!("{:?}", call_count).into() + } else { + String::new().into() + }, + if let Some(call_feedback_count) = &self.call_feedback_count { + format!("{:?}", call_feedback_count).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(include_subaccounts) = &self.include_subaccounts { + format!("{:?}", include_subaccounts).into() + } else { + String::new().into() + }, + if let Some(issues) = &self.issues { + format!("{:?}", issues).into() + } else { + String::new().into() + }, + if let Some(quality_score_average) = &self.quality_score_average { + format!("{:?}", quality_score_average).into() + } else { + String::new().into() + }, + if let Some(quality_score_median) = &self.quality_score_median { + format!("{:?}", quality_score_median).into() + } else { + String::new().into() + }, + if let Some(quality_score_standard_deviation) = &self.quality_score_standard_deviation { + format!("{:?}", quality_score_standard_deviation).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "call_count".into(), + "call_feedback_count".into(), + "date_created".into(), + "date_updated".into(), + "end_date".into(), + "include_subaccounts".into(), + "issues".into(), + "quality_score_average".into(), + "quality_score_median".into(), + "quality_score_standard_deviation".into(), + "sid".into(), + "start_date".into(), + "status".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallFeedbackSummaryEnumStatus { + #[serde(rename = "queued")] + #[display("queued")] + Queued, + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "failed")] + #[display("failed")] + Failed, +} + +#[doc = "The HTTP method used to generate the notification. If the notification was generated \ + during a phone call, this is the HTTP Method used to request the resource on your server. \ + If the notification was generated by your use of our REST API, this is the HTTP method \ + used to call the resource on our servers."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum RequestMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallCallNotification { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Call Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the Call Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Call \ + Notification resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A unique error code for the error condition that is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "An integer log level that corresponds to the type of notification: `0` is ERROR, `1` \ + is WARNING."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log: Option, + #[doc = "The date the notification was actually generated in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from `date_created`."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub message_date: Option>, + #[doc = "The text of the notification."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_text: Option, + #[doc = "The URL for more information about the error condition. This value is a page in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub more_info: Option, + #[doc = "The HTTP method used to generate the notification. If the notification was generated \ + during a phone call, this is the HTTP Method used to request the resource on your \ + server. If the notification was generated by your use of our REST API, this is the \ + HTTP method used to call the resource on our servers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_method: Option, + #[doc = "The URL of the resource that generated the notification. If the notification was \ + generated during a phone call, this is the URL of the resource on your server that \ + caused the notification. If the notification was generated by your use of our REST \ + API, this is the URL of the resource you called."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_url: Option, + #[doc = "The unique string that that we created to identify the Call Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallCallNotification { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallCallNotification { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(log) = &self.log { + format!("{:?}", log).into() + } else { + String::new().into() + }, + if let Some(message_date) = &self.message_date { + format!("{:?}", message_date).into() + } else { + String::new().into() + }, + if let Some(message_text) = &self.message_text { + format!("{:?}", message_text).into() + } else { + String::new().into() + }, + if let Some(more_info) = &self.more_info { + format!("{:?}", more_info).into() + } else { + String::new().into() + }, + if let Some(request_method) = &self.request_method { + format!("{:?}", request_method).into() + } else { + String::new().into() + }, + if let Some(request_url) = &self.request_url { + format!("{:?}", request_url).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "call_sid".into(), + "date_created".into(), + "date_updated".into(), + "error_code".into(), + "log".into(), + "message_date".into(), + "message_text".into(), + "more_info".into(), + "request_method".into(), + "request_url".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallCallNotificationInstance { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Call Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the Call Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Call \ + Notification resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A unique error code for the error condition that is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "An integer log level that corresponds to the type of notification: `0` is ERROR, `1` \ + is WARNING."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log: Option, + #[doc = "The date the notification was actually generated in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from `date_created`."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub message_date: Option>, + #[doc = "The text of the notification."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_text: Option, + #[doc = "The URL for more information about the error condition. This value is a page in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub more_info: Option, + #[doc = "The HTTP method used to generate the notification. If the notification was generated \ + during a phone call, this is the HTTP Method used to request the resource on your \ + server. If the notification was generated by your use of our REST API, this is the \ + HTTP method used to call the resource on our servers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_method: Option, + #[doc = "The URL of the resource that generated the notification. If the notification was \ + generated during a phone call, this is the URL of the resource on your server that \ + caused the notification. If the notification was generated by your use of our REST \ + API, this is the URL of the resource you called."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_url: Option, + #[doc = "The HTTP GET or POST variables we sent to your server. However, if the notification \ + was generated by our REST API, this contains the HTTP POST or PUT variables you sent \ + to our API."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_variables: Option, + #[doc = "The HTTP body returned by your server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub response_body: Option, + #[doc = "The HTTP headers returned by your server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub response_headers: Option, + #[doc = "The unique string that that we created to identify the Call Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallCallNotificationInstance { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallCallNotificationInstance { + const LENGTH: usize = 17; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(log) = &self.log { + format!("{:?}", log).into() + } else { + String::new().into() + }, + if let Some(message_date) = &self.message_date { + format!("{:?}", message_date).into() + } else { + String::new().into() + }, + if let Some(message_text) = &self.message_text { + format!("{:?}", message_text).into() + } else { + String::new().into() + }, + if let Some(more_info) = &self.more_info { + format!("{:?}", more_info).into() + } else { + String::new().into() + }, + if let Some(request_method) = &self.request_method { + format!("{:?}", request_method).into() + } else { + String::new().into() + }, + if let Some(request_url) = &self.request_url { + format!("{:?}", request_url).into() + } else { + String::new().into() + }, + if let Some(request_variables) = &self.request_variables { + format!("{:?}", request_variables).into() + } else { + String::new().into() + }, + if let Some(response_body) = &self.response_body { + format!("{:?}", response_body).into() + } else { + String::new().into() + }, + if let Some(response_headers) = &self.response_headers { + format!("{:?}", response_headers).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "call_sid".into(), + "date_created".into(), + "date_updated".into(), + "error_code".into(), + "log".into(), + "message_date".into(), + "message_text".into(), + "more_info".into(), + "request_method".into(), + "request_url".into(), + "request_variables".into(), + "response_body".into(), + "response_headers".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallCallRecording { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Recording resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to make the recording."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Recording resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The Conference SID that identifies the conference associated with the recording, if \ + a conference recording."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conference_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The start time of the recording in GMT and in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub start_time: Option>, + #[doc = "The length of the recording in seconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[doc = "The unique string that that we created to identify the Recording resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The one-time cost of creating the recording in the `price_unit` currency."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encryption_details: Option, + #[doc = "The currency used in the `price` property. Example: `USD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The number of channels in the final recording file. Can be: `1`, or `2`. Separating a two leg call into two separate channels of the recording file is supported in [Dial](https://www.twilio.com/docs/voice/twiml/dial#attributes-record) and [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls) record options."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub channels: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "The recorded track. Can be: `inbound`, `outbound`, or `both`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub track: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallCallRecording { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallCallRecording { + const LENGTH: usize = 18; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(conference_sid) = &self.conference_sid { + format!("{:?}", conference_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(encryption_details) = &self.encryption_details { + format!("{:?}", encryption_details).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(channels) = &self.channels { + format!("{:?}", channels).into() + } else { + String::new().into() + }, + if let Some(source) = &self.source { + format!("{:?}", source).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(track) = &self.track { + format!("{:?}", track).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "call_sid".into(), + "conference_sid".into(), + "date_created".into(), + "date_updated".into(), + "start_time".into(), + "duration".into(), + "sid".into(), + "price".into(), + "uri".into(), + "encryption_details".into(), + "price_unit".into(), + "status".into(), + "channels".into(), + "source".into(), + "error_code".into(), + "track".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallRecordingEnumStatus { + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "paused")] + #[display("paused")] + Paused, + #[serde(rename = "stopped")] + #[display("stopped")] + Stopped, + #[serde(rename = "processing")] + #[display("processing")] + Processing, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "absent")] + #[display("absent")] + Absent, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallRecordingEnumSource { + DialVerb, + Conference, + OutboundAPI, + Trunking, + RecordVerb, + StartCallRecordingAPI, + StartConferenceRecordingAPI, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountConference { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this Conference resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The API version used to create this conference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "A string that you assigned to describe this conference room."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "A string that represents the Twilio Region where the conference audio was mixed. May \ + be `us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will \ + always be mixed in `us1`. Global Conference audio will be mixed nearest to the \ + majority of participants."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The unique string that that we created to identify this Conference resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The URI of this resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "A list of related resources identified by their URIs relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason_conference_ended: Option, + #[doc = "The call SID that caused the conference to end."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid_ending_conference: Option, +} + +impl std::fmt::Display for ApiV2010AccountConference { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountConference { + const LENGTH: usize = 12; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(reason_conference_ended) = &self.reason_conference_ended { + format!("{:?}", reason_conference_ended).into() + } else { + String::new().into() + }, + if let Some(call_sid_ending_conference) = &self.call_sid_ending_conference { + format!("{:?}", call_sid_ending_conference).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "api_version".into(), + "friendly_name".into(), + "region".into(), + "sid".into(), + "status".into(), + "uri".into(), + "subresource_uris".into(), + "reason_conference_ended".into(), + "call_sid_ending_conference".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ConferenceEnumStatus { + #[serde(rename = "init")] + #[display("init")] + Init, + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "completed")] + #[display("completed")] + Completed, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum ConferenceEnumUpdateStatus { + #[serde(rename = "completed")] + #[display("completed")] + #[default] + Completed, +} + + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ConferenceEnumReasonConferenceEnded { + #[serde(rename = "conference-ended-via-api")] + #[display("conference-ended-via-api")] + ConferenceEndedViaApi, + #[serde(rename = "participant-with-end-conference-on-exit-left")] + #[display("participant-with-end-conference-on-exit-left")] + ParticipantWithEndConferenceOnExitLeft, + #[serde(rename = "participant-with-end-conference-on-exit-kicked")] + #[display("participant-with-end-conference-on-exit-kicked")] + ParticipantWithEndConferenceOnExitKicked, + #[serde(rename = "last-participant-kicked")] + #[display("last-participant-kicked")] + LastParticipantKicked, + #[serde(rename = "last-participant-left")] + #[display("last-participant-left")] + LastParticipantLeft, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountConferenceConferenceRecording { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Conference Recording resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the recording."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Conference Recording resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The Conference SID that identifies the conference associated with the recording."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conference_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The start time of the recording in GMT and in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub start_time: Option>, + #[doc = "The length of the recording in seconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[doc = "The unique string that that we created to identify the Conference Recording resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The one-time cost of creating the recording in the `price_unit` currency."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency used in the `price` property. Example: `USD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The number of channels in the final recording file. Can be: `1`, or `2`. Separating a two leg call into two separate channels of the recording file is supported in [Dial](https://www.twilio.com/docs/voice/twiml/dial#attributes-record) and [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls) record options."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub channels: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encryption_details: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountConferenceConferenceRecording { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountConferenceConferenceRecording { + const LENGTH: usize = 17; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(conference_sid) = &self.conference_sid { + format!("{:?}", conference_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(channels) = &self.channels { + format!("{:?}", channels).into() + } else { + String::new().into() + }, + if let Some(source) = &self.source { + format!("{:?}", source).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(encryption_details) = &self.encryption_details { + format!("{:?}", encryption_details).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "call_sid".into(), + "conference_sid".into(), + "date_created".into(), + "date_updated".into(), + "start_time".into(), + "duration".into(), + "sid".into(), + "price".into(), + "price_unit".into(), + "status".into(), + "channels".into(), + "source".into(), + "error_code".into(), + "encryption_details".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ConferenceRecordingEnumStatus { + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "paused")] + #[display("paused")] + Paused, + #[serde(rename = "stopped")] + #[display("stopped")] + Stopped, + #[serde(rename = "processing")] + #[display("processing")] + Processing, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "absent")] + #[display("absent")] + Absent, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ConferenceRecordingEnumSource { + DialVerb, + Conference, + OutboundAPI, + Trunking, + RecordVerb, + StartCallRecordingAPI, + StartConferenceRecordingAPI, +} + +#[doc = "The HTTP method we use to call `deauthorize_callback_url`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum DeauthorizeCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountConnectApp { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the ConnectApp resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The URL we redirect the user to after we authenticate the user and obtain \ + authorization to access the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorize_redirect_url: Option, + #[doc = "The company name set for the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub company_name: Option, + #[doc = "The HTTP method we use to call `deauthorize_callback_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deauthorize_callback_method: Option, + #[doc = "The URL we call using the `deauthorize_callback_method` to de-authorize the Connect \ + App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deauthorize_callback_url: Option, + #[doc = "The description of the Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The public URL where users can obtain more information about this Connect App."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub homepage_url: Option, + #[doc = "The set of permissions that your ConnectApp requests."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + #[doc = "The unique string that that we created to identify the ConnectApp resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountConnectApp { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountConnectApp { + const LENGTH: usize = 11; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(authorize_redirect_url) = &self.authorize_redirect_url { + format!("{:?}", authorize_redirect_url).into() + } else { + String::new().into() + }, + if let Some(company_name) = &self.company_name { + format!("{:?}", company_name).into() + } else { + String::new().into() + }, + if let Some(deauthorize_callback_method) = &self.deauthorize_callback_method { + format!("{:?}", deauthorize_callback_method).into() + } else { + String::new().into() + }, + if let Some(deauthorize_callback_url) = &self.deauthorize_callback_url { + format!("{:?}", deauthorize_callback_url).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(homepage_url) = &self.homepage_url { + format!("{:?}", homepage_url).into() + } else { + String::new().into() + }, + if let Some(permissions) = &self.permissions { + format!("{:?}", permissions).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "authorize_redirect_url".into(), + "company_name".into(), + "deauthorize_callback_method".into(), + "deauthorize_callback_url".into(), + "description".into(), + "friendly_name".into(), + "homepage_url".into(), + "permissions".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ConnectAppEnumPermission { + #[serde(rename = "get-all")] + #[display("get-all")] + GetAll, + #[serde(rename = "post-all")] + #[display("post-all")] + PostAll, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountAddressDependentPhoneNumber { + #[doc = "The unique string that that we created to identify the DependentPhoneNumber resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the DependentPhoneNumber resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The URL we call when the phone number receives a call. The `voice_url` will not be \ + used if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_method: Option, + #[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_method: Option, + #[doc = "The URL that we call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_url: Option, + #[doc = "Whether we look up the caller's caller-ID name from the CNAM database. Can be: \ + `true` or `false`. Caller ID lookups can cost $0.01 each."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_caller_id_lookup: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_method: Option, + #[doc = "The URL that we call when an error occurs while retrieving or executing the TwiML \ + from `sms_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we call when the phone number receives an incoming SMS message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "The set of Boolean properties that indicates whether a phone number can receive \ + calls or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability \ + can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + #[doc = "The URL we call using the `status_callback_method` to send status information to \ + your application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback: Option, + #[doc = "The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback_method: Option, + #[doc = "The API version used to start a new TwiML session."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the application that handles SMS messages sent to the phone number. If an \ + `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of \ + the application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_application_sid: Option, + #[doc = "The SID of the application that handles calls to the phone number. If a \ + `voice_application_sid` is present, we ignore all of the voice urls and use those \ + set on the application. Setting a `voice_application_sid` will automatically delete \ + your `trunk_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_application_sid: Option, + #[doc = "The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is \ + present, we ignore all of the voice urls and voice applications and use those set on \ + the Trunk. Setting a `trunk_sid` will automatically delete your \ + `voice_application_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration that we use for emergency calling \ + from the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountAddressDependentPhoneNumber { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountAddressDependentPhoneNumber { + const LENGTH: usize = 26; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + format!("{:?}", self.friendly_name).into(), + format!("{:?}", self.phone_number).into(), + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "friendly_name".into(), + "phone_number".into(), + "voice_url".into(), + "voice_method".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_caller_id_lookup".into(), + "date_created".into(), + "date_updated".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "address_requirements".into(), + "capabilities".into(), + "status_callback".into(), + "status_callback_method".into(), + "api_version".into(), + "sms_application_sid".into(), + "voice_application_sid".into(), + "trunk_sid".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum DependentPhoneNumberEnumAddressRequirement { + #[serde(rename = "none")] + #[display("none")] + None, + #[serde(rename = "any")] + #[display("any")] + Any, + #[serde(rename = "local")] + #[display("local")] + Local, + #[serde(rename = "foreign")] + #[display("foreign")] + Foreign, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum DependentPhoneNumberEnumEmergencyStatus { + Active, + Inactive, +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumberCapabilities { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberCapabilities { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumber { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this IncomingPhoneNumber resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the Address resource associated with the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "The API version used to start a new TwiML session."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The SID of the Identity resource that we associate with the phone number. Some \ + regions require an Identity to meet local regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity_sid: Option, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The phone number's origin. `twilio` identifies Twilio-owned phone numbers and \ + `hosted` identifies hosted phone numbers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "The unique string that that we created to identify this IncomingPhoneNumber resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the application that handles SMS messages sent to the phone number. If an \ + `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of \ + the application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_application_sid: Option, + #[doc = "The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_method: Option, + #[doc = "The URL that we call when an error occurs while retrieving or executing the TwiML \ + from `sms_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we call when the phone number receives an incoming SMS message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we call using the `status_callback_method` to send status information to \ + your application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback: Option, + #[doc = "The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback_method: Option, + #[doc = "The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is \ + present, we ignore all of the voice urls and voice applications and use those set on \ + the Trunk. Setting a `trunk_sid` will automatically delete your \ + `voice_application_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_receive_mode: Option, + #[doc = "The SID of the application that handles calls to the phone number. If a \ + `voice_application_sid` is present, we ignore all of the voice urls and use those \ + set on the application. Setting a `voice_application_sid` will automatically delete \ + your `trunk_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_application_sid: Option, + #[doc = "Whether we look up the caller's caller-ID name from the CNAM database ($0.01 per \ + look up). Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_method: Option, + #[doc = "The URL that we call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_method: Option, + #[doc = "The URL we call when the phone number receives a call. The `voice_url` will not be \ + used if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration that we use for emergency calling \ + from this phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_status: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumber { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumber { + const LENGTH: usize = 34; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + format!("{:?}", self.phone_number).into(), + if let Some(origin) = &self.origin { + format!("{:?}", origin).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_address_status) = &self.emergency_address_status { + format!("{:?}", emergency_address_status).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "address_sid".into(), + "address_requirements".into(), + "api_version".into(), + "beta".into(), + "capabilities".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "identity_sid".into(), + "phone_number".into(), + "origin".into(), + "sid".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "trunk_sid".into(), + "uri".into(), + "voice_receive_mode".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "emergency_address_status".into(), + "bundle_sid".into(), + "status".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberEnumAddressRequirement { + #[serde(rename = "none")] + #[display("none")] + None, + #[serde(rename = "any")] + #[display("any")] + Any, + #[serde(rename = "local")] + #[display("local")] + Local, + #[serde(rename = "foreign")] + #[display("foreign")] + Foreign, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberEnumEmergencyStatus { + Active, + Inactive, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberEnumEmergencyAddressStatus { + #[serde(rename = "registered")] + #[display("registered")] + Registered, + #[serde(rename = "unregistered")] + #[display("unregistered")] + Unregistered, + #[serde(rename = "pending-registration")] + #[display("pending-registration")] + PendingRegistration, + #[serde(rename = "registration-failure")] + #[display("registration-failure")] + RegistrationFailure, + #[serde(rename = "pending-unregistration")] + #[display("pending-unregistration")] + PendingUnregistration, + #[serde(rename = "unregistration-failure")] + #[display("unregistration-failure")] + UnregistrationFailure, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberEnumVoiceReceiveMode { + #[serde(rename = "voice")] + #[display("voice")] + Voice, + #[serde(rename = "fax")] + #[display("fax")] + Fax, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn { + #[doc = "The unique string that that we created to identify the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the Phone Number to which the Add-on is assigned."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource_sid: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "A short description of the functionality that the Add-on provides."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "A JSON string that represents the current configuration of this Add-on installation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + #[doc = "An application-defined string that uniquely identifies the resource. It can be used \ + in place of the resource's `sid` in the URL to address the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unique_name: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "A list of related resources identified by their relative URIs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn { + const LENGTH: usize = 11; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(resource_sid) = &self.resource_sid { + format!("{:?}", resource_sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(configuration) = &self.configuration { + format!("{:?}", configuration).into() + } else { + String::new().into() + }, + if let Some(unique_name) = &self.unique_name { + format!("{:?}", unique_name).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "resource_sid".into(), + "friendly_name".into(), + "description".into(), + "configuration".into(), + "unique_name".into(), + "date_created".into(), + "date_updated".into(), + "uri".into(), + "subresource_uris".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension +{ + #[doc = "The unique string that that we created to identify the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the Phone Number to which the Add-on is assigned."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource_sid: Option, + #[doc = "The SID that uniquely identifies the assigned Add-on installation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub assigned_add_on_sid: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "A string that you assigned to describe the Product this Extension is used within."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub product_name: Option, + #[doc = "An application-defined string that uniquely identifies the resource. It can be used \ + in place of the resource's `sid` in the URL to address the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unique_name: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "Whether the Extension will be invoked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} + +impl std :: fmt :: Display for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> Result < () , std :: fmt :: Error > { write ! (f , "{}" , serde_json :: to_string_pretty (self) . map_err (| _ | std :: fmt :: Error) ?) } } + +#[cfg(feature = "tabled")] +impl tabled :: Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension { const LENGTH : usize = 9 ; fn fields (& self) -> Vec < std :: borrow :: Cow < 'static , str >> { vec ! [if let Some (sid) = & self . sid { format ! ("{:?}" , sid) . into () } else { String :: new () . into () } , if let Some (account_sid) = & self . account_sid { format ! ("{:?}" , account_sid) . into () } else { String :: new () . into () } , if let Some (resource_sid) = & self . resource_sid { format ! ("{:?}" , resource_sid) . into () } else { String :: new () . into () } , if let Some (assigned_add_on_sid) = & self . assigned_add_on_sid { format ! ("{:?}" , assigned_add_on_sid) . into () } else { String :: new () . into () } , if let Some (friendly_name) = & self . friendly_name { format ! ("{:?}" , friendly_name) . into () } else { String :: new () . into () } , if let Some (product_name) = & self . product_name { format ! ("{:?}" , product_name) . into () } else { String :: new () . into () } , if let Some (unique_name) = & self . unique_name { format ! ("{:?}" , unique_name) . into () } else { String :: new () . into () } , if let Some (uri) = & self . uri { format ! ("{:?}" , uri) . into () } else { String :: new () . into () } , if let Some (enabled) = & self . enabled { format ! ("{:?}" , enabled) . into () } else { String :: new () . into () }] } fn headers () -> Vec < std :: borrow :: Cow < 'static , str >> { vec ! ["sid" . into () , "account_sid" . into () , "resource_sid" . into () , "assigned_add_on_sid" . into () , "friendly_name" . into () , "product_name" . into () , "unique_name" . into () , "uri" . into () , "enabled" . into ()] } } + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocalCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocalCapabilities { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocalCapabilities { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocal { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the Address resource associated with the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "The API version used to start a new TwiML session."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: + Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The SID of the Identity resource that we associate with the phone number. Some \ + regions require an Identity to meet local regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity_sid: Option, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The phone number's origin. `twilio` identifies Twilio-owned phone numbers and \ + `hosted` identifies hosted phone numbers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "The unique string that that we created to identify the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the application that handles SMS messages sent to the phone number. If an \ + `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of \ + the application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_application_sid: Option, + #[doc = "The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_method: Option, + #[doc = "The URL that we call when an error occurs while retrieving or executing the TwiML \ + from `sms_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we call when the phone number receives an incoming SMS message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we call using the `status_callback_method` to send status information to \ + your application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback: Option, + #[doc = "The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback_method: Option, + #[doc = "The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is \ + present, we ignore all of the voice urls and voice applications and use those set on \ + the Trunk. Setting a `trunk_sid` will automatically delete your \ + `voice_application_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_receive_mode: Option, + #[doc = "The SID of the application that handles calls to the phone number. If a \ + `voice_application_sid` is present, we ignore all of the voice urls and use those \ + set on the application. Setting a `voice_application_sid` will automatically delete \ + your `trunk_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_application_sid: Option, + #[doc = "Whether we look up the caller's caller-ID name from the CNAM database ($0.01 per \ + look up). Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_method: Option, + #[doc = "The URL that we call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_method: Option, + #[doc = "The URL we call when this phone number receives a call. The `voice_url` will not be \ + used if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration that we use for emergency calling \ + from this phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_status: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberLocal { + const LENGTH: usize = 34; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + format!("{:?}", self.phone_number).into(), + if let Some(origin) = &self.origin { + format!("{:?}", origin).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_address_status) = &self.emergency_address_status { + format!("{:?}", emergency_address_status).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "address_sid".into(), + "address_requirements".into(), + "api_version".into(), + "beta".into(), + "capabilities".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "identity_sid".into(), + "phone_number".into(), + "origin".into(), + "sid".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "trunk_sid".into(), + "uri".into(), + "voice_receive_mode".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "emergency_address_status".into(), + "bundle_sid".into(), + "status".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberLocalEnumAddressRequirement { + #[serde(rename = "none")] + #[display("none")] + None, + #[serde(rename = "any")] + #[display("any")] + Any, + #[serde(rename = "local")] + #[display("local")] + Local, + #[serde(rename = "foreign")] + #[display("foreign")] + Foreign, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberLocalEnumEmergencyStatus { + Active, + Inactive, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberLocalEnumEmergencyAddressStatus { + #[serde(rename = "registered")] + #[display("registered")] + Registered, + #[serde(rename = "unregistered")] + #[display("unregistered")] + Unregistered, + #[serde(rename = "pending-registration")] + #[display("pending-registration")] + PendingRegistration, + #[serde(rename = "registration-failure")] + #[display("registration-failure")] + RegistrationFailure, + #[serde(rename = "pending-unregistration")] + #[display("pending-unregistration")] + PendingUnregistration, + #[serde(rename = "unregistration-failure")] + #[display("unregistration-failure")] + UnregistrationFailure, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberLocalEnumVoiceReceiveMode { + #[serde(rename = "voice")] + #[display("voice")] + Voice, + #[serde(rename = "fax")] + #[display("fax")] + Fax, +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobileCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobileCapabilities { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobileCapabilities { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobile { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the Address resource associated with the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "The API version used to start a new TwiML session."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: + Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The SID of the Identity resource that we associate with the phone number. Some \ + regions require an Identity to meet local regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity_sid: Option, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The phone number's origin. `twilio` identifies Twilio-owned phone numbers and \ + `hosted` identifies hosted phone numbers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "The unique string that that we created to identify the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the application that handles SMS messages sent to the phone number. If an \ + `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of \ + the application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_application_sid: Option, + #[doc = "The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_method: Option, + #[doc = "The URL that we call when an error occurs while retrieving or executing the TwiML \ + from `sms_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we call when the phone number receives an incoming SMS message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we call using the `status_callback_method` to send status information to \ + your application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback: Option, + #[doc = "The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback_method: Option, + #[doc = "The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is \ + present, we ignore all of the voice urls and voice applications and use those set on \ + the Trunk. Setting a `trunk_sid` will automatically delete your \ + `voice_application_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_receive_mode: Option, + #[doc = "The SID of the application that handles calls to the phone number. If a \ + `voice_application_sid` is present, we ignore all of the voice urls and use those \ + set on the application. Setting a `voice_application_sid` will automatically delete \ + your `trunk_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_application_sid: Option, + #[doc = "Whether we look up the caller's caller-ID name from the CNAM database ($0.01 per \ + look up). Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_method: Option, + #[doc = "The URL that we call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_method: Option, + #[doc = "The URL we call when the phone number receives a call. The `voice_url` will not be \ + used if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration that we use for emergency calling \ + from this phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_status: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobile { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberMobile { + const LENGTH: usize = 34; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + format!("{:?}", self.phone_number).into(), + if let Some(origin) = &self.origin { + format!("{:?}", origin).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_address_status) = &self.emergency_address_status { + format!("{:?}", emergency_address_status).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "address_sid".into(), + "address_requirements".into(), + "api_version".into(), + "beta".into(), + "capabilities".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "identity_sid".into(), + "phone_number".into(), + "origin".into(), + "sid".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "trunk_sid".into(), + "uri".into(), + "voice_receive_mode".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "emergency_address_status".into(), + "bundle_sid".into(), + "status".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberMobileEnumAddressRequirement { + #[serde(rename = "none")] + #[display("none")] + None, + #[serde(rename = "any")] + #[display("any")] + Any, + #[serde(rename = "local")] + #[display("local")] + Local, + #[serde(rename = "foreign")] + #[display("foreign")] + Foreign, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberMobileEnumEmergencyStatus { + Active, + Inactive, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberMobileEnumEmergencyAddressStatus { + #[serde(rename = "registered")] + #[display("registered")] + Registered, + #[serde(rename = "unregistered")] + #[display("unregistered")] + Unregistered, + #[serde(rename = "pending-registration")] + #[display("pending-registration")] + PendingRegistration, + #[serde(rename = "registration-failure")] + #[display("registration-failure")] + RegistrationFailure, + #[serde(rename = "pending-unregistration")] + #[display("pending-unregistration")] + PendingUnregistration, + #[serde(rename = "unregistration-failure")] + #[display("unregistration-failure")] + UnregistrationFailure, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberMobileEnumVoiceReceiveMode { + #[serde(rename = "voice")] + #[display("voice")] + Voice, + #[serde(rename = "fax")] + #[display("fax")] + Fax, +} + +#[doc = "The set of Boolean properties that indicate whether a phone number can receive calls or \ + messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` \ + or `false`."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFreeCapabilities { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fax: Option, +} + +impl std::fmt::Display + for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFreeCapabilities +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFreeCapabilities { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(mms) = &self.mms { + format!("{:?}", mms).into() + } else { + String::new().into() + }, + if let Some(sms) = &self.sms { + format!("{:?}", sms).into() + } else { + String::new().into() + }, + if let Some(voice) = &self.voice { + format!("{:?}", voice).into() + } else { + String::new().into() + }, + if let Some(fax) = &self.fax { + format!("{:?}", fax).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["mms".into(), "sms".into(), "voice".into(), "fax".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFree { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the Address resource associated with the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_requirements: Option, + #[doc = "The API version used to start a new TwiML session."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Whether the phone number is new to the Twilio platform. Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beta: Option, + #[doc = "The set of Boolean properties that indicate whether a phone number can receive calls \ + or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can \ + be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: + Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The SID of the Identity resource that we associate with the phone number. Some \ + regions require an Identity to meet local regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity_sid: Option, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The phone number's origin. `twilio` identifies Twilio-owned phone numbers and \ + `hosted` identifies hosted phone numbers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "The unique string that that we created to identify the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the application that handles SMS messages sent to the phone number. If an \ + `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of \ + the application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_application_sid: Option, + #[doc = "The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_method: Option, + #[doc = "The URL that we call when an error occurs while retrieving or executing the TwiML \ + from `sms_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we call when the phone number receives an incoming SMS message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we call using the `status_callback_method` to send status information to \ + your application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback: Option, + #[doc = "The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_callback_method: Option, + #[doc = "The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is \ + present, we ignore all of the voice urls and voice applications and use those set on \ + the Trunk. Setting a `trunk_sid` will automatically delete your \ + `voice_application_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_receive_mode: Option, + #[doc = "The SID of the application that handles calls to the phone number. If a \ + `voice_application_sid` is present, we ignore all of the voice urls and use those \ + set on the application. Setting a `voice_application_sid` will automatically delete \ + your `trunk_sid` and vice versa."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_application_sid: Option, + #[doc = "Whether we look up the caller's caller-ID name from the CNAM database ($0.01 per \ + look up). Can be: `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_method: Option, + #[doc = "The URL that we call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_method: Option, + #[doc = "The URL we call when the phone number receives a call. The `voice_url` will not be \ + used if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration that we use for emergency calling \ + from this phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_address_status: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFree { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberTollFree { + const LENGTH: usize = 34; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(address_requirements) = &self.address_requirements { + format!("{:?}", address_requirements).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(beta) = &self.beta { + format!("{:?}", beta).into() + } else { + String::new().into() + }, + if let Some(capabilities) = &self.capabilities { + format!("{:?}", capabilities).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + format!("{:?}", self.phone_number).into(), + if let Some(origin) = &self.origin { + format!("{:?}", origin).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_address_status) = &self.emergency_address_status { + format!("{:?}", emergency_address_status).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "address_sid".into(), + "address_requirements".into(), + "api_version".into(), + "beta".into(), + "capabilities".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "identity_sid".into(), + "phone_number".into(), + "origin".into(), + "sid".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "trunk_sid".into(), + "uri".into(), + "voice_receive_mode".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "emergency_address_status".into(), + "bundle_sid".into(), + "status".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberTollFreeEnumAddressRequirement { + #[serde(rename = "none")] + #[display("none")] + None, + #[serde(rename = "any")] + #[display("any")] + Any, + #[serde(rename = "local")] + #[display("local")] + Local, + #[serde(rename = "foreign")] + #[display("foreign")] + Foreign, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberTollFreeEnumEmergencyStatus { + Active, + Inactive, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberTollFreeEnumEmergencyAddressStatus { + #[serde(rename = "registered")] + #[display("registered")] + Registered, + #[serde(rename = "unregistered")] + #[display("unregistered")] + Unregistered, + #[serde(rename = "pending-registration")] + #[display("pending-registration")] + PendingRegistration, + #[serde(rename = "registration-failure")] + #[display("registration-failure")] + RegistrationFailure, + #[serde(rename = "pending-unregistration")] + #[display("pending-unregistration")] + PendingUnregistration, + #[serde(rename = "unregistration-failure")] + #[display("unregistration-failure")] + UnregistrationFailure, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IncomingPhoneNumberTollFreeEnumVoiceReceiveMode { + #[serde(rename = "voice")] + #[display("voice")] + Voice, + #[serde(rename = "fax")] + #[display("fax")] + Fax, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountKey { + #[doc = "The unique string that that we created to identify the Key resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, +} + +impl std::fmt::Display for ApiV2010AccountKey { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountKey { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "friendly_name".into(), + "date_created".into(), + "date_updated".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountMessageMedia { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this Media resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The default [mime-type](https://en.wikipedia.org/wiki/Internet_media_type) of the \ + media, for example `image/jpeg`, `image/png`, or `image/gif`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content_type: Option, + #[doc = "The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The SID of the resource that created the media."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_sid: Option, + #[doc = "The unique string that that we created to identify this Media resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI of this resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountMessageMedia { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountMessageMedia { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(content_type) = &self.content_type { + format!("{:?}", content_type).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(parent_sid) = &self.parent_sid { + format!("{:?}", parent_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "content_type".into(), + "date_created".into(), + "date_updated".into(), + "parent_sid".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountQueueMember { + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Member resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The date that the member was enqueued, given in RFC 2822 format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_enqueued: Option>, + #[doc = "This member's current position in the queue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub position: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The number of seconds the member has been in the queue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wait_time: Option, + #[doc = "The SID of the Queue the member is in."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue_sid: Option, +} + +impl std::fmt::Display for ApiV2010AccountQueueMember { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountQueueMember { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(date_enqueued) = &self.date_enqueued { + format!("{:?}", date_enqueued).into() + } else { + String::new().into() + }, + if let Some(position) = &self.position { + format!("{:?}", position).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(wait_time) = &self.wait_time { + format!("{:?}", wait_time).into() + } else { + String::new().into() + }, + if let Some(queue_sid) = &self.queue_sid { + format!("{:?}", queue_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "call_sid".into(), + "date_enqueued".into(), + "position".into(), + "uri".into(), + "wait_time".into(), + "queue_sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountMessage { + #[doc = "The message text. Can be up to 1,600 characters long."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub body: Option, + #[doc = "The number of segments that make up the complete message. A message body that is too \ + large to be sent in a single SMS message is segmented and charged as multiple \ + messages. Inbound messages over 160 characters are reassembled when the message is \ + received. Note: When using a Messaging Service to send messages, `num_segments` will \ + always be 0 in Twilio's response to your API request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub num_segments: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub direction: Option, + #[doc = "The phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or [Wireless SIM](https://www.twilio.com/docs/wireless/tutorials/communications-guides/how-to-send-and-receive-text-messages) that initiated the message. For incoming messages, this will be the number of the sending phone. For outgoing messages, this value will be one of your Twilio phone numbers or the alphanumeric sender ID used."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub from: phone_number::PhoneNumber, + #[doc = "The phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format that \ + received the message. For incoming messages, this will be one of your Twilio phone \ + numbers. For outgoing messages, this will be the sending phone."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub to: Option, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The amount billed for the message, in the currency specified by `price_unit`. Note \ + that your account is charged for each segment we send to the handset. Populated \ + after the message has been sent. May not be immediately available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The description of the `error_code` if your message `status` is `failed` or \ + `undelivered`. If the message was successful, this value is null."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that sent the \ + message that created the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The number of media files associated with the message. A message can send up to 10 \ + media files."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub num_media: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) \ + used with the message. The value is null if a Messaging Service was not used."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub messaging_service_sid: Option, + #[doc = "The unique string that that we created to identify the Message resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The date and time in GMT that the resource was sent specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. For outgoing messages, this is when we sent the message. For incoming messages, this is when we made the HTTP request to your application. "] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_sent: Option>, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The error code returned if your message `status` is `failed` or `undelivered`. The \ + error_code provides more information about the failure. If the message was \ + successful, this value is null."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The API version used to process the message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "A list of related resources identified by their URIs relative to `https://api.twilio.com`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, +} + +impl std::fmt::Display for ApiV2010AccountMessage { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountMessage { + const LENGTH: usize = 20; + fn fields(&self) -> Vec> { + vec![ + if let Some(body) = &self.body { + format!("{:?}", body).into() + } else { + String::new().into() + }, + if let Some(num_segments) = &self.num_segments { + format!("{:?}", num_segments).into() + } else { + String::new().into() + }, + if let Some(direction) = &self.direction { + format!("{:?}", direction).into() + } else { + String::new().into() + }, + format!("{:?}", self.from).into(), + if let Some(to) = &self.to { + format!("{:?}", to).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(error_message) = &self.error_message { + format!("{:?}", error_message).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(num_media) = &self.num_media { + format!("{:?}", num_media).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(messaging_service_sid) = &self.messaging_service_sid { + format!("{:?}", messaging_service_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(date_sent) = &self.date_sent { + format!("{:?}", date_sent).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "body".into(), + "num_segments".into(), + "direction".into(), + "from".into(), + "to".into(), + "date_updated".into(), + "price".into(), + "error_message".into(), + "uri".into(), + "account_sid".into(), + "num_media".into(), + "status".into(), + "messaging_service_sid".into(), + "sid".into(), + "date_sent".into(), + "date_created".into(), + "error_code".into(), + "price_unit".into(), + "api_version".into(), + "subresource_uris".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum MessageEnumStatus { + #[serde(rename = "queued")] + #[display("queued")] + Queued, + #[serde(rename = "sending")] + #[display("sending")] + Sending, + #[serde(rename = "sent")] + #[display("sent")] + Sent, + #[serde(rename = "failed")] + #[display("failed")] + Failed, + #[serde(rename = "delivered")] + #[display("delivered")] + Delivered, + #[serde(rename = "undelivered")] + #[display("undelivered")] + Undelivered, + #[serde(rename = "receiving")] + #[display("receiving")] + Receiving, + #[serde(rename = "received")] + #[display("received")] + Received, + #[serde(rename = "accepted")] + #[display("accepted")] + Accepted, + #[serde(rename = "scheduled")] + #[display("scheduled")] + Scheduled, + #[serde(rename = "read")] + #[display("read")] + Read, + #[serde(rename = "partially_delivered")] + #[display("partially_delivered")] + PartiallyDelivered, + #[serde(rename = "canceled")] + #[display("canceled")] + Canceled, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum MessageEnumUpdateStatus { + #[serde(rename = "canceled")] + #[display("canceled")] + #[default] + Canceled, +} + + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum MessageEnumDirection { + #[serde(rename = "inbound")] + #[display("inbound")] + Inbound, + #[serde(rename = "outbound-api")] + #[display("outbound-api")] + OutboundApi, + #[serde(rename = "outbound-call")] + #[display("outbound-call")] + OutboundCall, + #[serde(rename = "outbound-reply")] + #[display("outbound-reply")] + OutboundReply, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum MessageEnumContentRetention { + #[serde(rename = "retain")] + #[display("retain")] + #[default] + Retain, +} + + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum MessageEnumAddressRetention { + #[serde(rename = "retain")] + #[display("retain")] + #[default] + Retain, +} + + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum MessageEnumTrafficType { + #[serde(rename = "free")] + #[display("free")] + #[default] + Free, +} + + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum MessageEnumScheduleType { + #[serde(rename = "fixed")] + #[display("fixed")] + #[default] + Fixed, +} + + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountMessageMessageFeedback { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the MessageFeedback resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the Message resource for which the feedback was provided."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountMessageMessageFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountMessageMessageFeedback { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(message_sid) = &self.message_sid { + format!("{:?}", message_sid).into() + } else { + String::new().into() + }, + if let Some(outcome) = &self.outcome { + format!("{:?}", outcome).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "message_sid".into(), + "outcome".into(), + "date_created".into(), + "date_updated".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum MessageFeedbackEnumOutcome { + #[serde(rename = "confirmed")] + #[display("confirmed")] + Confirmed, + #[serde(rename = "unconfirmed")] + #[display("unconfirmed")] + Unconfirmed, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountNewKey { + #[doc = "The unique string that that we created to identify the NewKey resource. You will use \ + this as the basic-auth `user` when authenticating to the API."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The secret your application uses to sign Access Tokens and to authenticate to the \ + REST API (you will use this as the basic-auth `password`). **Note that for security \ + reasons, this field is ONLY returned when the API Key is first created.**"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl std::fmt::Display for ApiV2010AccountNewKey { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountNewKey { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(secret) = &self.secret { + format!("{:?}", secret).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "friendly_name".into(), + "date_created".into(), + "date_updated".into(), + "secret".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountNewSigningKey { + #[doc = "The unique string that that we created to identify the NewSigningKey resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The secret your application uses to sign Access Tokens and to authenticate to the \ + REST API (you will use this as the basic-auth `password`). **Note that for security \ + reasons, this field is ONLY returned when the API Key is first created.**"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl std::fmt::Display for ApiV2010AccountNewSigningKey { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountNewSigningKey { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(secret) = &self.secret { + format!("{:?}", secret).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "friendly_name".into(), + "date_created".into(), + "date_updated".into(), + "secret".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountNotification { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to generate the notification. Can be empty for events that \ + don't have a specific API version, such as incoming phone calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Notification resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A unique error code for the error condition that is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "An integer log level that corresponds to the type of notification: `0` is ERROR, `1` \ + is WARNING."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log: Option, + #[doc = "The date the notification was actually generated in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from `date_created`."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub message_date: Option>, + #[doc = "The text of the notification."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_text: Option, + #[doc = "The URL for more information about the error condition. This value is a page in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub more_info: Option, + #[doc = "The HTTP method used to generate the notification. If the notification was generated \ + during a phone call, this is the HTTP Method used to request the resource on your \ + server. If the notification was generated by your use of our REST API, this is the \ + HTTP method used to call the resource on our servers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_method: Option, + #[doc = "The URL of the resource that generated the notification. If the notification was \ + generated during a phone call, this is the URL of the resource on your server that \ + caused the notification. If the notification was generated by your use of our REST \ + API, this is the URL of the resource you called."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_url: Option, + #[doc = "The unique string that that we created to identify the Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountNotification { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountNotification { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(log) = &self.log { + format!("{:?}", log).into() + } else { + String::new().into() + }, + if let Some(message_date) = &self.message_date { + format!("{:?}", message_date).into() + } else { + String::new().into() + }, + if let Some(message_text) = &self.message_text { + format!("{:?}", message_text).into() + } else { + String::new().into() + }, + if let Some(more_info) = &self.more_info { + format!("{:?}", more_info).into() + } else { + String::new().into() + }, + if let Some(request_method) = &self.request_method { + format!("{:?}", request_method).into() + } else { + String::new().into() + }, + if let Some(request_url) = &self.request_url { + format!("{:?}", request_url).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "call_sid".into(), + "date_created".into(), + "date_updated".into(), + "error_code".into(), + "log".into(), + "message_date".into(), + "message_text".into(), + "more_info".into(), + "request_method".into(), + "request_url".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountNotificationInstance { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to generate the notification. Can be empty for events that \ + don't have a specific API version, such as incoming phone calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Notification resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A unique error code for the error condition that is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "An integer log level that corresponds to the type of notification: `0` is ERROR, `1` \ + is WARNING."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub log: Option, + #[doc = "The date the notification was actually generated in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from `date_created`."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub message_date: Option>, + #[doc = "The text of the notification."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_text: Option, + #[doc = "The URL for more information about the error condition. This value is a page in our [Error Dictionary](https://www.twilio.com/docs/api/errors)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub more_info: Option, + #[doc = "The HTTP method used to generate the notification. If the notification was generated \ + during a phone call, this is the HTTP Method used to request the resource on your \ + server. If the notification was generated by your use of our REST API, this is the \ + HTTP method used to call the resource on our servers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_method: Option, + #[doc = "The URL of the resource that generated the notification. If the notification was \ + generated during a phone call, this is the URL of the resource on your server that \ + caused the notification. If the notification was generated by your use of our REST \ + API, this is the URL of the resource you called."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_url: Option, + #[doc = "The HTTP GET or POST variables we sent to your server. However, if the notification \ + was generated by our REST API, this contains the HTTP POST or PUT variables you sent \ + to our API."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_variables: Option, + #[doc = "The HTTP body returned by your server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub response_body: Option, + #[doc = "The HTTP headers returned by your server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub response_headers: Option, + #[doc = "The unique string that that we created to identify the Notification resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountNotificationInstance { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountNotificationInstance { + const LENGTH: usize = 17; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(log) = &self.log { + format!("{:?}", log).into() + } else { + String::new().into() + }, + if let Some(message_date) = &self.message_date { + format!("{:?}", message_date).into() + } else { + String::new().into() + }, + if let Some(message_text) = &self.message_text { + format!("{:?}", message_text).into() + } else { + String::new().into() + }, + if let Some(more_info) = &self.more_info { + format!("{:?}", more_info).into() + } else { + String::new().into() + }, + if let Some(request_method) = &self.request_method { + format!("{:?}", request_method).into() + } else { + String::new().into() + }, + if let Some(request_url) = &self.request_url { + format!("{:?}", request_url).into() + } else { + String::new().into() + }, + if let Some(request_variables) = &self.request_variables { + format!("{:?}", request_variables).into() + } else { + String::new().into() + }, + if let Some(response_body) = &self.response_body { + format!("{:?}", response_body).into() + } else { + String::new().into() + }, + if let Some(response_headers) = &self.response_headers { + format!("{:?}", response_headers).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "call_sid".into(), + "date_created".into(), + "date_updated".into(), + "error_code".into(), + "log".into(), + "message_date".into(), + "message_text".into(), + "more_info".into(), + "request_method".into(), + "request_url".into(), + "request_variables".into(), + "response_body".into(), + "response_headers".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountOutgoingCallerId { + #[doc = "The unique string that that we created to identify the OutgoingCallerId resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the OutgoingCallerId resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, \ + which consists of a + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountOutgoingCallerId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountOutgoingCallerId { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + format!("{:?}", self.phone_number).into(), + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "account_sid".into(), + "phone_number".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountConferenceParticipant { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Participant resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Participant resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The user-specified label of this participant, if one was given when the participant \ + was created. This may be used to fetch, update or delete the participant."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option, + #[doc = "The SID of the participant who is being `coached`. The participant being coached is \ + the only participant who can hear the participant who is `coaching`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid_to_coach: Option, + #[doc = "Whether the participant is coaching another call. Can be: `true` or `false`. If not \ + present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, \ + `call_sid_to_coach` must be defined."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub coaching: Option, + #[doc = "The SID of the conference the participant is in."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conference_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "Whether the conference ends when the participant leaves. Can be: `true` or `false` \ + and the default is `false`. If `true`, the conference ends and all other \ + participants drop out when the participant leaves."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_conference_on_exit: Option, + #[doc = "Whether the participant is muted. Can be `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub muted: Option, + #[doc = "Whether the participant is on hold. Can be `true` or `false`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hold: Option, + #[doc = "Whether the conference starts when the participant joins the conference, if it has \ + not already started. Can be: `true` or `false` and the default is `true`. If `false` \ + and the conference has not started, the participant is muted and hears background \ + music until another participant starts the conference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_conference_on_enter: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountConferenceParticipant { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountConferenceParticipant { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(label) = &self.label { + format!("{:?}", label).into() + } else { + String::new().into() + }, + if let Some(call_sid_to_coach) = &self.call_sid_to_coach { + format!("{:?}", call_sid_to_coach).into() + } else { + String::new().into() + }, + if let Some(coaching) = &self.coaching { + format!("{:?}", coaching).into() + } else { + String::new().into() + }, + if let Some(conference_sid) = &self.conference_sid { + format!("{:?}", conference_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(end_conference_on_exit) = &self.end_conference_on_exit { + format!("{:?}", end_conference_on_exit).into() + } else { + String::new().into() + }, + if let Some(muted) = &self.muted { + format!("{:?}", muted).into() + } else { + String::new().into() + }, + if let Some(hold) = &self.hold { + format!("{:?}", hold).into() + } else { + String::new().into() + }, + if let Some(start_conference_on_enter) = &self.start_conference_on_enter { + format!("{:?}", start_conference_on_enter).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "call_sid".into(), + "label".into(), + "call_sid_to_coach".into(), + "coaching".into(), + "conference_sid".into(), + "date_created".into(), + "date_updated".into(), + "end_conference_on_exit".into(), + "muted".into(), + "hold".into(), + "start_conference_on_enter".into(), + "status".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ParticipantEnumStatus { + #[serde(rename = "queued")] + #[display("queued")] + Queued, + #[serde(rename = "connecting")] + #[display("connecting")] + Connecting, + #[serde(rename = "ringing")] + #[display("ringing")] + Ringing, + #[serde(rename = "connected")] + #[display("connected")] + Connected, + #[serde(rename = "complete")] + #[display("complete")] + Complete, + #[serde(rename = "failed")] + #[display("failed")] + Failed, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallPayments { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Payments resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Payments resource is associated with. This will refer to the call sid that is \ + producing the payment card (credit/ACH) information thru DTMF."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The SID of the Payments resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallPayments { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallPayments { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "call_sid".into(), + "sid".into(), + "date_created".into(), + "date_updated".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum PaymentsEnumPaymentMethod { + #[serde(rename = "credit-card")] + #[display("credit-card")] + CreditCard, + #[serde(rename = "ach-debit")] + #[display("ach-debit")] + AchDebit, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum PaymentsEnumBankAccountType { + #[serde(rename = "consumer-checking")] + #[display("consumer-checking")] + ConsumerChecking, + #[serde(rename = "consumer-savings")] + #[display("consumer-savings")] + ConsumerSavings, + #[serde(rename = "commercial-checking")] + #[display("commercial-checking")] + CommercialChecking, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum PaymentsEnumTokenType { + #[serde(rename = "one-time")] + #[display("one-time")] + OneTime, + #[serde(rename = "reusable")] + #[display("reusable")] + Reusable, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum PaymentsEnumCapture { + #[serde(rename = "payment-card-number")] + #[display("payment-card-number")] + PaymentCardNumber, + #[serde(rename = "expiration-date")] + #[display("expiration-date")] + ExpirationDate, + #[serde(rename = "security-code")] + #[display("security-code")] + SecurityCode, + #[serde(rename = "postal-code")] + #[display("postal-code")] + PostalCode, + #[serde(rename = "bank-routing-number")] + #[display("bank-routing-number")] + BankRoutingNumber, + #[serde(rename = "bank-account-number")] + #[display("bank-account-number")] + BankAccountNumber, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum PaymentsEnumStatus { + #[serde(rename = "complete")] + #[display("complete")] + Complete, + #[serde(rename = "cancel")] + #[display("cancel")] + Cancel, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountQueue { + #[doc = "The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The number of calls currently in the queue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current_size: Option, + #[doc = "A string that you assigned to describe this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The URI of this resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this Queue resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = " The average wait time in seconds of the members in this queue. This is calculated \ + at the time of the request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub average_wait_time: Option, + #[doc = "The unique string that that we created to identify this Queue resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = " The maximum number of calls that can be in the queue. The default is 100 and the \ + maximum is 5000."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max_size: Option, +} + +impl std::fmt::Display for ApiV2010AccountQueue { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountQueue { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(current_size) = &self.current_size { + format!("{:?}", current_size).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(average_wait_time) = &self.average_wait_time { + format!("{:?}", average_wait_time).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(max_size) = &self.max_size { + format!("{:?}", max_size).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "date_updated".into(), + "current_size".into(), + "friendly_name".into(), + "uri".into(), + "account_sid".into(), + "average_wait_time".into(), + "sid".into(), + "date_created".into(), + "max_size".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountRecording { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Recording resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used during the recording."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Recording resource is associated with. This will always refer to the parent leg of a \ + two-leg call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The Conference SID that identifies the conference associated with the recording, if \ + a conference recording."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conference_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The start time of the recording in GMT and in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub start_time: Option>, + #[doc = "The length of the recording in seconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[doc = "The unique string that that we created to identify the Recording resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The one-time cost of creating the recording in the `price_unit` currency."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency used in the `price` property. Example: `USD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The number of channels in the final recording file. Can be: `1` or `2`. You can split a call with two legs into two separate recording channels if you record using [TwiML Dial](https://www.twilio.com/docs/voice/twiml/dial#record) or the [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls#manage-your-outbound-call)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub channels: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encryption_details: Option, + #[doc = "A list of related resources identified by their relative URIs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URL of the media file associated with this recording resource. When stored \ + externally, this is the full URL location of the media file."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub media_url: Option, +} + +impl std::fmt::Display for ApiV2010AccountRecording { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountRecording { + const LENGTH: usize = 19; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(conference_sid) = &self.conference_sid { + format!("{:?}", conference_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(channels) = &self.channels { + format!("{:?}", channels).into() + } else { + String::new().into() + }, + if let Some(source) = &self.source { + format!("{:?}", source).into() + } else { + String::new().into() + }, + if let Some(error_code) = &self.error_code { + format!("{:?}", error_code).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(encryption_details) = &self.encryption_details { + format!("{:?}", encryption_details).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(media_url) = &self.media_url { + format!("{:?}", media_url).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "call_sid".into(), + "conference_sid".into(), + "date_created".into(), + "date_updated".into(), + "start_time".into(), + "duration".into(), + "sid".into(), + "price".into(), + "price_unit".into(), + "status".into(), + "channels".into(), + "source".into(), + "error_code".into(), + "uri".into(), + "encryption_details".into(), + "subresource_uris".into(), + "media_url".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum RecordingEnumStatus { + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "paused")] + #[display("paused")] + Paused, + #[serde(rename = "stopped")] + #[display("stopped")] + Stopped, + #[serde(rename = "processing")] + #[display("processing")] + Processing, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "absent")] + #[display("absent")] + Absent, + #[serde(rename = "deleted")] + #[display("deleted")] + Deleted, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum RecordingEnumSource { + DialVerb, + Conference, + OutboundAPI, + Trunking, + RecordVerb, + StartCallRecordingAPI, + StartConferenceRecordingAPI, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountRecordingRecordingAddOnResult { + #[doc = "The unique string that that we created to identify the Recording AddOnResult \ + resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Recording AddOnResult resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The SID of the Add-on to which the result belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub add_on_sid: Option, + #[doc = "The SID of the Add-on configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub add_on_configuration_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The date and time in GMT that the result was completed specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_completed: Option>, + #[doc = "The SID of the recording to which the AddOnResult resource belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reference_sid: Option, + #[doc = "A list of related resources identified by their relative URIs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, +} + +impl std::fmt::Display for ApiV2010AccountRecordingRecordingAddOnResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountRecordingRecordingAddOnResult { + const LENGTH: usize = 10; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(add_on_sid) = &self.add_on_sid { + format!("{:?}", add_on_sid).into() + } else { + String::new().into() + }, + if let Some(add_on_configuration_sid) = &self.add_on_configuration_sid { + format!("{:?}", add_on_configuration_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(date_completed) = &self.date_completed { + format!("{:?}", date_completed).into() + } else { + String::new().into() + }, + if let Some(reference_sid) = &self.reference_sid { + format!("{:?}", reference_sid).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "status".into(), + "add_on_sid".into(), + "add_on_configuration_sid".into(), + "date_created".into(), + "date_updated".into(), + "date_completed".into(), + "reference_sid".into(), + "subresource_uris".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum RecordingAddOnResultEnumStatus { + #[serde(rename = "canceled")] + #[display("canceled")] + Canceled, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "deleted")] + #[display("deleted")] + Deleted, + #[serde(rename = "failed")] + #[display("failed")] + Failed, + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "init")] + #[display("init")] + Init, + #[serde(rename = "processing")] + #[display("processing")] + Processing, + #[serde(rename = "queued")] + #[display("queued")] + Queued, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountRecordingRecordingAddOnResultRecordingAddOnResultPayload { + #[doc = "The unique string that that we created to identify the Recording AddOnResult Payload \ + resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the AddOnResult to which the payload belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub add_on_result_sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Recording AddOnResult Payload resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The string provided by the vendor that describes the payload."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option, + #[doc = "The SID of the Add-on to which the result belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub add_on_sid: Option, + #[doc = "The SID of the Add-on configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub add_on_configuration_sid: Option, + #[doc = "The MIME type of the payload."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content_type: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The SID of the recording to which the AddOnResult resource that contains the payload \ + belongs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reference_sid: Option, + #[doc = "A list of related resources identified by their relative URIs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, +} + +impl std::fmt::Display for ApiV2010AccountRecordingRecordingAddOnResultRecordingAddOnResultPayload { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountRecordingRecordingAddOnResultRecordingAddOnResultPayload { + const LENGTH: usize = 11; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(add_on_result_sid) = &self.add_on_result_sid { + format!("{:?}", add_on_result_sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(label) = &self.label { + format!("{:?}", label).into() + } else { + String::new().into() + }, + if let Some(add_on_sid) = &self.add_on_sid { + format!("{:?}", add_on_sid).into() + } else { + String::new().into() + }, + if let Some(add_on_configuration_sid) = &self.add_on_configuration_sid { + format!("{:?}", add_on_configuration_sid).into() + } else { + String::new().into() + }, + if let Some(content_type) = &self.content_type { + format!("{:?}", content_type).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(reference_sid) = &self.reference_sid { + format!("{:?}", reference_sid).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "add_on_result_sid".into(), + "account_sid".into(), + "label".into(), + "add_on_sid".into(), + "add_on_configuration_sid".into(), + "content_type".into(), + "date_created".into(), + "date_updated".into(), + "reference_sid".into(), + "subresource_uris".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountRecordingRecordingTranscription { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Transcription resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the transcription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The duration of the transcribed audio in seconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[doc = "The charge for the transcript in the currency associated with the account. This \ + value is populated after the transcript is complete so it may not be available \ + immediately."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) from \ + which the transcription was created."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recording_sid: Option, + #[doc = "The unique string that that we created to identify the Transcription resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The text content of the transcription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub transcription_text: Option, + #[doc = "The transcription type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountRecordingRecordingTranscription { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountRecordingRecordingTranscription { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(recording_sid) = &self.recording_sid { + format!("{:?}", recording_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(transcription_text) = &self.transcription_text { + format!("{:?}", transcription_text).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "date_created".into(), + "date_updated".into(), + "duration".into(), + "price".into(), + "price_unit".into(), + "recording_sid".into(), + "sid".into(), + "status".into(), + "transcription_text".into(), + "type_".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum RecordingTranscriptionEnumStatus { + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "failed")] + #[display("failed")] + Failed, +} + +#[doc = "The HTTP method we use to call the `sms_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ApiV2010AccountShortCodeSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we use to call the `sms_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ApiV2010AccountShortCodeSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountShortCode { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this ShortCode resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to start a new TwiML session when an SMS message is sent to \ + this short code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A string that you assigned to describe this resource. By default, the `FriendlyName` \ + is the short code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The short code. e.g., 894546."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub short_code: Option, + #[doc = "The unique string that that we created to identify this ShortCode resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The HTTP method we use to call the `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_method: Option, + #[doc = "The URL that we call if an error occurs while retrieving or executing the TwiML from \ + `sms_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we use to call the `sms_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we call when receiving an incoming SMS message to this short code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URI of this resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountShortCode { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountShortCode { + const LENGTH: usize = 12; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(short_code) = &self.short_code { + format!("{:?}", short_code).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "short_code".into(), + "sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSigningKey { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, +} + +impl std::fmt::Display for ApiV2010AccountSigningKey { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSigningKey { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "friendly_name".into(), + "date_created".into(), + "date_updated".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSip {} + +impl std::fmt::Display for ApiV2010AccountSip { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSip { + const LENGTH: usize = 0; + fn fields(&self) -> Vec> { + vec![] + } + + fn headers() -> Vec> { + vec![] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipAuth {} + +impl std::fmt::Display for ApiV2010AccountSipSipDomainSipAuth { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipDomainSipAuth { + const LENGTH: usize = 0; + fn fields(&self) -> Vec> { + vec![] + } + + fn headers() -> Vec> { + vec![] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipAuthSipAuthCalls {} + +impl std::fmt::Display for ApiV2010AccountSipSipDomainSipAuthSipAuthCalls { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipDomainSipAuthSipAuthCalls { + const LENGTH: usize = 0; + fn fields(&self) -> Vec> { + vec![] + } + + fn headers() -> Vec> { + vec![] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsCredentialListMapping { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the CredentialListMapping resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The unique string that that we created to identify the CredentialListMapping \ + resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, +} + +impl std::fmt::Display + for ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsCredentialListMapping +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsCredentialListMapping +{ + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsIpAccessControlListMapping { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the IpAccessControlListMapping resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The unique string that that we created to identify the IpAccessControlListMapping \ + resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, +} + +impl std::fmt::Display + for ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsIpAccessControlListMapping +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled + for ApiV2010AccountSipSipDomainSipAuthSipAuthCallsSipAuthCallsIpAccessControlListMapping +{ + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrations {} + +impl std::fmt::Display for ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrations { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrations { + const LENGTH: usize = 0; + fn fields(&self) -> Vec> { + vec![] + } + + fn headers() -> Vec> { + vec![] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping +{ + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the CredentialListMapping resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The unique string that that we created to identify the CredentialListMapping \ + resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, +} + +impl std :: fmt :: Display for ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> Result < () , std :: fmt :: Error > { write ! (f , "{}" , serde_json :: to_string_pretty (self) . map_err (| _ | std :: fmt :: Error) ?) } } + +#[cfg(feature = "tabled")] +impl tabled :: Tabled for ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping { const LENGTH : usize = 5 ; fn fields (& self) -> Vec < std :: borrow :: Cow < 'static , str >> { vec ! [if let Some (account_sid) = & self . account_sid { format ! ("{:?}" , account_sid) . into () } else { String :: new () . into () } , if let Some (date_created) = & self . date_created { format ! ("{:?}" , date_created) . into () } else { String :: new () . into () } , if let Some (date_updated) = & self . date_updated { format ! ("{:?}" , date_updated) . into () } else { String :: new () . into () } , if let Some (friendly_name) = & self . friendly_name { format ! ("{:?}" , friendly_name) . into () } else { String :: new () . into () } , if let Some (sid) = & self . sid { format ! ("{:?}" , sid) . into () } else { String :: new () . into () }] } fn headers () -> Vec < std :: borrow :: Cow < 'static , str >> { vec ! ["account_sid" . into () , "date_created" . into () , "date_updated" . into () , "friendly_name" . into () , "sid" . into ()] } } + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipCredentialListSipCredential { + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The unique id of the Account that is responsible for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The unique id that identifies the credential list that includes this credential."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credential_list_sid: Option, + #[doc = "The username for this credential."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The URI for this resource, relative to `https://api.twilio.com`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountSipSipCredentialListSipCredential { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipCredentialListSipCredential { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(credential_list_sid) = &self.credential_list_sid { + format!("{:?}", credential_list_sid).into() + } else { + String::new().into() + }, + if let Some(username) = &self.username { + format!("{:?}", username).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "credential_list_sid".into(), + "username".into(), + "date_created".into(), + "date_updated".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipCredentialList { + #[doc = "The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that \ + owns this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A human readable descriptive text that describes the CredentialList, up to 64 \ + characters long."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "A list of credentials associated with this credential list."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI for this resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountSipSipCredentialList { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipCredentialList { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "friendly_name".into(), + "sid".into(), + "subresource_uris".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipCredentialListMapping { + #[doc = "The unique id of the Account that is responsible for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The unique string that is created to identify the SipDomain resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain_sid: Option, + #[doc = "A human readable descriptive text for this resource, up to 64 characters long."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI for this resource, relative to `https://api.twilio.com`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountSipSipDomainSipCredentialListMapping { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipDomainSipCredentialListMapping { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(domain_sid) = &self.domain_sid { + format!("{:?}", domain_sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "domain_sid".into(), + "friendly_name".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we use to call `voice_status_callback_url`. Either `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum VoiceStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomain { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the SipDomain resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to process the call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The types of authentication you have mapped to your domain. Can be: `IP_ACL` and \ + `CREDENTIAL_LIST`. If you have both defined for your domain, both will be returned \ + in a comma delimited string. If `auth_type` is not defined, the domain will not be \ + able to receive any traffic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub auth_type: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The unique address you reserve on Twilio to which you route your SIP traffic. Domain \ + names can contain letters, digits, and \"-\" and must end with `sip.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain_name: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The unique string that that we created to identify the SipDomain resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_method: Option, + #[doc = "The URL that we call when an error occurs while retrieving or executing the TwiML \ + requested from `voice_url`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_method: Option, + #[doc = "The HTTP method we use to call `voice_status_callback_url`. Either `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_status_callback_method: Option, + #[doc = "The URL that we call to pass status parameters (such as call ended) to your \ + application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_status_callback_url: Option, + #[doc = "The URL we call using the `voice_method` when the domain receives a call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "A list of mapping resources associated with the SIP Domain resource identified by \ + their relative URIs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "Whether to allow SIP Endpoints to register with the domain to receive calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sip_registration: Option, + #[doc = "Whether emergency calling is enabled for the domain. If enabled, allows emergency \ + calls on the domain from phone numbers with validated addresses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_calling_enabled: Option, + #[doc = "Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and \ + SRTP will be negotiated on all incoming calls to this sip domain."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secure: Option, + #[doc = "The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will \ + be associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub byoc_trunk_sid: Option, + #[doc = "Whether an emergency caller sid is configured for the domain. If present, this phone \ + number will be used as the callback for the emergency call."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emergency_caller_sid: Option, +} + +impl std::fmt::Display for ApiV2010AccountSipSipDomain { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipDomain { + const LENGTH: usize = 21; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(auth_type) = &self.auth_type { + format!("{:?}", auth_type).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(domain_name) = &self.domain_name { + format!("{:?}", domain_name).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_status_callback_method) = &self.voice_status_callback_method { + format!("{:?}", voice_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_status_callback_url) = &self.voice_status_callback_url { + format!("{:?}", voice_status_callback_url).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(sip_registration) = &self.sip_registration { + format!("{:?}", sip_registration).into() + } else { + String::new().into() + }, + if let Some(emergency_calling_enabled) = &self.emergency_calling_enabled { + format!("{:?}", emergency_calling_enabled).into() + } else { + String::new().into() + }, + if let Some(secure) = &self.secure { + format!("{:?}", secure).into() + } else { + String::new().into() + }, + if let Some(byoc_trunk_sid) = &self.byoc_trunk_sid { + format!("{:?}", byoc_trunk_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_caller_sid) = &self.emergency_caller_sid { + format!("{:?}", emergency_caller_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "auth_type".into(), + "date_created".into(), + "date_updated".into(), + "domain_name".into(), + "friendly_name".into(), + "sid".into(), + "uri".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_status_callback_method".into(), + "voice_status_callback_url".into(), + "voice_url".into(), + "subresource_uris".into(), + "sip_registration".into(), + "emergency_calling_enabled".into(), + "secure".into(), + "byoc_trunk_sid".into(), + "emergency_caller_sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipIpAccessControlList { + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that \ + owns this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "A human readable descriptive text, up to 255 characters long."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "A list of the IpAddress resources associated with this IP access control list \ + resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI for this resource, relative to `https://api.twilio.com`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountSipSipIpAccessControlList { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipIpAccessControlList { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "friendly_name".into(), + "date_created".into(), + "date_updated".into(), + "subresource_uris".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipDomainSipIpAccessControlListMapping { + #[doc = "The unique id of the Account that is responsible for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The unique string that is created to identify the SipDomain resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain_sid: Option, + #[doc = "A human readable descriptive text for this resource, up to 64 characters long."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The URI for this resource, relative to `https://api.twilio.com`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountSipSipDomainSipIpAccessControlListMapping { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipDomainSipIpAccessControlListMapping { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(domain_sid) = &self.domain_sid { + format!("{:?}", domain_sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "domain_sid".into(), + "friendly_name".into(), + "sid".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountSipSipIpAccessControlListSipIpAddress { + #[doc = "A 34 character string that uniquely identifies this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The unique id of the Account that is responsible for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "A human readable descriptive text for this resource, up to 255 characters long."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "An IP address in dotted decimal notation from which you want to accept traffic. Any \ + SIP requests from this IP address will be allowed by Twilio. IPv4 only supported \ + today."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip_address: Option, + #[doc = "An integer representing the length of the CIDR prefix to use with this IP address \ + when accepting traffic. By default the entire IP address is used."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cidr_prefix_length: Option, + #[doc = "The unique id of the IpAccessControlList resource that includes this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip_access_control_list_sid: Option, + #[doc = "The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The URI for this resource, relative to `https://api.twilio.com`"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountSipSipIpAccessControlListSipIpAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountSipSipIpAccessControlListSipIpAddress { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(ip_address) = &self.ip_address { + format!("{:?}", ip_address).into() + } else { + String::new().into() + }, + if let Some(cidr_prefix_length) = &self.cidr_prefix_length { + format!("{:?}", cidr_prefix_length).into() + } else { + String::new().into() + }, + if let Some(ip_access_control_list_sid) = &self.ip_access_control_list_sid { + format!("{:?}", ip_access_control_list_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "friendly_name".into(), + "ip_address".into(), + "cidr_prefix_length".into(), + "ip_access_control_list_sid".into(), + "date_created".into(), + "date_updated".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallSiprec { + #[doc = "The SID of the Siprec resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this Siprec resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Siprec resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The user-specified name of this Siprec, if one was given when the Siprec was \ + created. This may be used to stop the Siprec."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallSiprec { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallSiprec { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "call_sid".into(), + "name".into(), + "status".into(), + "date_updated".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum SiprecEnumTrack { + #[serde(rename = "inbound_track")] + #[display("inbound_track")] + InboundTrack, + #[serde(rename = "outbound_track")] + #[display("outbound_track")] + OutboundTrack, + #[serde(rename = "both_tracks")] + #[display("both_tracks")] + BothTracks, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum SiprecEnumStatus { + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "stopped")] + #[display("stopped")] + Stopped, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum SiprecEnumUpdateStatus { + #[serde(rename = "stopped")] + #[display("stopped")] + #[default] + Stopped, +} + + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallStream { + #[doc = "The SID of the Stream resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + this Stream resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Stream resource is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The user-specified name of this Stream, if one was given when the Stream was \ + created. This may be used to stop the Stream."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallStream { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallStream { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "sid".into(), + "account_sid".into(), + "call_sid".into(), + "name".into(), + "status".into(), + "date_updated".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum StreamEnumTrack { + #[serde(rename = "inbound_track")] + #[display("inbound_track")] + InboundTrack, + #[serde(rename = "outbound_track")] + #[display("outbound_track")] + OutboundTrack, + #[serde(rename = "both_tracks")] + #[display("both_tracks")] + BothTracks, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum StreamEnumStatus { + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "stopped")] + #[display("stopped")] + Stopped, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +#[derive(Default)] +pub enum StreamEnumUpdateStatus { + #[serde(rename = "stopped")] + #[display("stopped")] + #[default] + Stopped, +} + + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct IceServers { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credential: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub urls: Option, +} + +impl std::fmt::Display for IceServers { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for IceServers { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(credential) = &self.credential { + format!("{:?}", credential).into() + } else { + String::new().into() + }, + if let Some(username) = &self.username { + format!("{:?}", username).into() + } else { + String::new().into() + }, + if let Some(url) = &self.url { + format!("{:?}", url).into() + } else { + String::new().into() + }, + if let Some(urls) = &self.urls { + format!("{:?}", urls).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "credential".into(), + "username".into(), + "url".into(), + "urls".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountToken { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Token resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "An array representing the ephemeral credentials and the STUN and TURN server URIs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ice_servers: Option>, + #[doc = "The temporary password that the username will use when authenticating with Twilio."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, + #[doc = "The duration in seconds for which the username and password are valid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ttl: Option, + #[doc = "The temporary username that uniquely identifies a Token."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, +} + +impl std::fmt::Display for ApiV2010AccountToken { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountToken { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(ice_servers) = &self.ice_servers { + format!("{:?}", ice_servers).into() + } else { + String::new().into() + }, + if let Some(password) = &self.password { + format!("{:?}", password).into() + } else { + String::new().into() + }, + if let Some(ttl) = &self.ttl { + format!("{:?}", ttl).into() + } else { + String::new().into() + }, + if let Some(username) = &self.username { + format!("{:?}", username).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "date_created".into(), + "date_updated".into(), + "ice_servers".into(), + "password".into(), + "ttl".into(), + "username".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountTranscription { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + the Transcription resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the transcription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The duration of the transcribed audio in seconds."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[doc = "The charge for the transcript in the currency associated with the account. This \ + value is populated after the transcript is complete so it may not be available \ + immediately."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) from \ + which the transcription was created."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recording_sid: Option, + #[doc = "The unique string that that we created to identify the Transcription resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The text content of the transcription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub transcription_text: Option, + #[doc = "The transcription type. Can only be: `fast`."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountTranscription { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountTranscription { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(recording_sid) = &self.recording_sid { + format!("{:?}", recording_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(transcription_text) = &self.transcription_text { + format!("{:?}", transcription_text).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "date_created".into(), + "date_updated".into(), + "duration".into(), + "price".into(), + "price_unit".into(), + "recording_sid".into(), + "sid".into(), + "status".into(), + "transcription_text".into(), + "type_".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum TranscriptionEnumStatus { + #[serde(rename = "in-progress")] + #[display("in-progress")] + InProgress, + #[serde(rename = "completed")] + #[display("completed")] + Completed, + #[serde(rename = "failed")] + #[display("failed")] + Failed, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsage {} + +impl std::fmt::Display for ApiV2010AccountUsage { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsage { + const LENGTH: usize = 0; + fn fields(&self) -> Vec> { + vec![] + } + + fn headers() -> Vec> { + vec![] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecord { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecord { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecord { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordAllTime { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordAllTime { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordAllTime { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordAllTimeEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordDaily { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordDaily { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordDaily { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordDailyEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordLastMonth { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordLastMonth { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordLastMonth { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordLastMonthEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordMonthly { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordMonthly { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordMonthly { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordMonthlyEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordThisMonth { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordThisMonth { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordThisMonth { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordThisMonthEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordToday { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordToday { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordToday { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordTodayEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordYearly { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordYearly { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordYearly { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordYearlyEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageRecordUsageRecordYesterday { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued \ + the usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "Usage records up to date as of this timestamp, formatted as \ + YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub as_of: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The number of usage events, such as the number of calls."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The units in which `count` is measured, such as `calls` for calls or `messages` for \ + SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count_unit: Option, + #[doc = "A plain-language description of the usage category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The last date for which usage is included in the UsageRecord. The date is specified \ + in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The total price of the usage in the currency specified in `price_unit` and \ + associated with the account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price: Option, + #[doc = "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub price_unit: Option, + #[doc = "The first date for which usage is included in this UsageRecord. The date is \ + specified in GMT and formatted as `YYYY-MM-DD`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subresource_uris: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The amount used to bill usage and measured in units described in `usage_unit`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The units in which `usage` is measured, such as `minutes` for calls or `messages` \ + for SMS."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_unit: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageRecordUsageRecordYesterday { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageRecordUsageRecordYesterday { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(as_of) = &self.as_of { + format!("{:?}", as_of).into() + } else { + String::new().into() + }, + if let Some(category) = &self.category { + format!("{:?}", category).into() + } else { + String::new().into() + }, + if let Some(count) = &self.count { + format!("{:?}", count).into() + } else { + String::new().into() + }, + if let Some(count_unit) = &self.count_unit { + format!("{:?}", count_unit).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(price) = &self.price { + format!("{:?}", price).into() + } else { + String::new().into() + }, + if let Some(price_unit) = &self.price_unit { + format!("{:?}", price_unit).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(subresource_uris) = &self.subresource_uris { + format!("{:?}", subresource_uris).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage) = &self.usage { + format!("{:?}", usage).into() + } else { + String::new().into() + }, + if let Some(usage_unit) = &self.usage_unit { + format!("{:?}", usage_unit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "as_of".into(), + "category".into(), + "count".into(), + "count_unit".into(), + "description".into(), + "end_date".into(), + "price".into(), + "price_unit".into(), + "start_date".into(), + "subresource_uris".into(), + "uri".into(), + "usage".into(), + "usage_unit".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageRecordYesterdayEnumCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[doc = "The HTTP method we use to call `callback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountUsageUsageTrigger { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the \ + trigger monitors."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The API version used to create the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[doc = "The HTTP method we use to call `callback_url`. Can be: `GET` or `POST`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub callback_method: Option, + #[doc = "The URL we call using the `callback_method` when the trigger fires."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub callback_url: Option, + #[doc = "The current value of the field the trigger is watching."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current_value: Option, + #[doc = "The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The date and time in GMT that the trigger was last fired specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_fired: Option>, + #[doc = "The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_updated: Option>, + #[doc = "The string that you assigned to describe the trigger."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recurring: Option, + #[doc = "The unique string that that we created to identify the UsageTrigger resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trigger_by: Option, + #[doc = "The value at which the trigger will fire. Must be a positive, numeric value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub trigger_value: Option, + #[doc = "The URI of the resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_category: Option, + #[doc = "The URI of the [UsageRecord](https://www.twilio.com/docs/usage/api/usage-record) resource this trigger watches, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_record_uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountUsageUsageTrigger { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountUsageUsageTrigger { + const LENGTH: usize = 16; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(callback_method) = &self.callback_method { + format!("{:?}", callback_method).into() + } else { + String::new().into() + }, + if let Some(callback_url) = &self.callback_url { + format!("{:?}", callback_url).into() + } else { + String::new().into() + }, + if let Some(current_value) = &self.current_value { + format!("{:?}", current_value).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(date_fired) = &self.date_fired { + format!("{:?}", date_fired).into() + } else { + String::new().into() + }, + if let Some(date_updated) = &self.date_updated { + format!("{:?}", date_updated).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(recurring) = &self.recurring { + format!("{:?}", recurring).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(trigger_by) = &self.trigger_by { + format!("{:?}", trigger_by).into() + } else { + String::new().into() + }, + if let Some(trigger_value) = &self.trigger_value { + format!("{:?}", trigger_value).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + if let Some(usage_category) = &self.usage_category { + format!("{:?}", usage_category).into() + } else { + String::new().into() + }, + if let Some(usage_record_uri) = &self.usage_record_uri { + format!("{:?}", usage_record_uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "callback_method".into(), + "callback_url".into(), + "current_value".into(), + "date_created".into(), + "date_fired".into(), + "date_updated".into(), + "friendly_name".into(), + "recurring".into(), + "sid".into(), + "trigger_by".into(), + "trigger_value".into(), + "uri".into(), + "usage_category".into(), + "usage_record_uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageTriggerEnumUsageCategory { + #[serde(rename = "a2p-registration-fees")] + #[display("a2p-registration-fees")] + A2PRegistrationFees, + #[serde(rename = "agent-conference")] + #[display("agent-conference")] + AgentConference, + #[serde(rename = "amazon-polly")] + #[display("amazon-polly")] + AmazonPolly, + #[serde(rename = "answering-machine-detection")] + #[display("answering-machine-detection")] + AnsweringMachineDetection, + #[serde(rename = "authy-authentications")] + #[display("authy-authentications")] + AuthyAuthentications, + #[serde(rename = "authy-calls-outbound")] + #[display("authy-calls-outbound")] + AuthyCallsOutbound, + #[serde(rename = "authy-monthly-fees")] + #[display("authy-monthly-fees")] + AuthyMonthlyFees, + #[serde(rename = "authy-phone-intelligence")] + #[display("authy-phone-intelligence")] + AuthyPhoneIntelligence, + #[serde(rename = "authy-phone-verifications")] + #[display("authy-phone-verifications")] + AuthyPhoneVerifications, + #[serde(rename = "authy-sms-outbound")] + #[display("authy-sms-outbound")] + AuthySmsOutbound, + #[serde(rename = "call-progess-events")] + #[display("call-progess-events")] + CallProgessEvents, + #[serde(rename = "calleridlookups")] + #[display("calleridlookups")] + Calleridlookups, + #[serde(rename = "calls")] + #[display("calls")] + Calls, + #[serde(rename = "calls-client")] + #[display("calls-client")] + CallsClient, + #[serde(rename = "calls-globalconference")] + #[display("calls-globalconference")] + CallsGlobalconference, + #[serde(rename = "calls-inbound")] + #[display("calls-inbound")] + CallsInbound, + #[serde(rename = "calls-inbound-local")] + #[display("calls-inbound-local")] + CallsInboundLocal, + #[serde(rename = "calls-inbound-mobile")] + #[display("calls-inbound-mobile")] + CallsInboundMobile, + #[serde(rename = "calls-inbound-tollfree")] + #[display("calls-inbound-tollfree")] + CallsInboundTollfree, + #[serde(rename = "calls-outbound")] + #[display("calls-outbound")] + CallsOutbound, + #[serde(rename = "calls-pay-verb-transactions")] + #[display("calls-pay-verb-transactions")] + CallsPayVerbTransactions, + #[serde(rename = "calls-recordings")] + #[display("calls-recordings")] + CallsRecordings, + #[serde(rename = "calls-sip")] + #[display("calls-sip")] + CallsSip, + #[serde(rename = "calls-sip-inbound")] + #[display("calls-sip-inbound")] + CallsSipInbound, + #[serde(rename = "calls-sip-outbound")] + #[display("calls-sip-outbound")] + CallsSipOutbound, + #[serde(rename = "calls-transfers")] + #[display("calls-transfers")] + CallsTransfers, + #[serde(rename = "carrier-lookups")] + #[display("carrier-lookups")] + CarrierLookups, + #[serde(rename = "conversations")] + #[display("conversations")] + Conversations, + #[serde(rename = "conversations-api-requests")] + #[display("conversations-api-requests")] + ConversationsApiRequests, + #[serde(rename = "conversations-conversation-events")] + #[display("conversations-conversation-events")] + ConversationsConversationEvents, + #[serde(rename = "conversations-endpoint-connectivity")] + #[display("conversations-endpoint-connectivity")] + ConversationsEndpointConnectivity, + #[serde(rename = "conversations-events")] + #[display("conversations-events")] + ConversationsEvents, + #[serde(rename = "conversations-participant-events")] + #[display("conversations-participant-events")] + ConversationsParticipantEvents, + #[serde(rename = "conversations-participants")] + #[display("conversations-participants")] + ConversationsParticipants, + #[serde(rename = "cps")] + #[display("cps")] + Cps, + #[serde(rename = "flex-usage")] + #[display("flex-usage")] + FlexUsage, + #[serde(rename = "fraud-lookups")] + #[display("fraud-lookups")] + FraudLookups, + #[serde(rename = "group-rooms")] + #[display("group-rooms")] + GroupRooms, + #[serde(rename = "group-rooms-data-track")] + #[display("group-rooms-data-track")] + GroupRoomsDataTrack, + #[serde(rename = "group-rooms-encrypted-media-recorded")] + #[display("group-rooms-encrypted-media-recorded")] + GroupRoomsEncryptedMediaRecorded, + #[serde(rename = "group-rooms-media-downloaded")] + #[display("group-rooms-media-downloaded")] + GroupRoomsMediaDownloaded, + #[serde(rename = "group-rooms-media-recorded")] + #[display("group-rooms-media-recorded")] + GroupRoomsMediaRecorded, + #[serde(rename = "group-rooms-media-routed")] + #[display("group-rooms-media-routed")] + GroupRoomsMediaRouted, + #[serde(rename = "group-rooms-media-stored")] + #[display("group-rooms-media-stored")] + GroupRoomsMediaStored, + #[serde(rename = "group-rooms-participant-minutes")] + #[display("group-rooms-participant-minutes")] + GroupRoomsParticipantMinutes, + #[serde(rename = "group-rooms-recorded-minutes")] + #[display("group-rooms-recorded-minutes")] + GroupRoomsRecordedMinutes, + #[serde(rename = "imp-v1-usage")] + #[display("imp-v1-usage")] + ImpUsage, + #[serde(rename = "lookups")] + #[display("lookups")] + Lookups, + #[serde(rename = "marketplace")] + #[display("marketplace")] + Marketplace, + #[serde(rename = "marketplace-algorithmia-named-entity-recognition")] + #[display("marketplace-algorithmia-named-entity-recognition")] + MarketplaceAlgorithmiaNamedEntityRecognition, + #[serde(rename = "marketplace-cadence-transcription")] + #[display("marketplace-cadence-transcription")] + MarketplaceCadenceTranscription, + #[serde(rename = "marketplace-cadence-translation")] + #[display("marketplace-cadence-translation")] + MarketplaceCadenceTranslation, + #[serde(rename = "marketplace-capio-speech-to-text")] + #[display("marketplace-capio-speech-to-text")] + MarketplaceCapioSpeechToText, + #[serde(rename = "marketplace-convriza-ababa")] + #[display("marketplace-convriza-ababa")] + MarketplaceConvrizaAbaba, + #[serde(rename = "marketplace-deepgram-phrase-detector")] + #[display("marketplace-deepgram-phrase-detector")] + MarketplaceDeepgramPhraseDetector, + #[serde(rename = "marketplace-digital-segment-business-info")] + #[display("marketplace-digital-segment-business-info")] + MarketplaceDigitalSegmentBusinessInfo, + #[serde(rename = "marketplace-facebook-offline-conversions")] + #[display("marketplace-facebook-offline-conversions")] + MarketplaceFacebookOfflineConversions, + #[serde(rename = "marketplace-google-speech-to-text")] + #[display("marketplace-google-speech-to-text")] + MarketplaceGoogleSpeechToText, + #[serde(rename = "marketplace-ibm-watson-message-insights")] + #[display("marketplace-ibm-watson-message-insights")] + MarketplaceIbmWatsonMessageInsights, + #[serde(rename = "marketplace-ibm-watson-message-sentiment")] + #[display("marketplace-ibm-watson-message-sentiment")] + MarketplaceIbmWatsonMessageSentiment, + #[serde(rename = "marketplace-ibm-watson-recording-analysis")] + #[display("marketplace-ibm-watson-recording-analysis")] + MarketplaceIbmWatsonRecordingAnalysis, + #[serde(rename = "marketplace-ibm-watson-tone-analyzer")] + #[display("marketplace-ibm-watson-tone-analyzer")] + MarketplaceIbmWatsonToneAnalyzer, + #[serde(rename = "marketplace-icehook-systems-scout")] + #[display("marketplace-icehook-systems-scout")] + MarketplaceIcehookSystemsScout, + #[serde(rename = "marketplace-infogroup-dataaxle-bizinfo")] + #[display("marketplace-infogroup-dataaxle-bizinfo")] + MarketplaceInfogroupDataaxleBizinfo, + #[serde(rename = "marketplace-keen-io-contact-center-analytics")] + #[display("marketplace-keen-io-contact-center-analytics")] + MarketplaceKeenIoContactCenterAnalytics, + #[serde(rename = "marketplace-marchex-cleancall")] + #[display("marketplace-marchex-cleancall")] + MarketplaceMarchexCleancall, + #[serde(rename = "marketplace-marchex-sentiment-analysis-for-sms")] + #[display("marketplace-marchex-sentiment-analysis-for-sms")] + MarketplaceMarchexSentimentAnalysisForSms, + #[serde(rename = "marketplace-marketplace-nextcaller-social-id")] + #[display("marketplace-marketplace-nextcaller-social-id")] + MarketplaceMarketplaceNextcallerSocialId, + #[serde(rename = "marketplace-mobile-commons-opt-out-classifier")] + #[display("marketplace-mobile-commons-opt-out-classifier")] + MarketplaceMobileCommonsOptOutClassifier, + #[serde(rename = "marketplace-nexiwave-voicemail-to-text")] + #[display("marketplace-nexiwave-voicemail-to-text")] + MarketplaceNexiwaveVoicemailToText, + #[serde(rename = "marketplace-nextcaller-advanced-caller-identification")] + #[display("marketplace-nextcaller-advanced-caller-identification")] + MarketplaceNextcallerAdvancedCallerIdentification, + #[serde(rename = "marketplace-nomorobo-spam-score")] + #[display("marketplace-nomorobo-spam-score")] + MarketplaceNomoroboSpamScore, + #[serde(rename = "marketplace-payfone-tcpa-compliance")] + #[display("marketplace-payfone-tcpa-compliance")] + MarketplacePayfoneTcpaCompliance, + #[serde(rename = "marketplace-remeeting-automatic-speech-recognition")] + #[display("marketplace-remeeting-automatic-speech-recognition")] + MarketplaceRemeetingAutomaticSpeechRecognition, + #[serde(rename = "marketplace-tcpa-defense-solutions-blacklist-feed")] + #[display("marketplace-tcpa-defense-solutions-blacklist-feed")] + MarketplaceTcpaDefenseSolutionsBlacklistFeed, + #[serde(rename = "marketplace-telo-opencnam")] + #[display("marketplace-telo-opencnam")] + MarketplaceTeloOpencnam, + #[serde(rename = "marketplace-truecnam-true-spam")] + #[display("marketplace-truecnam-true-spam")] + MarketplaceTruecnamTrueSpam, + #[serde(rename = "marketplace-twilio-caller-name-lookup-us")] + #[display("marketplace-twilio-caller-name-lookup-us")] + MarketplaceTwilioCallerNameLookupUs, + #[serde(rename = "marketplace-twilio-carrier-information-lookup")] + #[display("marketplace-twilio-carrier-information-lookup")] + MarketplaceTwilioCarrierInformationLookup, + #[serde(rename = "marketplace-voicebase-pci")] + #[display("marketplace-voicebase-pci")] + MarketplaceVoicebasePci, + #[serde(rename = "marketplace-voicebase-transcription")] + #[display("marketplace-voicebase-transcription")] + MarketplaceVoicebaseTranscription, + #[serde(rename = "marketplace-voicebase-transcription-custom-vocabulary")] + #[display("marketplace-voicebase-transcription-custom-vocabulary")] + MarketplaceVoicebaseTranscriptionCustomVocabulary, + #[serde(rename = "marketplace-whitepages-pro-caller-identification")] + #[display("marketplace-whitepages-pro-caller-identification")] + MarketplaceWhitepagesProCallerIdentification, + #[serde(rename = "marketplace-whitepages-pro-phone-intelligence")] + #[display("marketplace-whitepages-pro-phone-intelligence")] + MarketplaceWhitepagesProPhoneIntelligence, + #[serde(rename = "marketplace-whitepages-pro-phone-reputation")] + #[display("marketplace-whitepages-pro-phone-reputation")] + MarketplaceWhitepagesProPhoneReputation, + #[serde(rename = "marketplace-wolfarm-spoken-results")] + #[display("marketplace-wolfarm-spoken-results")] + MarketplaceWolfarmSpokenResults, + #[serde(rename = "marketplace-wolfram-short-answer")] + #[display("marketplace-wolfram-short-answer")] + MarketplaceWolframShortAnswer, + #[serde(rename = "marketplace-ytica-contact-center-reporting-analytics")] + #[display("marketplace-ytica-contact-center-reporting-analytics")] + MarketplaceYticaContactCenterReportingAnalytics, + #[serde(rename = "mediastorage")] + #[display("mediastorage")] + Mediastorage, + #[serde(rename = "mms")] + #[display("mms")] + Mms, + #[serde(rename = "mms-inbound")] + #[display("mms-inbound")] + MmsInbound, + #[serde(rename = "mms-inbound-longcode")] + #[display("mms-inbound-longcode")] + MmsInboundLongcode, + #[serde(rename = "mms-inbound-shortcode")] + #[display("mms-inbound-shortcode")] + MmsInboundShortcode, + #[serde(rename = "mms-messages-carrierfees")] + #[display("mms-messages-carrierfees")] + MmsMessagesCarrierfees, + #[serde(rename = "mms-outbound")] + #[display("mms-outbound")] + MmsOutbound, + #[serde(rename = "mms-outbound-longcode")] + #[display("mms-outbound-longcode")] + MmsOutboundLongcode, + #[serde(rename = "mms-outbound-shortcode")] + #[display("mms-outbound-shortcode")] + MmsOutboundShortcode, + #[serde(rename = "monitor-reads")] + #[display("monitor-reads")] + MonitorReads, + #[serde(rename = "monitor-storage")] + #[display("monitor-storage")] + MonitorStorage, + #[serde(rename = "monitor-writes")] + #[display("monitor-writes")] + MonitorWrites, + #[serde(rename = "notify")] + #[display("notify")] + Notify, + #[serde(rename = "notify-actions-attempts")] + #[display("notify-actions-attempts")] + NotifyActionsAttempts, + #[serde(rename = "notify-channels")] + #[display("notify-channels")] + NotifyChannels, + #[serde(rename = "number-format-lookups")] + #[display("number-format-lookups")] + NumberFormatLookups, + #[serde(rename = "pchat")] + #[display("pchat")] + Pchat, + #[serde(rename = "pchat-users")] + #[display("pchat-users")] + PchatUsers, + #[serde(rename = "peer-to-peer-rooms-participant-minutes")] + #[display("peer-to-peer-rooms-participant-minutes")] + PeerToPeerRoomsParticipantMinutes, + #[serde(rename = "pfax")] + #[display("pfax")] + Pfax, + #[serde(rename = "pfax-minutes")] + #[display("pfax-minutes")] + PfaxMinutes, + #[serde(rename = "pfax-minutes-inbound")] + #[display("pfax-minutes-inbound")] + PfaxMinutesInbound, + #[serde(rename = "pfax-minutes-outbound")] + #[display("pfax-minutes-outbound")] + PfaxMinutesOutbound, + #[serde(rename = "pfax-pages")] + #[display("pfax-pages")] + PfaxPages, + #[serde(rename = "phonenumbers")] + #[display("phonenumbers")] + Phonenumbers, + #[serde(rename = "phonenumbers-cps")] + #[display("phonenumbers-cps")] + PhonenumbersCps, + #[serde(rename = "phonenumbers-emergency")] + #[display("phonenumbers-emergency")] + PhonenumbersEmergency, + #[serde(rename = "phonenumbers-local")] + #[display("phonenumbers-local")] + PhonenumbersLocal, + #[serde(rename = "phonenumbers-mobile")] + #[display("phonenumbers-mobile")] + PhonenumbersMobile, + #[serde(rename = "phonenumbers-setups")] + #[display("phonenumbers-setups")] + PhonenumbersSetups, + #[serde(rename = "phonenumbers-tollfree")] + #[display("phonenumbers-tollfree")] + PhonenumbersTollfree, + #[serde(rename = "premiumsupport")] + #[display("premiumsupport")] + Premiumsupport, + #[serde(rename = "proxy")] + #[display("proxy")] + Proxy, + #[serde(rename = "proxy-active-sessions")] + #[display("proxy-active-sessions")] + ProxyActiveSessions, + #[serde(rename = "pstnconnectivity")] + #[display("pstnconnectivity")] + Pstnconnectivity, + #[serde(rename = "pv")] + #[display("pv")] + Pv, + #[serde(rename = "pv-composition-media-downloaded")] + #[display("pv-composition-media-downloaded")] + PvCompositionMediaDownloaded, + #[serde(rename = "pv-composition-media-encrypted")] + #[display("pv-composition-media-encrypted")] + PvCompositionMediaEncrypted, + #[serde(rename = "pv-composition-media-stored")] + #[display("pv-composition-media-stored")] + PvCompositionMediaStored, + #[serde(rename = "pv-composition-minutes")] + #[display("pv-composition-minutes")] + PvCompositionMinutes, + #[serde(rename = "pv-recording-compositions")] + #[display("pv-recording-compositions")] + PvRecordingCompositions, + #[serde(rename = "pv-room-participants")] + #[display("pv-room-participants")] + PvRoomParticipants, + #[serde(rename = "pv-room-participants-au1")] + #[display("pv-room-participants-au1")] + PvRoomParticipantsAu1, + #[serde(rename = "pv-room-participants-br1")] + #[display("pv-room-participants-br1")] + PvRoomParticipantsBr1, + #[serde(rename = "pv-room-participants-ie1")] + #[display("pv-room-participants-ie1")] + PvRoomParticipantsIe1, + #[serde(rename = "pv-room-participants-jp1")] + #[display("pv-room-participants-jp1")] + PvRoomParticipantsJp1, + #[serde(rename = "pv-room-participants-sg1")] + #[display("pv-room-participants-sg1")] + PvRoomParticipantsSg1, + #[serde(rename = "pv-room-participants-us1")] + #[display("pv-room-participants-us1")] + PvRoomParticipantsUs1, + #[serde(rename = "pv-room-participants-us2")] + #[display("pv-room-participants-us2")] + PvRoomParticipantsUs2, + #[serde(rename = "pv-rooms")] + #[display("pv-rooms")] + PvRooms, + #[serde(rename = "pv-sip-endpoint-registrations")] + #[display("pv-sip-endpoint-registrations")] + PvSipEndpointRegistrations, + #[serde(rename = "recordings")] + #[display("recordings")] + Recordings, + #[serde(rename = "recordingstorage")] + #[display("recordingstorage")] + Recordingstorage, + #[serde(rename = "rooms-group-bandwidth")] + #[display("rooms-group-bandwidth")] + RoomsGroupBandwidth, + #[serde(rename = "rooms-group-minutes")] + #[display("rooms-group-minutes")] + RoomsGroupMinutes, + #[serde(rename = "rooms-peer-to-peer-minutes")] + #[display("rooms-peer-to-peer-minutes")] + RoomsPeerToPeerMinutes, + #[serde(rename = "shortcodes")] + #[display("shortcodes")] + Shortcodes, + #[serde(rename = "shortcodes-customerowned")] + #[display("shortcodes-customerowned")] + ShortcodesCustomerowned, + #[serde(rename = "shortcodes-mms-enablement")] + #[display("shortcodes-mms-enablement")] + ShortcodesMmsEnablement, + #[serde(rename = "shortcodes-mps")] + #[display("shortcodes-mps")] + ShortcodesMps, + #[serde(rename = "shortcodes-random")] + #[display("shortcodes-random")] + ShortcodesRandom, + #[serde(rename = "shortcodes-uk")] + #[display("shortcodes-uk")] + ShortcodesUk, + #[serde(rename = "shortcodes-vanity")] + #[display("shortcodes-vanity")] + ShortcodesVanity, + #[serde(rename = "small-group-rooms")] + #[display("small-group-rooms")] + SmallGroupRooms, + #[serde(rename = "small-group-rooms-data-track")] + #[display("small-group-rooms-data-track")] + SmallGroupRoomsDataTrack, + #[serde(rename = "small-group-rooms-participant-minutes")] + #[display("small-group-rooms-participant-minutes")] + SmallGroupRoomsParticipantMinutes, + #[serde(rename = "sms")] + #[display("sms")] + Sms, + #[serde(rename = "sms-inbound")] + #[display("sms-inbound")] + SmsInbound, + #[serde(rename = "sms-inbound-longcode")] + #[display("sms-inbound-longcode")] + SmsInboundLongcode, + #[serde(rename = "sms-inbound-shortcode")] + #[display("sms-inbound-shortcode")] + SmsInboundShortcode, + #[serde(rename = "sms-messages-carrierfees")] + #[display("sms-messages-carrierfees")] + SmsMessagesCarrierfees, + #[serde(rename = "sms-messages-features")] + #[display("sms-messages-features")] + SmsMessagesFeatures, + #[serde(rename = "sms-messages-features-senderid")] + #[display("sms-messages-features-senderid")] + SmsMessagesFeaturesSenderid, + #[serde(rename = "sms-outbound")] + #[display("sms-outbound")] + SmsOutbound, + #[serde(rename = "sms-outbound-content-inspection")] + #[display("sms-outbound-content-inspection")] + SmsOutboundContentInspection, + #[serde(rename = "sms-outbound-longcode")] + #[display("sms-outbound-longcode")] + SmsOutboundLongcode, + #[serde(rename = "sms-outbound-shortcode")] + #[display("sms-outbound-shortcode")] + SmsOutboundShortcode, + #[serde(rename = "speech-recognition")] + #[display("speech-recognition")] + SpeechRecognition, + #[serde(rename = "studio-engagements")] + #[display("studio-engagements")] + StudioEngagements, + #[serde(rename = "sync")] + #[display("sync")] + Sync, + #[serde(rename = "sync-actions")] + #[display("sync-actions")] + SyncActions, + #[serde(rename = "sync-endpoint-hours")] + #[display("sync-endpoint-hours")] + SyncEndpointHours, + #[serde(rename = "sync-endpoint-hours-above-daily-cap")] + #[display("sync-endpoint-hours-above-daily-cap")] + SyncEndpointHoursAboveDailyCap, + #[serde(rename = "taskrouter-tasks")] + #[display("taskrouter-tasks")] + TaskrouterTasks, + #[serde(rename = "totalprice")] + #[display("totalprice")] + Totalprice, + #[serde(rename = "transcriptions")] + #[display("transcriptions")] + Transcriptions, + #[serde(rename = "trunking-cps")] + #[display("trunking-cps")] + TrunkingCps, + #[serde(rename = "trunking-emergency-calls")] + #[display("trunking-emergency-calls")] + TrunkingEmergencyCalls, + #[serde(rename = "trunking-origination")] + #[display("trunking-origination")] + TrunkingOrigination, + #[serde(rename = "trunking-origination-local")] + #[display("trunking-origination-local")] + TrunkingOriginationLocal, + #[serde(rename = "trunking-origination-mobile")] + #[display("trunking-origination-mobile")] + TrunkingOriginationMobile, + #[serde(rename = "trunking-origination-tollfree")] + #[display("trunking-origination-tollfree")] + TrunkingOriginationTollfree, + #[serde(rename = "trunking-recordings")] + #[display("trunking-recordings")] + TrunkingRecordings, + #[serde(rename = "trunking-secure")] + #[display("trunking-secure")] + TrunkingSecure, + #[serde(rename = "trunking-termination")] + #[display("trunking-termination")] + TrunkingTermination, + #[serde(rename = "turnmegabytes")] + #[display("turnmegabytes")] + Turnmegabytes, + #[serde(rename = "turnmegabytes-australia")] + #[display("turnmegabytes-australia")] + TurnmegabytesAustralia, + #[serde(rename = "turnmegabytes-brasil")] + #[display("turnmegabytes-brasil")] + TurnmegabytesBrasil, + #[serde(rename = "turnmegabytes-germany")] + #[display("turnmegabytes-germany")] + TurnmegabytesGermany, + #[serde(rename = "turnmegabytes-india")] + #[display("turnmegabytes-india")] + TurnmegabytesIndia, + #[serde(rename = "turnmegabytes-ireland")] + #[display("turnmegabytes-ireland")] + TurnmegabytesIreland, + #[serde(rename = "turnmegabytes-japan")] + #[display("turnmegabytes-japan")] + TurnmegabytesJapan, + #[serde(rename = "turnmegabytes-singapore")] + #[display("turnmegabytes-singapore")] + TurnmegabytesSingapore, + #[serde(rename = "turnmegabytes-useast")] + #[display("turnmegabytes-useast")] + TurnmegabytesUseast, + #[serde(rename = "turnmegabytes-uswest")] + #[display("turnmegabytes-uswest")] + TurnmegabytesUswest, + #[serde(rename = "twilio-interconnect")] + #[display("twilio-interconnect")] + TwilioInterconnect, + #[serde(rename = "verify-push")] + #[display("verify-push")] + VerifyPush, + #[serde(rename = "verify-totp")] + #[display("verify-totp")] + VerifyTotp, + #[serde(rename = "verify-whatsapp-conversations-business-initiated")] + #[display("verify-whatsapp-conversations-business-initiated")] + VerifyWhatsappConversationsBusinessInitiated, + #[serde(rename = "video-recordings")] + #[display("video-recordings")] + VideoRecordings, + #[serde(rename = "virtual-agent")] + #[display("virtual-agent")] + VirtualAgent, + #[serde(rename = "voice-insights")] + #[display("voice-insights")] + VoiceInsights, + #[serde(rename = "voice-insights-client-insights-on-demand-minute")] + #[display("voice-insights-client-insights-on-demand-minute")] + VoiceInsightsClientInsightsOnDemandMinute, + #[serde(rename = "voice-insights-ptsn-insights-on-demand-minute")] + #[display("voice-insights-ptsn-insights-on-demand-minute")] + VoiceInsightsPtsnInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-interface-insights-on-demand-minute")] + #[display("voice-insights-sip-interface-insights-on-demand-minute")] + VoiceInsightsSipInterfaceInsightsOnDemandMinute, + #[serde(rename = "voice-insights-sip-trunking-insights-on-demand-minute")] + #[display("voice-insights-sip-trunking-insights-on-demand-minute")] + VoiceInsightsSipTrunkingInsightsOnDemandMinute, + #[serde(rename = "wireless")] + #[display("wireless")] + Wireless, + #[serde(rename = "wireless-orders")] + #[display("wireless-orders")] + WirelessOrders, + #[serde(rename = "wireless-orders-artwork")] + #[display("wireless-orders-artwork")] + WirelessOrdersArtwork, + #[serde(rename = "wireless-orders-bulk")] + #[display("wireless-orders-bulk")] + WirelessOrdersBulk, + #[serde(rename = "wireless-orders-esim")] + #[display("wireless-orders-esim")] + WirelessOrdersEsim, + #[serde(rename = "wireless-orders-starter")] + #[display("wireless-orders-starter")] + WirelessOrdersStarter, + #[serde(rename = "wireless-usage")] + #[display("wireless-usage")] + WirelessUsage, + #[serde(rename = "wireless-usage-commands")] + #[display("wireless-usage-commands")] + WirelessUsageCommands, + #[serde(rename = "wireless-usage-commands-africa")] + #[display("wireless-usage-commands-africa")] + WirelessUsageCommandsAfrica, + #[serde(rename = "wireless-usage-commands-asia")] + #[display("wireless-usage-commands-asia")] + WirelessUsageCommandsAsia, + #[serde(rename = "wireless-usage-commands-centralandsouthamerica")] + #[display("wireless-usage-commands-centralandsouthamerica")] + WirelessUsageCommandsCentralandsouthamerica, + #[serde(rename = "wireless-usage-commands-europe")] + #[display("wireless-usage-commands-europe")] + WirelessUsageCommandsEurope, + #[serde(rename = "wireless-usage-commands-home")] + #[display("wireless-usage-commands-home")] + WirelessUsageCommandsHome, + #[serde(rename = "wireless-usage-commands-northamerica")] + #[display("wireless-usage-commands-northamerica")] + WirelessUsageCommandsNorthamerica, + #[serde(rename = "wireless-usage-commands-oceania")] + #[display("wireless-usage-commands-oceania")] + WirelessUsageCommandsOceania, + #[serde(rename = "wireless-usage-commands-roaming")] + #[display("wireless-usage-commands-roaming")] + WirelessUsageCommandsRoaming, + #[serde(rename = "wireless-usage-data")] + #[display("wireless-usage-data")] + WirelessUsageData, + #[serde(rename = "wireless-usage-data-africa")] + #[display("wireless-usage-data-africa")] + WirelessUsageDataAfrica, + #[serde(rename = "wireless-usage-data-asia")] + #[display("wireless-usage-data-asia")] + WirelessUsageDataAsia, + #[serde(rename = "wireless-usage-data-centralandsouthamerica")] + #[display("wireless-usage-data-centralandsouthamerica")] + WirelessUsageDataCentralandsouthamerica, + #[serde(rename = "wireless-usage-data-custom-additionalmb")] + #[display("wireless-usage-data-custom-additionalmb")] + WirelessUsageDataCustomAdditionalmb, + #[serde(rename = "wireless-usage-data-custom-first5mb")] + #[display("wireless-usage-data-custom-first5mb")] + WirelessUsageDataCustomFirst5Mb, + #[serde(rename = "wireless-usage-data-domestic-roaming")] + #[display("wireless-usage-data-domestic-roaming")] + WirelessUsageDataDomesticRoaming, + #[serde(rename = "wireless-usage-data-europe")] + #[display("wireless-usage-data-europe")] + WirelessUsageDataEurope, + #[serde(rename = "wireless-usage-data-individual-additionalgb")] + #[display("wireless-usage-data-individual-additionalgb")] + WirelessUsageDataIndividualAdditionalgb, + #[serde(rename = "wireless-usage-data-individual-firstgb")] + #[display("wireless-usage-data-individual-firstgb")] + WirelessUsageDataIndividualFirstgb, + #[serde(rename = "wireless-usage-data-international-roaming-canada")] + #[display("wireless-usage-data-international-roaming-canada")] + WirelessUsageDataInternationalRoamingCanada, + #[serde(rename = "wireless-usage-data-international-roaming-india")] + #[display("wireless-usage-data-international-roaming-india")] + WirelessUsageDataInternationalRoamingIndia, + #[serde(rename = "wireless-usage-data-international-roaming-mexico")] + #[display("wireless-usage-data-international-roaming-mexico")] + WirelessUsageDataInternationalRoamingMexico, + #[serde(rename = "wireless-usage-data-northamerica")] + #[display("wireless-usage-data-northamerica")] + WirelessUsageDataNorthamerica, + #[serde(rename = "wireless-usage-data-oceania")] + #[display("wireless-usage-data-oceania")] + WirelessUsageDataOceania, + #[serde(rename = "wireless-usage-data-pooled")] + #[display("wireless-usage-data-pooled")] + WirelessUsageDataPooled, + #[serde(rename = "wireless-usage-data-pooled-downlink")] + #[display("wireless-usage-data-pooled-downlink")] + WirelessUsageDataPooledDownlink, + #[serde(rename = "wireless-usage-data-pooled-uplink")] + #[display("wireless-usage-data-pooled-uplink")] + WirelessUsageDataPooledUplink, + #[serde(rename = "wireless-usage-mrc")] + #[display("wireless-usage-mrc")] + WirelessUsageMrc, + #[serde(rename = "wireless-usage-mrc-custom")] + #[display("wireless-usage-mrc-custom")] + WirelessUsageMrcCustom, + #[serde(rename = "wireless-usage-mrc-individual")] + #[display("wireless-usage-mrc-individual")] + WirelessUsageMrcIndividual, + #[serde(rename = "wireless-usage-mrc-pooled")] + #[display("wireless-usage-mrc-pooled")] + WirelessUsageMrcPooled, + #[serde(rename = "wireless-usage-mrc-suspended")] + #[display("wireless-usage-mrc-suspended")] + WirelessUsageMrcSuspended, + #[serde(rename = "wireless-usage-sms")] + #[display("wireless-usage-sms")] + WirelessUsageSms, + #[serde(rename = "wireless-usage-voice")] + #[display("wireless-usage-voice")] + WirelessUsageVoice, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageTriggerEnumRecurring { + #[serde(rename = "daily")] + #[display("daily")] + Daily, + #[serde(rename = "monthly")] + #[display("monthly")] + Monthly, + #[serde(rename = "yearly")] + #[display("yearly")] + Yearly, + #[serde(rename = "alltime")] + #[display("alltime")] + Alltime, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UsageTriggerEnumTriggerField { + #[serde(rename = "count")] + #[display("count")] + Count, + #[serde(rename = "usage")] + #[display("usage")] + Usage, + #[serde(rename = "price")] + #[display("price")] + Price, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallUserDefinedMessage { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created \ + User Defined Message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User \ + Defined Message is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The SID that uniquely identifies this User Defined Message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The date that this User Defined Message was created, given in RFC 2822 format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, +} + +impl std::fmt::Display for ApiV2010AccountCallUserDefinedMessage { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallUserDefinedMessage { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "call_sid".into(), + "sid".into(), + "date_created".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountCallUserDefinedMessageSubscription { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that \ + subscribed to the User Defined Messages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User \ + Defined Message Subscription is associated with. This refers to the Call SID that is \ + producing the User Defined Messages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The SID that uniquely identifies this User Defined Message Subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sid: Option, + #[doc = "The date that this User Defined Message Subscription was created, given in RFC 2822 \ + format."] + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub date_created: Option>, + #[doc = "The URI of the User Defined Message Subscription Resource, relative to `https://api.twilio.com`."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ApiV2010AccountCallUserDefinedMessageSubscription { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountCallUserDefinedMessageSubscription { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(sid) = &self.sid { + format!("{:?}", sid).into() + } else { + String::new().into() + }, + if let Some(date_created) = &self.date_created { + format!("{:?}", date_created).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "call_sid".into(), + "sid".into(), + "date_created".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApiV2010AccountValidationRequest { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible \ + for the Caller ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[doc = "The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the \ + Caller ID is associated with."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub call_sid: Option, + #[doc = "The string that you assigned to describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The phone number to verify in \ + [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a \ + + followed by the country code and subscriber number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The 6 digit validation code that someone must enter to validate the Caller ID when \ + `phone_number` is called."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub validation_code: Option, +} + +impl std::fmt::Display for ApiV2010AccountValidationRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApiV2010AccountValidationRequest { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(call_sid) = &self.call_sid { + format!("{:?}", call_sid).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + format!("{:?}", self.phone_number).into(), + if let Some(validation_code) = &self.validation_code { + format!("{:?}", validation_code).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "call_sid".into(), + "friendly_name".into(), + "phone_number".into(), + "validation_code".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAccountResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub accounts: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAccountResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAccountResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(accounts) = &self.accounts { + format!("{:?}", accounts).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "accounts".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateAccountRequest { + #[doc = "A human readable description of the account to create, defaults to `SubAccount \ + Created at {YYYY-MM-DD HH:MM meridian}`"] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, +} + +impl std::fmt::Display for CreateAccountRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateAccountRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateAccountRequest { + #[doc = "Update the human-readable description of this Account"] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[serde(rename = "Status", default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for UpdateAccountRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateAccountRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["friendly_name".into(), "status".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAddressResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub addresses: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAddressResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAddressResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(addresses) = &self.addresses { + format!("{:?}", addresses).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "addresses".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateAddressRequest { + #[doc = "The name to associate with the new address."] + #[serde(rename = "CustomerName")] + pub customer_name: String, + #[doc = "The number and street address of the new address."] + #[serde(rename = "Street")] + pub street: String, + #[doc = "The city of the new address."] + #[serde(rename = "City")] + pub city: String, + #[doc = "The state or region of the new address."] + #[serde(rename = "Region")] + pub region: String, + #[doc = "The postal code of the new address."] + #[serde(rename = "PostalCode")] + pub postal_code: String, + #[doc = "The ISO country code of the new address."] + #[serde(rename = "IsoCountry")] + pub iso_country: String, + #[doc = "A descriptive string that you create to describe the new address. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "Whether to enable emergency calling on the new address. Can be: `true` or `false`."] + #[serde( + rename = "EmergencyEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_enabled: Option, + #[doc = "Whether we should automatically correct the address. Can be: `true` or `false` and \ + the default is `true`. If empty or `true`, we will correct the address you provide \ + if necessary. If `false`, we won't alter the address you provide."] + #[serde( + rename = "AutoCorrectAddress", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_correct_address: Option, + #[doc = "The additional number and street address of the address."] + #[serde( + rename = "StreetSecondary", + default, + skip_serializing_if = "Option::is_none" + )] + pub street_secondary: Option, +} + +impl std::fmt::Display for CreateAddressRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateAddressRequest { + const LENGTH: usize = 10; + fn fields(&self) -> Vec> { + vec![ + self.customer_name.clone().into(), + self.street.clone().into(), + self.city.clone().into(), + self.region.clone().into(), + self.postal_code.clone().into(), + self.iso_country.clone().into(), + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(emergency_enabled) = &self.emergency_enabled { + format!("{:?}", emergency_enabled).into() + } else { + String::new().into() + }, + if let Some(auto_correct_address) = &self.auto_correct_address { + format!("{:?}", auto_correct_address).into() + } else { + String::new().into() + }, + if let Some(street_secondary) = &self.street_secondary { + format!("{:?}", street_secondary).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "customer_name".into(), + "street".into(), + "city".into(), + "region".into(), + "postal_code".into(), + "iso_country".into(), + "friendly_name".into(), + "emergency_enabled".into(), + "auto_correct_address".into(), + "street_secondary".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateAddressRequest { + #[doc = "A descriptive string that you create to describe the address. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The name to associate with the address."] + #[serde( + rename = "CustomerName", + default, + skip_serializing_if = "Option::is_none" + )] + pub customer_name: Option, + #[doc = "The number and street address of the address."] + #[serde(rename = "Street", default, skip_serializing_if = "Option::is_none")] + pub street: Option, + #[doc = "The city of the address."] + #[serde(rename = "City", default, skip_serializing_if = "Option::is_none")] + pub city: Option, + #[doc = "The state or region of the address."] + #[serde(rename = "Region", default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The postal code of the address."] + #[serde( + rename = "PostalCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub postal_code: Option, + #[doc = "Whether to enable emergency calling on the address. Can be: `true` or `false`."] + #[serde( + rename = "EmergencyEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_enabled: Option, + #[doc = "Whether we should automatically correct the address. Can be: `true` or `false` and \ + the default is `true`. If empty or `true`, we will correct the address you provide \ + if necessary. If `false`, we won't alter the address you provide."] + #[serde( + rename = "AutoCorrectAddress", + default, + skip_serializing_if = "Option::is_none" + )] + pub auto_correct_address: Option, + #[doc = "The additional number and street address of the address."] + #[serde( + rename = "StreetSecondary", + default, + skip_serializing_if = "Option::is_none" + )] + pub street_secondary: Option, +} + +impl std::fmt::Display for UpdateAddressRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateAddressRequest { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(customer_name) = &self.customer_name { + format!("{:?}", customer_name).into() + } else { + String::new().into() + }, + if let Some(street) = &self.street { + format!("{:?}", street).into() + } else { + String::new().into() + }, + if let Some(city) = &self.city { + format!("{:?}", city).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(emergency_enabled) = &self.emergency_enabled { + format!("{:?}", emergency_enabled).into() + } else { + String::new().into() + }, + if let Some(auto_correct_address) = &self.auto_correct_address { + format!("{:?}", auto_correct_address).into() + } else { + String::new().into() + }, + if let Some(street_secondary) = &self.street_secondary { + format!("{:?}", street_secondary).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "customer_name".into(), + "street".into(), + "city".into(), + "region".into(), + "postal_code".into(), + "emergency_enabled".into(), + "auto_correct_address".into(), + "street_secondary".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListApplicationResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub applications: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListApplicationResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListApplicationResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(applications) = &self.applications { + format!("{:?}", applications).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "applications".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateApplicationRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateApplicationRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateApplicationRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateApplicationRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateApplicationRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateApplicationRequest { + #[doc = "The API version to use to start a new TwiML session. Can be: `2010-04-01` or \ + `2008-08-01`. The default value is the account's default API version."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "The URL we should call when the phone number assigned to this application receives a \ + call."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "Whether we should look up the caller's caller-ID name from the CNAM database \ + (additional charges apply). Can be: `true` or `false`."] + #[serde( + rename = "VoiceCallerIdLookup", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_caller_id_lookup: Option, + #[doc = "The URL we should call when the phone number receives an incoming SMS message."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL that we should call when an error occurs while retrieving or executing the \ + TwiML from `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, + #[doc = "The URL we should call using a POST method to send status information about SMS \ + messages sent by the application."] + #[serde( + rename = "SmsStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_status_callback: Option, + #[doc = "The URL we should call using a POST method to send message status information to \ + your application."] + #[serde( + rename = "MessageStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub message_status_callback: Option, + #[doc = "A descriptive string that you create to describe the new application. It can be up \ + to 64 characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can \ + be: `true` or `false`."] + #[serde( + rename = "PublicApplicationConnectEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub public_application_connect_enabled: Option, +} + +impl std::fmt::Display for CreateApplicationRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateApplicationRequest { + const LENGTH: usize = 16; + fn fields(&self) -> Vec> { + vec![ + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_status_callback) = &self.sms_status_callback { + format!("{:?}", sms_status_callback).into() + } else { + String::new().into() + }, + if let Some(message_status_callback) = &self.message_status_callback { + format!("{:?}", message_status_callback).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(public_application_connect_enabled) = + &self.public_application_connect_enabled + { + format!("{:?}", public_application_connect_enabled).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "api_version".into(), + "voice_url".into(), + "voice_method".into(), + "voice_fallback_url".into(), + "voice_fallback_method".into(), + "status_callback".into(), + "status_callback_method".into(), + "voice_caller_id_lookup".into(), + "sms_url".into(), + "sms_method".into(), + "sms_fallback_url".into(), + "sms_fallback_method".into(), + "sms_status_callback".into(), + "message_status_callback".into(), + "friendly_name".into(), + "public_application_connect_enabled".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateApplicationRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateApplicationRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateApplicationRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateApplicationRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateApplicationRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateApplicationRequest { + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The API version to use to start a new TwiML session. Can be: `2010-04-01` or \ + `2008-08-01`. The default value is your account's default API version."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "The URL we should call when the phone number assigned to this application receives a \ + call."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "Whether we should look up the caller's caller-ID name from the CNAM database \ + (additional charges apply). Can be: `true` or `false`."] + #[serde( + rename = "VoiceCallerIdLookup", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_caller_id_lookup: Option, + #[doc = "The URL we should call when the phone number receives an incoming SMS message."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL that we should call when an error occurs while retrieving or executing the \ + TwiML from `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, + #[doc = "Same as message_status_callback: The URL we should call using a POST method to send \ + status information about SMS messages sent by the application. Deprecated, included \ + for backwards compatibility."] + #[serde( + rename = "SmsStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_status_callback: Option, + #[doc = "The URL we should call using a POST method to send message status information to \ + your application."] + #[serde( + rename = "MessageStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub message_status_callback: Option, + #[doc = "Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can \ + be: `true` or `false`."] + #[serde( + rename = "PublicApplicationConnectEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub public_application_connect_enabled: Option, +} + +impl std::fmt::Display for UpdateApplicationRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateApplicationRequest { + const LENGTH: usize = 16; + fn fields(&self) -> Vec> { + vec![ + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_status_callback) = &self.sms_status_callback { + format!("{:?}", sms_status_callback).into() + } else { + String::new().into() + }, + if let Some(message_status_callback) = &self.message_status_callback { + format!("{:?}", message_status_callback).into() + } else { + String::new().into() + }, + if let Some(public_application_connect_enabled) = + &self.public_application_connect_enabled + { + format!("{:?}", public_application_connect_enabled).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "api_version".into(), + "voice_url".into(), + "voice_method".into(), + "voice_fallback_url".into(), + "voice_fallback_method".into(), + "status_callback".into(), + "status_callback_method".into(), + "voice_caller_id_lookup".into(), + "sms_url".into(), + "sms_method".into(), + "sms_fallback_url".into(), + "sms_fallback_method".into(), + "sms_status_callback".into(), + "message_status_callback".into(), + "public_application_connect_enabled".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAuthorizedConnectAppResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorized_connect_apps: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAuthorizedConnectAppResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAuthorizedConnectAppResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(authorized_connect_apps) = &self.authorized_connect_apps { + format!("{:?}", authorized_connect_apps).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "authorized_connect_apps".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberCountryResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub countries: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberCountryResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberCountryResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(countries) = &self.countries { + format!("{:?}", countries).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "countries".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberLocalResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberLocalResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberLocalResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(available_phone_numbers) = &self.available_phone_numbers { + format!("{:?}", available_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "available_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberMachineToMachineResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberMachineToMachineResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberMachineToMachineResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(available_phone_numbers) = &self.available_phone_numbers { + format!("{:?}", available_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "available_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberMobileResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberMobileResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberMobileResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(available_phone_numbers) = &self.available_phone_numbers { + format!("{:?}", available_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "available_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberNationalResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberNationalResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberNationalResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(available_phone_numbers) = &self.available_phone_numbers { + format!("{:?}", available_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "available_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberSharedCostResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberSharedCostResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberSharedCostResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(available_phone_numbers) = &self.available_phone_numbers { + format!("{:?}", available_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "available_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberTollFreeResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberTollFreeResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberTollFreeResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(available_phone_numbers) = &self.available_phone_numbers { + format!("{:?}", available_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "available_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListAvailablePhoneNumberVoipResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListAvailablePhoneNumberVoipResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListAvailablePhoneNumberVoipResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(available_phone_numbers) = &self.available_phone_numbers { + format!("{:?}", available_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "available_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListCallResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub calls: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListCallResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListCallResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(calls) = &self.calls { + format!("{:?}", calls).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "calls".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or \ + `POST` and the default is `POST`. If an `application_sid` parameter is present, this \ + parameter is ignored."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Method { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` \ + and the default is `POST`. If an `application_sid` parameter is present, this parameter \ + is ignored."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum FallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or \ + `POST` and the default is `POST`. If an `application_sid` parameter is present, this \ + parameter is ignored."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateCallRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use when calling the `recording_status_callback` URL. Can be: \ + `GET` or `POST` and the default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum RecordingStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: \ + `GET` or `POST` and the default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AsyncAmdStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateCallRequest { + #[doc = "The phone number, SIP address, or client identifier to call."] + #[serde(rename = "To")] + pub to: String, + #[doc = "The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number."] + #[serde(rename = "From")] + pub from: String, + #[doc = "The HTTP method we should use when calling the `url` parameter's value. Can be: \ + `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is \ + present, this parameter is ignored."] + #[serde(rename = "Method", default, skip_serializing_if = "Option::is_none")] + pub method: Option, + #[doc = "The URL that we call using the `fallback_method` if an error occurs when requesting \ + or executing the TwiML at `url`. If an `application_sid` parameter is present, this \ + parameter is ignored."] + #[serde( + rename = "FallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub fallback_url: Option, + #[doc = "The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or \ + `POST` and the default is `POST`. If an `application_sid` parameter is present, this \ + parameter is ignored."] + #[serde( + rename = "FallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub fallback_method: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application. If no `status_callback_event` is specified, we will send the \ + `completed` status. If an `application_sid` parameter is present, this parameter is \ + ignored. URLs must contain a valid hostname (underscores are not permitted)."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored."] + #[serde( + rename = "StatusCallbackEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_event: Option>, + #[doc = "The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` \ + or `POST` and the default is `POST`. If an `application_sid` parameter is present, \ + this parameter is ignored."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "A string of keys to dial after connecting to the number, maximum of 32 digits. Valid \ + digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert \ + a half second pause. For example, if you connected to a company phone number and \ + wanted to pause for one second, and then dial extension 1234 followed by the pound \ + key, the value of this parameter would be `ww1234#`. Remember to URL-encode this \ + string, since the '`#`' character has special meaning in a URL. If both `SendDigits` \ + and `MachineDetection` parameters are provided, then `MachineDetection` will be \ + ignored."] + #[serde( + rename = "SendDigits", + default, + skip_serializing_if = "Option::is_none" + )] + pub send_digits: Option, + #[doc = "The integer number of seconds that we should allow the phone to ring before assuming \ + there is no answer. The default is `60` seconds and the maximum is `600` seconds. \ + For some call flows, we will add a 5-second buffer to the timeout value you provide. \ + For this reason, a timeout value of 10 seconds could result in an actual timeout \ + closer to 15 seconds. You can set this to a short time, such as `15` seconds, to \ + hang up before reaching an answering machine or voicemail."] + #[serde(rename = "Timeout", default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[doc = "Whether to record the call. Can be `true` to record the phone call, or `false` to \ + not. The default is `false`. The `recording_url` is sent to the `status_callback` \ + URL."] + #[serde(rename = "Record", default, skip_serializing_if = "Option::is_none")] + pub record: Option, + #[doc = "The number of channels in the final recording. Can be: `mono` or `dual`. The default \ + is `mono`. `mono` records both legs of the call in a single channel of the recording \ + file. `dual` records each leg to a separate channel of the recording file. The first \ + channel of a dual-channel recording contains the parent call and the second channel \ + contains the child call."] + #[serde( + rename = "RecordingChannels", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_channels: Option, + #[doc = "The URL that we call when the recording is available to be accessed."] + #[serde( + rename = "RecordingStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback: Option, + #[doc = "The HTTP method we should use when calling the `recording_status_callback` URL. Can \ + be: `GET` or `POST` and the default is `POST`."] + #[serde( + rename = "RecordingStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback_method: Option, + #[doc = "The username used to authenticate the caller making a SIP call."] + #[serde( + rename = "SipAuthUsername", + default, + skip_serializing_if = "Option::is_none" + )] + pub sip_auth_username: Option, + #[doc = "The password required to authenticate the user account specified in \ + `sip_auth_username`."] + #[serde( + rename = "SipAuthPassword", + default, + skip_serializing_if = "Option::is_none" + )] + pub sip_auth_password: Option, + #[doc = "Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection)."] + #[serde( + rename = "MachineDetection", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection: Option, + #[doc = "The number of seconds that we should attempt to detect an answering machine before \ + timing out and sending a voice request with `AnsweredBy` of `unknown`. The default \ + timeout is 30 seconds."] + #[serde( + rename = "MachineDetectionTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_timeout: Option, + #[doc = "The recording status events that will trigger calls to the URL specified in \ + `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. \ + Defaults to `completed`. Separate multiple values with a space."] + #[serde( + rename = "RecordingStatusCallbackEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback_event: Option>, + #[doc = "Whether to trim any leading and trailing silence from the recording. Can be: \ + `trim-silence` or `do-not-trim` and the default is `trim-silence`."] + #[serde(rename = "Trim", default, skip_serializing_if = "Option::is_none")] + pub trim: Option, + #[doc = "The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`."] + #[serde(rename = "CallerId", default, skip_serializing_if = "Option::is_none")] + pub caller_id: Option, + #[doc = "The number of milliseconds that is used as the measuring stick for the length of the \ + speech activity, where durations lower than this value will be interpreted as a \ + human and longer than this value as a machine. Possible Values: 1000-6000. Default: \ + 2400."] + #[serde( + rename = "MachineDetectionSpeechThreshold", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_speech_threshold: Option, + #[doc = "The number of milliseconds of silence after speech activity at which point the \ + speech activity is considered complete. Possible Values: 500-5000. Default: 1200."] + #[serde( + rename = "MachineDetectionSpeechEndThreshold", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_speech_end_threshold: Option, + #[doc = "The number of milliseconds of initial silence after which an `unknown` AnsweredBy \ + result will be returned. Possible Values: 2000-10000. Default: 5000."] + #[serde( + rename = "MachineDetectionSilenceTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_silence_timeout: Option, + #[doc = "Select whether to perform answering machine detection in the background. Default, \ + blocks the execution of the call until Answering Machine Detection is completed. Can \ + be: `true` or `false`."] + #[serde(rename = "AsyncAmd", default, skip_serializing_if = "Option::is_none")] + pub async_amd: Option, + #[doc = "The URL that we should call using the `async_amd_status_callback_method` to notify \ + customer application whether the call was answered by human, machine or fax."] + #[serde( + rename = "AsyncAmdStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub async_amd_status_callback: Option, + #[doc = "The HTTP method we should use when calling the `async_amd_status_callback` URL. Can \ + be: `GET` or `POST` and the default is `POST`."] + #[serde( + rename = "AsyncAmdStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub async_amd_status_callback_method: Option, + #[doc = "The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that \ + `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. \ + (Beta)"] + #[serde(rename = "Byoc", default, skip_serializing_if = "Option::is_none")] + pub byoc: Option, + #[doc = "The Reason for the outgoing call. Use it to specify the purpose of the call that is \ + presented on the called party's phone. (Branded Calls Beta)"] + #[serde( + rename = "CallReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub call_reason: Option, + #[doc = "A token string needed to invoke a forwarded call. A call_token is generated when an \ + incoming call is received on a Twilio number. Pass an incoming call's call_token \ + value to a forwarded call via the call_token parameter when creating a new call. A \ + forwarded call should bear the same CallerID of the original incoming call."] + #[serde(rename = "CallToken", default, skip_serializing_if = "Option::is_none")] + pub call_token: Option, + #[doc = "The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The \ + default is `both`. `inbound` records the audio that is received by Twilio. \ + `outbound` records the audio that is generated from Twilio. `both` records the audio \ + that is received and generated by Twilio."] + #[serde( + rename = "RecordingTrack", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_track: Option, + #[doc = "The maximum duration of the call in seconds. Constraints depend on account and \ + configuration."] + #[serde(rename = "TimeLimit", default, skip_serializing_if = "Option::is_none")] + pub time_limit: Option, + #[doc = "The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls)."] + #[serde(rename = "Url", default, skip_serializing_if = "Option::is_none")] + pub url: Option, + #[doc = "TwiML instructions for the call Twilio will use without fetching Twiml from url \ + parameter. If both `twiml` and `url` are provided then `twiml` parameter will be \ + ignored. Max 4000 characters."] + #[serde(rename = "Twiml", default, skip_serializing_if = "Option::is_none")] + pub twiml: Option, + #[doc = "The SID of the Application resource that will handle the call, if the call will be \ + handled by an application."] + #[serde( + rename = "ApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub application_sid: Option, +} + +impl std::fmt::Display for CreateCallRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateCallRequest { + const LENGTH: usize = 35; + fn fields(&self) -> Vec> { + vec![ + self.to.clone().into(), + self.from.clone().into(), + if let Some(method) = &self.method { + format!("{:?}", method).into() + } else { + String::new().into() + }, + if let Some(fallback_url) = &self.fallback_url { + format!("{:?}", fallback_url).into() + } else { + String::new().into() + }, + if let Some(fallback_method) = &self.fallback_method { + format!("{:?}", fallback_method).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_event) = &self.status_callback_event { + format!("{:?}", status_callback_event).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(send_digits) = &self.send_digits { + format!("{:?}", send_digits).into() + } else { + String::new().into() + }, + if let Some(timeout) = &self.timeout { + format!("{:?}", timeout).into() + } else { + String::new().into() + }, + if let Some(record) = &self.record { + format!("{:?}", record).into() + } else { + String::new().into() + }, + if let Some(recording_channels) = &self.recording_channels { + format!("{:?}", recording_channels).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback) = &self.recording_status_callback { + format!("{:?}", recording_status_callback).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback_method) = &self.recording_status_callback_method { + format!("{:?}", recording_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(sip_auth_username) = &self.sip_auth_username { + format!("{:?}", sip_auth_username).into() + } else { + String::new().into() + }, + if let Some(sip_auth_password) = &self.sip_auth_password { + format!("{:?}", sip_auth_password).into() + } else { + String::new().into() + }, + if let Some(machine_detection) = &self.machine_detection { + format!("{:?}", machine_detection).into() + } else { + String::new().into() + }, + if let Some(machine_detection_timeout) = &self.machine_detection_timeout { + format!("{:?}", machine_detection_timeout).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback_event) = &self.recording_status_callback_event { + format!("{:?}", recording_status_callback_event).into() + } else { + String::new().into() + }, + if let Some(trim) = &self.trim { + format!("{:?}", trim).into() + } else { + String::new().into() + }, + if let Some(caller_id) = &self.caller_id { + format!("{:?}", caller_id).into() + } else { + String::new().into() + }, + if let Some(machine_detection_speech_threshold) = + &self.machine_detection_speech_threshold + { + format!("{:?}", machine_detection_speech_threshold).into() + } else { + String::new().into() + }, + if let Some(machine_detection_speech_end_threshold) = + &self.machine_detection_speech_end_threshold + { + format!("{:?}", machine_detection_speech_end_threshold).into() + } else { + String::new().into() + }, + if let Some(machine_detection_silence_timeout) = &self.machine_detection_silence_timeout + { + format!("{:?}", machine_detection_silence_timeout).into() + } else { + String::new().into() + }, + if let Some(async_amd) = &self.async_amd { + format!("{:?}", async_amd).into() + } else { + String::new().into() + }, + if let Some(async_amd_status_callback) = &self.async_amd_status_callback { + format!("{:?}", async_amd_status_callback).into() + } else { + String::new().into() + }, + if let Some(async_amd_status_callback_method) = &self.async_amd_status_callback_method { + format!("{:?}", async_amd_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(byoc) = &self.byoc { + format!("{:?}", byoc).into() + } else { + String::new().into() + }, + if let Some(call_reason) = &self.call_reason { + format!("{:?}", call_reason).into() + } else { + String::new().into() + }, + if let Some(call_token) = &self.call_token { + format!("{:?}", call_token).into() + } else { + String::new().into() + }, + if let Some(recording_track) = &self.recording_track { + format!("{:?}", recording_track).into() + } else { + String::new().into() + }, + if let Some(time_limit) = &self.time_limit { + format!("{:?}", time_limit).into() + } else { + String::new().into() + }, + if let Some(url) = &self.url { + format!("{:?}", url).into() + } else { + String::new().into() + }, + if let Some(twiml) = &self.twiml { + format!("{:?}", twiml).into() + } else { + String::new().into() + }, + if let Some(application_sid) = &self.application_sid { + format!("{:?}", application_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "to".into(), + "from".into(), + "method".into(), + "fallback_url".into(), + "fallback_method".into(), + "status_callback".into(), + "status_callback_event".into(), + "status_callback_method".into(), + "send_digits".into(), + "timeout".into(), + "record".into(), + "recording_channels".into(), + "recording_status_callback".into(), + "recording_status_callback_method".into(), + "sip_auth_username".into(), + "sip_auth_password".into(), + "machine_detection".into(), + "machine_detection_timeout".into(), + "recording_status_callback_event".into(), + "trim".into(), + "caller_id".into(), + "machine_detection_speech_threshold".into(), + "machine_detection_speech_end_threshold".into(), + "machine_detection_silence_timeout".into(), + "async_amd".into(), + "async_amd_status_callback".into(), + "async_amd_status_callback_method".into(), + "byoc".into(), + "call_reason".into(), + "call_token".into(), + "recording_track".into(), + "time_limit".into(), + "url".into(), + "twiml".into(), + "application_sid".into(), + ] + } +} + +#[doc = "The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the \ + default is `POST`. If an `application_sid` parameter is present, this parameter is \ + ignored."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateCallRequestMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or \ + `POST` and the default is `POST`. If an `application_sid` parameter is present, this \ + parameter is ignored."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateCallRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateCallRequest { + #[doc = "The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls)."] + #[serde(rename = "Url", default, skip_serializing_if = "Option::is_none")] + pub url: Option, + #[doc = "The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and \ + the default is `POST`. If an `application_sid` parameter is present, this parameter \ + is ignored."] + #[serde(rename = "Method", default, skip_serializing_if = "Option::is_none")] + pub method: Option, + #[serde(rename = "Status", default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The URL that we call using the `fallback_method` if an error occurs when requesting \ + or executing the TwiML at `url`. If an `application_sid` parameter is present, this \ + parameter is ignored."] + #[serde( + rename = "FallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub fallback_url: Option, + #[doc = "The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or \ + `POST` and the default is `POST`. If an `application_sid` parameter is present, this \ + parameter is ignored."] + #[serde( + rename = "FallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub fallback_method: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application. If no `status_callback_event` is specified, we will send the \ + `completed` status. If an `application_sid` parameter is present, this parameter is \ + ignored. URLs must contain a valid hostname (underscores are not permitted)."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use when requesting the `status_callback` URL. Can be: \ + `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is \ + present, this parameter is ignored."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "TwiML instructions for the call Twilio will use without fetching Twiml from url. \ + Twiml and url parameters are mutually exclusive"] + #[serde(rename = "Twiml", default, skip_serializing_if = "Option::is_none")] + pub twiml: Option, + #[doc = "The maximum duration of the call in seconds. Constraints depend on account and \ + configuration."] + #[serde(rename = "TimeLimit", default, skip_serializing_if = "Option::is_none")] + pub time_limit: Option, +} + +impl std::fmt::Display for UpdateCallRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateCallRequest { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(url) = &self.url { + format!("{:?}", url).into() + } else { + String::new().into() + }, + if let Some(method) = &self.method { + format!("{:?}", method).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(fallback_url) = &self.fallback_url { + format!("{:?}", fallback_url).into() + } else { + String::new().into() + }, + if let Some(fallback_method) = &self.fallback_method { + format!("{:?}", fallback_method).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(twiml) = &self.twiml { + format!("{:?}", twiml).into() + } else { + String::new().into() + }, + if let Some(time_limit) = &self.time_limit { + format!("{:?}", time_limit).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "url".into(), + "method".into(), + "status".into(), + "fallback_url".into(), + "fallback_method".into(), + "status_callback".into(), + "status_callback_method".into(), + "twiml".into(), + "time_limit".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListCallEventResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub events: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListCallEventResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListCallEventResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(events) = &self.events { + format!("{:?}", events).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "events".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateCallFeedbackRequest { + #[doc = "The call quality expressed as an integer from `1` to `5` where `1` represents very \ + poor call quality and `5` represents a perfect call."] + #[serde( + rename = "QualityScore", + default, + skip_serializing_if = "Option::is_none" + )] + pub quality_score: Option, + #[doc = "One or more issues experienced during the call. The issues can be: \ + `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, \ + `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`."] + #[serde(rename = "Issue", default, skip_serializing_if = "Option::is_none")] + pub issue: Option>, +} + +impl std::fmt::Display for UpdateCallFeedbackRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateCallFeedbackRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(quality_score) = &self.quality_score { + format!("{:?}", quality_score).into() + } else { + String::new().into() + }, + if let Some(issue) = &self.issue { + format!("{:?}", issue).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["quality_score".into(), "issue".into()] + } +} + +#[doc = "The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateCallFeedbackSummaryRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateCallFeedbackSummaryRequest { + #[doc = "Only include feedback given on or after this date. Format is `YYYY-MM-DD` and \ + specified in UTC."] + #[serde(rename = "StartDate")] + pub start_date: chrono::NaiveDate, + #[doc = "Only include feedback given on or before this date. Format is `YYYY-MM-DD` and \ + specified in UTC."] + #[serde(rename = "EndDate")] + pub end_date: chrono::NaiveDate, + #[doc = "Whether to also include Feedback resources from all subaccounts. `true` includes \ + feedback from all subaccounts and `false`, the default, includes feedback from only \ + the specified account."] + #[serde( + rename = "IncludeSubaccounts", + default, + skip_serializing_if = "Option::is_none" + )] + pub include_subaccounts: Option, + #[doc = "The URL that we will request when the feedback summary is complete."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` \ + URL."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, +} + +impl std::fmt::Display for CreateCallFeedbackSummaryRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateCallFeedbackSummaryRequest { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.start_date).into(), + format!("{:?}", self.end_date).into(), + if let Some(include_subaccounts) = &self.include_subaccounts { + format!("{:?}", include_subaccounts).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "start_date".into(), + "end_date".into(), + "include_subaccounts".into(), + "status_callback".into(), + "status_callback_method".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListCallNotificationResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub notifications: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListCallNotificationResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListCallNotificationResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(notifications) = &self.notifications { + format!("{:?}", notifications).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "notifications".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListCallRecordingResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recordings: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListCallRecordingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListCallRecordingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(recordings) = &self.recordings { + format!("{:?}", recordings).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "recordings".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or \ + `POST` and the default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateCallRecordingRequestRecordingStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateCallRecordingRequest { + #[doc = "The recording status events on which we should call the `recording_status_callback` \ + URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. \ + Separate multiple event values with a space."] + #[serde( + rename = "RecordingStatusCallbackEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback_event: Option>, + #[doc = "The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback)."] + #[serde( + rename = "RecordingStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback: Option, + #[doc = "The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or \ + `POST` and the default is `POST`."] + #[serde( + rename = "RecordingStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback_method: + Option, + #[doc = "Whether to trim any leading and trailing silence in the recording. Can be: \ + `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` \ + trims the silence from the beginning and end of the recording and `do-not-trim` does \ + not."] + #[serde(rename = "Trim", default, skip_serializing_if = "Option::is_none")] + pub trim: Option, + #[doc = "The number of channels used in the recording. Can be: `mono` or `dual` and the \ + default is `mono`. `mono` records all parties of the call into one channel. `dual` \ + records each party of a 2-party call into separate channels."] + #[serde( + rename = "RecordingChannels", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_channels: Option, + #[doc = "The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The \ + default is `both`. `inbound` records the audio that is received by Twilio. \ + `outbound` records the audio that is generated from Twilio. `both` records the audio \ + that is received and generated by Twilio."] + #[serde( + rename = "RecordingTrack", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_track: Option, +} + +impl std::fmt::Display for CreateCallRecordingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateCallRecordingRequest { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(recording_status_callback_event) = &self.recording_status_callback_event { + format!("{:?}", recording_status_callback_event).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback) = &self.recording_status_callback { + format!("{:?}", recording_status_callback).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback_method) = &self.recording_status_callback_method { + format!("{:?}", recording_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(trim) = &self.trim { + format!("{:?}", trim).into() + } else { + String::new().into() + }, + if let Some(recording_channels) = &self.recording_channels { + format!("{:?}", recording_channels).into() + } else { + String::new().into() + }, + if let Some(recording_track) = &self.recording_track { + format!("{:?}", recording_track).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "recording_status_callback_event".into(), + "recording_status_callback".into(), + "recording_status_callback_method".into(), + "trim".into(), + "recording_channels".into(), + "recording_track".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateCallRecordingRequest { + #[serde(rename = "Status")] + pub status: CallRecordingEnumStatus, + #[doc = "Whether to record during a pause. Can be: `skip` or `silence` and the default is \ + `silence`. `skip` does not record during the pause period, while `silence` will \ + replace the actual audio of the call with silence during the pause period. This \ + parameter only applies when setting `status` is set to `paused`."] + #[serde( + rename = "PauseBehavior", + default, + skip_serializing_if = "Option::is_none" + )] + pub pause_behavior: Option, +} + +impl std::fmt::Display for UpdateCallRecordingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateCallRecordingRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.status).into(), + if let Some(pause_behavior) = &self.pause_behavior { + format!("{:?}", pause_behavior).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["status".into(), "pause_behavior".into()] + } +} + +#[doc = "The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is \ + `POST`"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AnnounceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateConferenceRequest { + #[serde(rename = "Status", default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The URL we should call to announce something into the conference. The URL may return \ + an MP3 file, a WAV file, or a TwiML document that contains ``, ``, \ + ``, or `` verbs."] + #[serde( + rename = "AnnounceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub announce_url: Option, + #[doc = "The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default \ + is `POST`"] + #[serde( + rename = "AnnounceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub announce_method: Option, +} + +impl std::fmt::Display for UpdateConferenceRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateConferenceRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(announce_url) = &self.announce_url { + format!("{:?}", announce_url).into() + } else { + String::new().into() + }, + if let Some(announce_method) = &self.announce_method { + format!("{:?}", announce_method).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "status".into(), + "announce_url".into(), + "announce_method".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListConferenceResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conferences: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListConferenceResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListConferenceResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(conferences) = &self.conferences { + format!("{:?}", conferences).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "conferences".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateConferenceRecordingRequest { + #[serde(rename = "Status")] + pub status: ConferenceRecordingEnumStatus, + #[doc = "Whether to record during a pause. Can be: `skip` or `silence` and the default is \ + `silence`. `skip` does not record during the pause period, while `silence` will \ + replace the actual audio of the call with silence during the pause period. This \ + parameter only applies when setting `status` is set to `paused`."] + #[serde( + rename = "PauseBehavior", + default, + skip_serializing_if = "Option::is_none" + )] + pub pause_behavior: Option, +} + +impl std::fmt::Display for UpdateConferenceRecordingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateConferenceRecordingRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.status).into(), + if let Some(pause_behavior) = &self.pause_behavior { + format!("{:?}", pause_behavior).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["status".into(), "pause_behavior".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListConferenceRecordingResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recordings: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListConferenceRecordingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListConferenceRecordingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(recordings) = &self.recordings { + format!("{:?}", recordings).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "recordings".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method to use when calling `deauthorize_callback_url`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateConnectAppRequestDeauthorizeCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateConnectAppRequest { + #[doc = "The URL to redirect the user to after we authenticate the user and obtain \ + authorization to access the Connect App."] + #[serde( + rename = "AuthorizeRedirectUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub authorize_redirect_url: Option, + #[doc = "The company name to set for the Connect App."] + #[serde( + rename = "CompanyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub company_name: Option, + #[doc = "The HTTP method to use when calling `deauthorize_callback_url`."] + #[serde( + rename = "DeauthorizeCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub deauthorize_callback_method: Option, + #[doc = "The URL to call using the `deauthorize_callback_method` to de-authorize the Connect \ + App."] + #[serde( + rename = "DeauthorizeCallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub deauthorize_callback_url: Option, + #[doc = "A description of the Connect App."] + #[serde( + rename = "Description", + default, + skip_serializing_if = "Option::is_none" + )] + pub description: Option, + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "A public URL where users can obtain more information about this Connect App."] + #[serde( + rename = "HomepageUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub homepage_url: Option, + #[doc = "A comma-separated list of the permissions you will request from the users of this \ + ConnectApp. Can include: `get-all` and `post-all`."] + #[serde( + rename = "Permissions", + default, + skip_serializing_if = "Option::is_none" + )] + pub permissions: Option>, +} + +impl std::fmt::Display for UpdateConnectAppRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateConnectAppRequest { + const LENGTH: usize = 8; + fn fields(&self) -> Vec> { + vec![ + if let Some(authorize_redirect_url) = &self.authorize_redirect_url { + format!("{:?}", authorize_redirect_url).into() + } else { + String::new().into() + }, + if let Some(company_name) = &self.company_name { + format!("{:?}", company_name).into() + } else { + String::new().into() + }, + if let Some(deauthorize_callback_method) = &self.deauthorize_callback_method { + format!("{:?}", deauthorize_callback_method).into() + } else { + String::new().into() + }, + if let Some(deauthorize_callback_url) = &self.deauthorize_callback_url { + format!("{:?}", deauthorize_callback_url).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(homepage_url) = &self.homepage_url { + format!("{:?}", homepage_url).into() + } else { + String::new().into() + }, + if let Some(permissions) = &self.permissions { + format!("{:?}", permissions).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "authorize_redirect_url".into(), + "company_name".into(), + "deauthorize_callback_method".into(), + "deauthorize_callback_url".into(), + "description".into(), + "friendly_name".into(), + "homepage_url".into(), + "permissions".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListConnectAppResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub connect_apps: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListConnectAppResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListConnectAppResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(connect_apps) = &self.connect_apps { + format!("{:?}", connect_apps).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "connect_apps".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListDependentPhoneNumberResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dependent_phone_numbers: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListDependentPhoneNumberResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListDependentPhoneNumberResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(dependent_phone_numbers) = &self.dependent_phone_numbers { + format!("{:?}", dependent_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "dependent_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateIncomingPhoneNumberRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateIncomingPhoneNumberRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateIncomingPhoneNumberRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateIncomingPhoneNumberRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateIncomingPhoneNumberRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateIncomingPhoneNumberRequest { + #[doc = "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers)."] + #[serde( + rename = "AccountSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub account_sid: Option, + #[doc = "The API version to use for incoming calls made to the phone number. The default is \ + `2010-04-01`."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "A descriptive string that you created to describe this phone number. It can be up to \ + 64 characters long. By default, this is a formatted version of the phone number."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The SID of the application that should handle SMS messages sent to the number. If an \ + `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use \ + those set on the application."] + #[serde( + rename = "SmsApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_application_sid: Option, + #[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs while requesting or executing the \ + TwiML defined by `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we should call when the phone number receives an incoming SMS message."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "The SID of the application we should use to handle phone calls to the phone number. \ + If a `voice_application_sid` is present, we ignore all of the voice urls and use \ + only those set on the application. Setting a `voice_application_sid` will \ + automatically delete your `trunk_sid` and vice versa."] + #[serde( + rename = "VoiceApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_application_sid: Option, + #[doc = "Whether to lookup the caller's name from the CNAM database and post it to your app. \ + Can be: `true` or `false` and defaults to `false`."] + #[serde( + rename = "VoiceCallerIdLookup", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call to answer a call to the phone number. The `voice_url` \ + will not be called if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[serde( + rename = "EmergencyStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration to use for emergency calling from \ + this phone number."] + #[serde( + rename = "EmergencyAddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_address_sid: Option, + #[doc = "The SID of the Trunk we should use to handle phone calls to the phone number. If a \ + `trunk_sid` is present, we ignore all of the voice urls and voice applications and \ + use only those set on the Trunk. Setting a `trunk_sid` will automatically delete \ + your `voice_application_sid` and vice versa."] + #[serde(rename = "TrunkSid", default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[serde( + rename = "VoiceReceiveMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_receive_mode: Option, + #[doc = "The SID of the Identity resource that we should associate with the phone number. \ + Some regions require an identity to meet local regulations."] + #[serde( + rename = "IdentitySid", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_sid: Option, + #[doc = "The SID of the Address resource we should associate with the phone number. Some \ + regions require addresses to meet local regulations."] + #[serde( + rename = "AddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub address_sid: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(rename = "BundleSid", default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, +} + +impl std::fmt::Display for UpdateIncomingPhoneNumberRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateIncomingPhoneNumberRequest { + const LENGTH: usize = 23; + fn fields(&self) -> Vec> { + vec![ + if let Some(account_sid) = &self.account_sid { + format!("{:?}", account_sid).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "account_sid".into(), + "api_version".into(), + "friendly_name".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "trunk_sid".into(), + "voice_receive_mode".into(), + "identity_sid".into(), + "address_sid".into(), + "bundle_sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListIncomingPhoneNumberResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub incoming_phone_numbers: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListIncomingPhoneNumberResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListIncomingPhoneNumberResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(incoming_phone_numbers) = &self.incoming_phone_numbers { + format!("{:?}", incoming_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "incoming_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateIncomingPhoneNumberRequest { + #[doc = "The API version to use for incoming calls made to the new phone number. The default \ + is `2010-04-01`."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "A descriptive string that you created to describe the new phone number. It can be up \ + to 64 characters long. By default, this is a formatted version of the new phone \ + number."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The SID of the application that should handle SMS messages sent to the new phone \ + number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` \ + urls and use those set on the application."] + #[serde( + rename = "SmsApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_application_sid: Option, + #[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs while requesting or executing the \ + TwiML defined by `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we should call when the new phone number receives an incoming SMS message."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "The SID of the application we should use to handle calls to the new phone number. If \ + a `voice_application_sid` is present, we ignore all of the voice urls and use only \ + those set on the application. Setting a `voice_application_sid` will automatically \ + delete your `trunk_sid` and vice versa."] + #[serde( + rename = "VoiceApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_application_sid: Option, + #[doc = "Whether to lookup the caller's name from the CNAM database and post it to your app. \ + Can be: `true` or `false` and defaults to `false`."] + #[serde( + rename = "VoiceCallerIdLookup", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call to answer a call to the new phone number. The \ + `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[serde( + rename = "EmergencyStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration to use for emergency calling from the \ + new phone number."] + #[serde( + rename = "EmergencyAddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_address_sid: Option, + #[doc = "The SID of the Trunk we should use to handle calls to the new phone number. If a \ + `trunk_sid` is present, we ignore all of the voice urls and voice applications and \ + use only those set on the Trunk. Setting a `trunk_sid` will automatically delete \ + your `voice_application_sid` and vice versa."] + #[serde(rename = "TrunkSid", default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[doc = "The SID of the Identity resource that we should associate with the new phone number. \ + Some regions require an identity to meet local regulations."] + #[serde( + rename = "IdentitySid", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_sid: Option, + #[doc = "The SID of the Address resource we should associate with the new phone number. Some \ + regions require addresses to meet local regulations."] + #[serde( + rename = "AddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub address_sid: Option, + #[serde( + rename = "VoiceReceiveMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_receive_mode: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(rename = "BundleSid", default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, + #[doc = "The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234."] + #[serde( + rename = "PhoneNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The desired area code for your new incoming phone number. Can be any three-digit, US \ + or Canada area code. We will provision an available phone number within this area \ + code for you. **You must provide an `area_code` or a `phone_number`.** (US and \ + Canada only)."] + #[serde(rename = "AreaCode", default, skip_serializing_if = "Option::is_none")] + pub area_code: Option, +} + +impl std::fmt::Display for CreateIncomingPhoneNumberRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateIncomingPhoneNumberRequest { + const LENGTH: usize = 24; + fn fields(&self) -> Vec> { + vec![ + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + format!("{:?}", self.phone_number).into(), + if let Some(area_code) = &self.area_code { + format!("{:?}", area_code).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "api_version".into(), + "friendly_name".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "trunk_sid".into(), + "identity_sid".into(), + "address_sid".into(), + "voice_receive_mode".into(), + "bundle_sid".into(), + "phone_number".into(), + "area_code".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListIncomingPhoneNumberAssignedAddOnResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub assigned_add_ons: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListIncomingPhoneNumberAssignedAddOnResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListIncomingPhoneNumberAssignedAddOnResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(assigned_add_ons) = &self.assigned_add_ons { + format!("{:?}", assigned_add_ons).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "assigned_add_ons".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateIncomingPhoneNumberAssignedAddOnRequest { + #[doc = "The SID that identifies the Add-on installation."] + #[serde(rename = "InstalledAddOnSid")] + pub installed_add_on_sid: String, +} + +impl std::fmt::Display for CreateIncomingPhoneNumberAssignedAddOnRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateIncomingPhoneNumberAssignedAddOnRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.installed_add_on_sid.clone().into()] + } + + fn headers() -> Vec> { + vec!["installed_add_on_sid".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListIncomingPhoneNumberAssignedAddOnExtensionResponse { # [serde (default , skip_serializing_if = "Option::is_none")] pub extensions : Option < Vec < ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension > > , # [serde (default , skip_serializing_if = "Option::is_none")] pub end : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub first_page_uri : Option < String > , # [serde (default , skip_serializing_if = "Option::is_none")] pub next_page_uri : Option < String > , # [serde (default , skip_serializing_if = "Option::is_none")] pub page : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub page_size : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub previous_page_uri : Option < String > , # [serde (default , skip_serializing_if = "Option::is_none")] pub start : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub uri : Option < String > , } + +impl std::fmt::Display for ListIncomingPhoneNumberAssignedAddOnExtensionResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListIncomingPhoneNumberAssignedAddOnExtensionResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(extensions) = &self.extensions { + format!("{:?}", extensions).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "extensions".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListIncomingPhoneNumberLocalResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub incoming_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListIncomingPhoneNumberLocalResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListIncomingPhoneNumberLocalResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(incoming_phone_numbers) = &self.incoming_phone_numbers { + format!("{:?}", incoming_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "incoming_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberLocalRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberLocalRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberLocalRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberLocalRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberLocalRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateIncomingPhoneNumberLocalRequest { + #[doc = "The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234."] + #[serde( + rename = "PhoneNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The API version to use for incoming calls made to the new phone number. The default \ + is `2010-04-01`."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "A descriptive string that you created to describe the new phone number. It can be up \ + to 64 characters long. By default, this is a formatted version of the phone number."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The SID of the application that should handle SMS messages sent to the new phone \ + number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` \ + urls and use those set on the application."] + #[serde( + rename = "SmsApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_application_sid: Option, + #[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs while requesting or executing the \ + TwiML defined by `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we should call when the new phone number receives an incoming SMS message."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "The SID of the application we should use to handle calls to the new phone number. If \ + a `voice_application_sid` is present, we ignore all of the voice urls and use only \ + those set on the application. Setting a `voice_application_sid` will automatically \ + delete your `trunk_sid` and vice versa."] + #[serde( + rename = "VoiceApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_application_sid: Option, + #[doc = "Whether to lookup the caller's name from the CNAM database and post it to your app. \ + Can be: `true` or `false` and defaults to `false`."] + #[serde( + rename = "VoiceCallerIdLookup", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call to answer a call to the new phone number. The \ + `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "The SID of the Identity resource that we should associate with the new phone number. \ + Some regions require an identity to meet local regulations."] + #[serde( + rename = "IdentitySid", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_sid: Option, + #[doc = "The SID of the Address resource we should associate with the new phone number. Some \ + regions require addresses to meet local regulations."] + #[serde( + rename = "AddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub address_sid: Option, + #[serde( + rename = "EmergencyStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration to use for emergency calling from the \ + new phone number."] + #[serde( + rename = "EmergencyAddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_address_sid: Option, + #[doc = "The SID of the Trunk we should use to handle calls to the new phone number. If a \ + `trunk_sid` is present, we ignore all of the voice urls and voice applications and \ + use only those set on the Trunk. Setting a `trunk_sid` will automatically delete \ + your `voice_application_sid` and vice versa."] + #[serde(rename = "TrunkSid", default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[serde( + rename = "VoiceReceiveMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_receive_mode: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(rename = "BundleSid", default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, +} + +impl std::fmt::Display for CreateIncomingPhoneNumberLocalRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateIncomingPhoneNumberLocalRequest { + const LENGTH: usize = 23; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.phone_number).into(), + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "phone_number".into(), + "api_version".into(), + "friendly_name".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "identity_sid".into(), + "address_sid".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "trunk_sid".into(), + "voice_receive_mode".into(), + "bundle_sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListIncomingPhoneNumberMobileResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub incoming_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListIncomingPhoneNumberMobileResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListIncomingPhoneNumberMobileResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(incoming_phone_numbers) = &self.incoming_phone_numbers { + format!("{:?}", incoming_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "incoming_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberMobileRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberMobileRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberMobileRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberMobileRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberMobileRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateIncomingPhoneNumberMobileRequest { + #[doc = "The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234."] + #[serde( + rename = "PhoneNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The API version to use for incoming calls made to the new phone number. The default \ + is `2010-04-01`."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "A descriptive string that you created to describe the new phone number. It can be up \ + to 64 characters long. By default, the is a formatted version of the phone number."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The SID of the application that should handle SMS messages sent to the new phone \ + number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` \ + urls and use those of the application."] + #[serde( + rename = "SmsApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_application_sid: Option, + #[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs while requesting or executing the \ + TwiML defined by `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we should call when the new phone number receives an incoming SMS message."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "The SID of the application we should use to handle calls to the new phone number. If \ + a `voice_application_sid` is present, we ignore all of the voice urls and use only \ + those set on the application. Setting a `voice_application_sid` will automatically \ + delete your `trunk_sid` and vice versa."] + #[serde( + rename = "VoiceApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_application_sid: Option, + #[doc = "Whether to lookup the caller's name from the CNAM database and post it to your app. \ + Can be: `true` or `false` and defaults to `false`."] + #[serde( + rename = "VoiceCallerIdLookup", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call to answer a call to the new phone number. The \ + `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "The SID of the Identity resource that we should associate with the new phone number. \ + Some regions require an identity to meet local regulations."] + #[serde( + rename = "IdentitySid", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_sid: Option, + #[doc = "The SID of the Address resource we should associate with the new phone number. Some \ + regions require addresses to meet local regulations."] + #[serde( + rename = "AddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub address_sid: Option, + #[serde( + rename = "EmergencyStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration to use for emergency calling from the \ + new phone number."] + #[serde( + rename = "EmergencyAddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_address_sid: Option, + #[doc = "The SID of the Trunk we should use to handle calls to the new phone number. If a \ + `trunk_sid` is present, we ignore all of the voice urls and voice applications and \ + use only those set on the Trunk. Setting a `trunk_sid` will automatically delete \ + your `voice_application_sid` and vice versa."] + #[serde(rename = "TrunkSid", default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[serde( + rename = "VoiceReceiveMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_receive_mode: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(rename = "BundleSid", default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, +} + +impl std::fmt::Display for CreateIncomingPhoneNumberMobileRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateIncomingPhoneNumberMobileRequest { + const LENGTH: usize = 23; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.phone_number).into(), + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "phone_number".into(), + "api_version".into(), + "friendly_name".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "identity_sid".into(), + "address_sid".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "trunk_sid".into(), + "voice_receive_mode".into(), + "bundle_sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListIncomingPhoneNumberTollFreeResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub incoming_phone_numbers: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListIncomingPhoneNumberTollFreeResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListIncomingPhoneNumberTollFreeResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(incoming_phone_numbers) = &self.incoming_phone_numbers { + format!("{:?}", incoming_phone_numbers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "incoming_phone_numbers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberTollFreeRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberTollFreeRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberTollFreeRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` \ + and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberTollFreeRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateIncomingPhoneNumberTollFreeRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateIncomingPhoneNumberTollFreeRequest { + #[doc = "The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234."] + #[serde( + rename = "PhoneNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub phone_number: phone_number::PhoneNumber, + #[doc = "The API version to use for incoming calls made to the new phone number. The default \ + is `2010-04-01`."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "A descriptive string that you created to describe the new phone number. It can be up \ + to 64 characters long. By default, this is a formatted version of the phone number."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The SID of the application that should handle SMS messages sent to the new phone \ + number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and \ + use those of the application."] + #[serde( + rename = "SmsApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_application_sid: Option, + #[doc = "The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs while requesting or executing the \ + TwiML defined by `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL we should call when the new phone number receives an incoming SMS message."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: + Option, + #[doc = "The SID of the application we should use to handle calls to the new phone number. If \ + a `voice_application_sid` is present, we ignore all of the voice urls and use those \ + set on the application. Setting a `voice_application_sid` will automatically delete \ + your `trunk_sid` and vice versa."] + #[serde( + rename = "VoiceApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_application_sid: Option, + #[doc = "Whether to lookup the caller's name from the CNAM database and post it to your app. \ + Can be: `true` or `false` and defaults to `false`."] + #[serde( + rename = "VoiceCallerIdLookup", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_caller_id_lookup: Option, + #[doc = "The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs retrieving or executing the TwiML \ + requested by `url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call to answer a call to the new phone number. The \ + `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "The SID of the Identity resource that we should associate with the new phone number. \ + Some regions require an Identity to meet local regulations."] + #[serde( + rename = "IdentitySid", + default, + skip_serializing_if = "Option::is_none" + )] + pub identity_sid: Option, + #[doc = "The SID of the Address resource we should associate with the new phone number. Some \ + regions require addresses to meet local regulations."] + #[serde( + rename = "AddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub address_sid: Option, + #[serde( + rename = "EmergencyStatus", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_status: Option, + #[doc = "The SID of the emergency address configuration to use for emergency calling from the \ + new phone number."] + #[serde( + rename = "EmergencyAddressSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_address_sid: Option, + #[doc = "The SID of the Trunk we should use to handle calls to the new phone number. If a \ + `trunk_sid` is present, we ignore all of the voice urls and voice applications and \ + use only those set on the Trunk. Setting a `trunk_sid` will automatically delete \ + your `voice_application_sid` and vice versa."] + #[serde(rename = "TrunkSid", default, skip_serializing_if = "Option::is_none")] + pub trunk_sid: Option, + #[serde( + rename = "VoiceReceiveMode", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_receive_mode: Option, + #[doc = "The SID of the Bundle resource that you associate with the phone number. Some \ + regions require a Bundle to meet local Regulations."] + #[serde(rename = "BundleSid", default, skip_serializing_if = "Option::is_none")] + pub bundle_sid: Option, +} + +impl std::fmt::Display for CreateIncomingPhoneNumberTollFreeRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateIncomingPhoneNumberTollFreeRequest { + const LENGTH: usize = 23; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.phone_number).into(), + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(sms_application_sid) = &self.sms_application_sid { + format!("{:?}", sms_application_sid).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_application_sid) = &self.voice_application_sid { + format!("{:?}", voice_application_sid).into() + } else { + String::new().into() + }, + if let Some(voice_caller_id_lookup) = &self.voice_caller_id_lookup { + format!("{:?}", voice_caller_id_lookup).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(identity_sid) = &self.identity_sid { + format!("{:?}", identity_sid).into() + } else { + String::new().into() + }, + if let Some(address_sid) = &self.address_sid { + format!("{:?}", address_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_status) = &self.emergency_status { + format!("{:?}", emergency_status).into() + } else { + String::new().into() + }, + if let Some(emergency_address_sid) = &self.emergency_address_sid { + format!("{:?}", emergency_address_sid).into() + } else { + String::new().into() + }, + if let Some(trunk_sid) = &self.trunk_sid { + format!("{:?}", trunk_sid).into() + } else { + String::new().into() + }, + if let Some(voice_receive_mode) = &self.voice_receive_mode { + format!("{:?}", voice_receive_mode).into() + } else { + String::new().into() + }, + if let Some(bundle_sid) = &self.bundle_sid { + format!("{:?}", bundle_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "phone_number".into(), + "api_version".into(), + "friendly_name".into(), + "sms_application_sid".into(), + "sms_fallback_method".into(), + "sms_fallback_url".into(), + "sms_method".into(), + "sms_url".into(), + "status_callback".into(), + "status_callback_method".into(), + "voice_application_sid".into(), + "voice_caller_id_lookup".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_url".into(), + "identity_sid".into(), + "address_sid".into(), + "emergency_status".into(), + "emergency_address_sid".into(), + "trunk_sid".into(), + "voice_receive_mode".into(), + "bundle_sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateKeyRequest { + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, +} + +impl std::fmt::Display for UpdateKeyRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateKeyRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListKeyResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub keys: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListKeyResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListKeyResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(keys) = &self.keys { + format!("{:?}", keys).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "keys".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateNewKeyRequest { + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, +} + +impl std::fmt::Display for CreateNewKeyRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateNewKeyRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListMediaResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub media_list: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListMediaResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListMediaResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(media_list) = &self.media_list { + format!("{:?}", media_list).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "media_list".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. \ + `POST` sends the data as encoded form data and `GET` sends the data as query parameters."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateMemberRequestMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateMemberRequest { + #[doc = "The absolute URL of the Queue resource."] + #[serde(rename = "Url")] + pub url: String, + #[doc = "How to pass the update request data. Can be `GET` or `POST` and the default is \ + `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query \ + parameters."] + #[serde(rename = "Method", default, skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +impl std::fmt::Display for UpdateMemberRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateMemberRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.url.clone().into(), + if let Some(method) = &self.method { + format!("{:?}", method).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["url".into(), "method".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListMemberResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue_members: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListMemberResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListMemberResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(queue_members) = &self.queue_members { + format!("{:?}", queue_members).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "queue_members".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListMessageResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub messages: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListMessageResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListMessageResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(messages) = &self.messages { + format!("{:?}", messages).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "messages".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateMessageRequest { + #[doc = "The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels."] + #[serde(rename = "To", default, skip_serializing_if = "Option::is_none")] + pub to: phone_number::PhoneNumber, + #[doc = "The URL we should call using the `status_callback_method` to send status information to your application. If specified, we POST these message status changes to the URL: `queued`, `failed`, `sent`, `delivered`, or `undelivered`. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/sms/twiml#request-parameters) as well as some additional parameters including `MessageSid`, `MessageStatus`, and `ErrorCode`. If you include this parameter with the `messaging_service_sid`, we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a valid hostname and underscores are not allowed."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The SID of the application that should receive message status. We POST a `message_sid` parameter and a `message_status` parameter with a value of `sent` or `failed` to the [application](https://www.twilio.com/docs/usage/api/applications)'s `message_status_callback`. If a `status_callback` parameter is also passed, it will be ignored and the application's `message_status_callback` parameter will be used."] + #[serde( + rename = "ApplicationSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub application_sid: Option, + #[doc = "The maximum total price in US dollars that you will pay for the message to be \ + delivered. Can be a decimal value that has up to 4 decimal places. All messages are \ + queued for delivery and the message cost is checked before the message is sent. If \ + the cost exceeds `max_price`, the message will fail and a status of `Failed` is sent \ + to the status callback. If `MaxPrice` is not set, the message cost is not checked."] + #[serde(rename = "MaxPrice", default, skip_serializing_if = "Option::is_none")] + pub max_price: Option, + #[doc = "Whether to confirm delivery of the message. Set this value to `true` if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the [Message Feedback API](https://www.twilio.com/docs/sms/api/message-feedback-resource). This parameter is `false` by default."] + #[serde( + rename = "ProvideFeedback", + default, + skip_serializing_if = "Option::is_none" + )] + pub provide_feedback: Option, + #[doc = "Total number of attempts made ( including this ) to send out the message regardless \ + of the provider used"] + #[serde(rename = "Attempt", default, skip_serializing_if = "Option::is_none")] + pub attempt: Option, + #[doc = "How long in seconds the message can remain in our outgoing message queue. After this \ + period elapses, the message fails and we call your status callback. Can be between 1 \ + and the default value of 14,400 seconds. After a message has been accepted by a \ + carrier, however, we cannot guarantee that the message will not be queued after this \ + period. We recommend that this value be at least 5 seconds."] + #[serde( + rename = "ValidityPeriod", + default, + skip_serializing_if = "Option::is_none" + )] + pub validity_period: Option, + #[doc = "Reserved"] + #[serde( + rename = "ForceDelivery", + default, + skip_serializing_if = "Option::is_none" + )] + pub force_delivery: Option, + #[serde( + rename = "ContentRetention", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_retention: Option, + #[serde( + rename = "AddressRetention", + default, + skip_serializing_if = "Option::is_none" + )] + pub address_retention: Option, + #[doc = "Whether to detect Unicode characters that have a similar GSM-7 character and replace \ + them. Can be: `true` or `false`."] + #[serde( + rename = "SmartEncoded", + default, + skip_serializing_if = "Option::is_none" + )] + pub smart_encoded: Option, + #[doc = "Rich actions for Channels Messages."] + #[serde( + rename = "PersistentAction", + default, + skip_serializing_if = "Option::is_none" + )] + pub persistent_action: Option>, + #[doc = "Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to \ + replace all links in the Message with a shortened version based on the associated \ + Domain Sid and track clicks on them. If this parameter is not set on an API call, we \ + will use the value set on the Messaging Service. If this parameter is not set and \ + the value is not configured on the Messaging Service used this will default to \ + `false`."] + #[serde( + rename = "ShortenUrls", + default, + skip_serializing_if = "Option::is_none" + )] + pub shorten_urls: Option, + #[serde( + rename = "ScheduleType", + default, + skip_serializing_if = "Option::is_none" + )] + pub schedule_type: Option, + #[doc = "The time that Twilio will send the message. Must be in ISO 8601 format."] + #[serde( + rename = "SendAt", + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::utils::nullable_date_time_format::deserialize" + )] + pub send_at: Option>, + #[doc = "If set to True, Twilio will deliver the message as a single MMS message, regardless \ + of the presence of media."] + #[serde(rename = "SendAsMms", default, skip_serializing_if = "Option::is_none")] + pub send_as_mms: Option, + #[doc = "The SID of the Content object returned at Content API content create time (https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template). If this parameter is not specified, then the Content API will not be utilized."] + #[serde( + rename = "ContentSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_sid: Option, + #[doc = "Key-value pairs of variable names to substitution values, used alongside a \ + content_sid. If not specified, Content API will default to the default variables \ + defined at create time."] + #[serde( + rename = "ContentVariables", + default, + skip_serializing_if = "Option::is_none" + )] + pub content_variables: Option, + #[doc = "A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty."] + #[serde(rename = "From", default, skip_serializing_if = "Option::is_none")] + pub from: phone_number::PhoneNumber, + #[doc = "The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery."] + #[serde( + rename = "MessagingServiceSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub messaging_service_sid: Option, + #[doc = "The text of the message you want to send. Can be up to 1,600 characters in length."] + #[serde(rename = "Body", default, skip_serializing_if = "Option::is_none")] + pub body: Option, + #[doc = "The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada."] + #[serde(rename = "MediaUrl", default, skip_serializing_if = "Option::is_none")] + pub media_url: Option>, +} + +impl std::fmt::Display for CreateMessageRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateMessageRequest { + const LENGTH: usize = 22; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.to).into(), + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(application_sid) = &self.application_sid { + format!("{:?}", application_sid).into() + } else { + String::new().into() + }, + if let Some(max_price) = &self.max_price { + format!("{:?}", max_price).into() + } else { + String::new().into() + }, + if let Some(provide_feedback) = &self.provide_feedback { + format!("{:?}", provide_feedback).into() + } else { + String::new().into() + }, + if let Some(attempt) = &self.attempt { + format!("{:?}", attempt).into() + } else { + String::new().into() + }, + if let Some(validity_period) = &self.validity_period { + format!("{:?}", validity_period).into() + } else { + String::new().into() + }, + if let Some(force_delivery) = &self.force_delivery { + format!("{:?}", force_delivery).into() + } else { + String::new().into() + }, + if let Some(content_retention) = &self.content_retention { + format!("{:?}", content_retention).into() + } else { + String::new().into() + }, + if let Some(address_retention) = &self.address_retention { + format!("{:?}", address_retention).into() + } else { + String::new().into() + }, + if let Some(smart_encoded) = &self.smart_encoded { + format!("{:?}", smart_encoded).into() + } else { + String::new().into() + }, + if let Some(persistent_action) = &self.persistent_action { + format!("{:?}", persistent_action).into() + } else { + String::new().into() + }, + if let Some(shorten_urls) = &self.shorten_urls { + format!("{:?}", shorten_urls).into() + } else { + String::new().into() + }, + if let Some(schedule_type) = &self.schedule_type { + format!("{:?}", schedule_type).into() + } else { + String::new().into() + }, + if let Some(send_at) = &self.send_at { + format!("{:?}", send_at).into() + } else { + String::new().into() + }, + if let Some(send_as_mms) = &self.send_as_mms { + format!("{:?}", send_as_mms).into() + } else { + String::new().into() + }, + if let Some(content_sid) = &self.content_sid { + format!("{:?}", content_sid).into() + } else { + String::new().into() + }, + if let Some(content_variables) = &self.content_variables { + format!("{:?}", content_variables).into() + } else { + String::new().into() + }, + format!("{:?}", self.from).into(), + if let Some(messaging_service_sid) = &self.messaging_service_sid { + format!("{:?}", messaging_service_sid).into() + } else { + String::new().into() + }, + if let Some(body) = &self.body { + format!("{:?}", body).into() + } else { + String::new().into() + }, + if let Some(media_url) = &self.media_url { + format!("{:?}", media_url).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "to".into(), + "status_callback".into(), + "application_sid".into(), + "max_price".into(), + "provide_feedback".into(), + "attempt".into(), + "validity_period".into(), + "force_delivery".into(), + "content_retention".into(), + "address_retention".into(), + "smart_encoded".into(), + "persistent_action".into(), + "shorten_urls".into(), + "schedule_type".into(), + "send_at".into(), + "send_as_mms".into(), + "content_sid".into(), + "content_variables".into(), + "from".into(), + "messaging_service_sid".into(), + "body".into(), + "media_url".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateMessageRequest { + #[doc = "The text of the message you want to send. Can be up to 1,600 characters long."] + #[serde(rename = "Body", default, skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "Status", default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for UpdateMessageRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateMessageRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(body) = &self.body { + format!("{:?}", body).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["body".into(), "status".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateMessageFeedbackRequest { + #[serde(rename = "Outcome", default, skip_serializing_if = "Option::is_none")] + pub outcome: Option, +} + +impl std::fmt::Display for CreateMessageFeedbackRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateMessageFeedbackRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(outcome) = &self.outcome { + format!("{:?}", outcome).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["outcome".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSigningKeyResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signing_keys: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSigningKeyResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSigningKeyResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(signing_keys) = &self.signing_keys { + format!("{:?}", signing_keys).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "signing_keys".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateNewSigningKeyRequest { + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, +} + +impl std::fmt::Display for CreateNewSigningKeyRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateNewSigningKeyRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListNotificationResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub notifications: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListNotificationResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListNotificationResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(notifications) = &self.notifications { + format!("{:?}", notifications).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "notifications".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateOutgoingCallerIdRequest { + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, +} + +impl std::fmt::Display for UpdateOutgoingCallerIdRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateOutgoingCallerIdRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListOutgoingCallerIdResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outgoing_caller_ids: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListOutgoingCallerIdResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListOutgoingCallerIdResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(outgoing_caller_ids) = &self.outgoing_caller_ids { + format!("{:?}", outgoing_caller_ids).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "outgoing_caller_ids".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the \ + default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateValidationRequestRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateValidationRequestRequest { + #[doc = "The phone number to verify in \ + [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a \ + + followed by the country code and subscriber number."] + #[serde( + rename = "PhoneNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub phone_number: phone_number::PhoneNumber, + #[doc = "A descriptive string that you create to describe the new caller ID resource. It can \ + be up to 64 characters long. The default value is a formatted version of the phone \ + number."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The number of seconds to delay before initiating the verification call. Can be an \ + integer between `0` and `60`, inclusive. The default is `0`."] + #[serde(rename = "CallDelay", default, skip_serializing_if = "Option::is_none")] + pub call_delay: Option, + #[doc = "The digits to dial after connecting the verification call."] + #[serde(rename = "Extension", default, skip_serializing_if = "Option::is_none")] + pub extension: Option, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + about the verification process to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, \ + and the default is `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, +} + +impl std::fmt::Display for CreateValidationRequestRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateValidationRequestRequest { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.phone_number).into(), + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(call_delay) = &self.call_delay { + format!("{:?}", call_delay).into() + } else { + String::new().into() + }, + if let Some(extension) = &self.extension { + format!("{:?}", extension).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "phone_number".into(), + "friendly_name".into(), + "call_delay".into(), + "extension".into(), + "status_callback".into(), + "status_callback_method".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default \ + is `GET`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum HoldMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateParticipantRequestAnnounceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default \ + is `POST`. When using a static audio file, this should be `GET` so that we can cache the \ + file."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum WaitMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateParticipantRequest { + #[doc = "Whether the participant should be muted. Can be `true` or `false`. `true` will mute \ + the participant, and `false` will un-mute them. Anything value other than `true` or \ + `false` is interpreted as `false`."] + #[serde(rename = "Muted", default, skip_serializing_if = "Option::is_none")] + pub muted: Option, + #[doc = "Whether the participant should be on hold. Can be: `true` or `false`. `true` puts \ + the participant on hold, and `false` lets them rejoin the conference."] + #[serde(rename = "Hold", default, skip_serializing_if = "Option::is_none")] + pub hold: Option, + #[doc = "The URL we call using the `hold_method` for music that plays when the participant is \ + on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that \ + contains ``, ``, ``, or `` verbs."] + #[serde(rename = "HoldUrl", default, skip_serializing_if = "Option::is_none")] + pub hold_url: Option, + #[doc = "The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the \ + default is `GET`."] + #[serde( + rename = "HoldMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub hold_method: Option, + #[doc = "The URL we call using the `announce_method` for an announcement to the participant. \ + The URL may return an MP3 file, a WAV file, or a TwiML document that contains \ + ``, ``, ``, or `` verbs."] + #[serde( + rename = "AnnounceUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub announce_url: Option, + #[doc = "The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and \ + defaults to `POST`."] + #[serde( + rename = "AnnounceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub announce_method: Option, + #[doc = "The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic)."] + #[serde(rename = "WaitUrl", default, skip_serializing_if = "Option::is_none")] + pub wait_url: Option, + #[doc = "The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the \ + default is `POST`. When using a static audio file, this should be `GET` so that we \ + can cache the file."] + #[serde( + rename = "WaitMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub wait_method: Option, + #[doc = "Whether to play a notification beep to the conference when the participant exits. \ + Can be: `true` or `false`."] + #[serde( + rename = "BeepOnExit", + default, + skip_serializing_if = "Option::is_none" + )] + pub beep_on_exit: Option, + #[doc = "Whether to end the conference when the participant leaves. Can be: `true` or `false` \ + and defaults to `false`."] + #[serde( + rename = "EndConferenceOnExit", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_conference_on_exit: Option, + #[doc = "Whether the participant is coaching another call. Can be: `true` or `false`. If not \ + present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, \ + `call_sid_to_coach` must be defined."] + #[serde(rename = "Coaching", default, skip_serializing_if = "Option::is_none")] + pub coaching: Option, + #[doc = "The SID of the participant who is being `coached`. The participant being coached is \ + the only participant who can hear the participant who is `coaching`."] + #[serde( + rename = "CallSidToCoach", + default, + skip_serializing_if = "Option::is_none" + )] + pub call_sid_to_coach: Option, +} + +impl std::fmt::Display for UpdateParticipantRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateParticipantRequest { + const LENGTH: usize = 12; + fn fields(&self) -> Vec> { + vec![ + if let Some(muted) = &self.muted { + format!("{:?}", muted).into() + } else { + String::new().into() + }, + if let Some(hold) = &self.hold { + format!("{:?}", hold).into() + } else { + String::new().into() + }, + if let Some(hold_url) = &self.hold_url { + format!("{:?}", hold_url).into() + } else { + String::new().into() + }, + if let Some(hold_method) = &self.hold_method { + format!("{:?}", hold_method).into() + } else { + String::new().into() + }, + if let Some(announce_url) = &self.announce_url { + format!("{:?}", announce_url).into() + } else { + String::new().into() + }, + if let Some(announce_method) = &self.announce_method { + format!("{:?}", announce_method).into() + } else { + String::new().into() + }, + if let Some(wait_url) = &self.wait_url { + format!("{:?}", wait_url).into() + } else { + String::new().into() + }, + if let Some(wait_method) = &self.wait_method { + format!("{:?}", wait_method).into() + } else { + String::new().into() + }, + if let Some(beep_on_exit) = &self.beep_on_exit { + format!("{:?}", beep_on_exit).into() + } else { + String::new().into() + }, + if let Some(end_conference_on_exit) = &self.end_conference_on_exit { + format!("{:?}", end_conference_on_exit).into() + } else { + String::new().into() + }, + if let Some(coaching) = &self.coaching { + format!("{:?}", coaching).into() + } else { + String::new().into() + }, + if let Some(call_sid_to_coach) = &self.call_sid_to_coach { + format!("{:?}", call_sid_to_coach).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "muted".into(), + "hold".into(), + "hold_url".into(), + "hold_method".into(), + "announce_url".into(), + "announce_method".into(), + "wait_url".into(), + "wait_method".into(), + "beep_on_exit".into(), + "end_conference_on_exit".into(), + "coaching".into(), + "call_sid_to_coach".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListParticipantResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub participants: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListParticipantResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListParticipantResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(participants) = &self.participants { + format!("{:?}", participants).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "participants".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and \ + defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateParticipantRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or \ + `POST` and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ConferenceStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or \ + `POST` and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateParticipantRequestRecordingStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `conference_recording_status_callback`. Can be: \ + `GET` or `POST` and defaults to `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ConferenceRecordingStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` \ + or `POST` and the default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AmdStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateParticipantRequest { + #[doc = "The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `from` must also be a phone number. If `to` is sip address, this value of `from` should be a username portion to be used to populate the P-Asserted-Identity header that is passed to the SIP endpoint."] + #[serde(rename = "From")] + pub from: String, + #[doc = "The phone number, SIP address, or Client identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified."] + #[serde(rename = "To")] + pub to: String, + #[doc = "The URL we should call using the `status_callback_method` to send status information \ + to your application."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` \ + and defaults to `POST`."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "The conference state changes that should generate a call to `status_callback`. Can \ + be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values \ + with a space. The default value is `completed`."] + #[serde( + rename = "StatusCallbackEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_event: Option>, + #[doc = "A label for this participant. If one is supplied, it may subsequently be used to \ + fetch, update or delete the participant."] + #[serde(rename = "Label", default, skip_serializing_if = "Option::is_none")] + pub label: Option, + #[doc = "The number of seconds that we should allow the phone to ring before assuming there \ + is no answer. Can be an integer between `5` and `600`, inclusive. The default value \ + is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 \ + would result in an actual timeout that was closer to 15 seconds."] + #[serde(rename = "Timeout", default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[doc = "Whether to record the participant and their conferences, including the time between \ + conferences. Can be `true` or `false` and the default is `false`."] + #[serde(rename = "Record", default, skip_serializing_if = "Option::is_none")] + pub record: Option, + #[doc = "Whether the agent is muted in the conference. Can be `true` or `false` and the \ + default is `false`."] + #[serde(rename = "Muted", default, skip_serializing_if = "Option::is_none")] + pub muted: Option, + #[doc = "Whether to play a notification beep to the conference when the participant joins. \ + Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`."] + #[serde(rename = "Beep", default, skip_serializing_if = "Option::is_none")] + pub beep: Option, + #[doc = "Whether to start the conference when the participant joins, if it has not already \ + started. Can be: `true` or `false` and the default is `true`. If `false` and the \ + conference has not started, the participant is muted and hears background music \ + until another participant starts the conference."] + #[serde( + rename = "StartConferenceOnEnter", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_conference_on_enter: Option, + #[doc = "Whether to end the conference when the participant leaves. Can be: `true` or `false` \ + and defaults to `false`."] + #[serde( + rename = "EndConferenceOnExit", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_conference_on_exit: Option, + #[doc = "The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic)."] + #[serde(rename = "WaitUrl", default, skip_serializing_if = "Option::is_none")] + pub wait_url: Option, + #[doc = "The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the \ + default is `POST`. When using a static audio file, this should be `GET` so that we \ + can cache the file."] + #[serde( + rename = "WaitMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub wait_method: Option, + #[doc = "Whether to allow an agent to hear the state of the outbound call, including ringing \ + or disconnect messages. Can be: `true` or `false` and defaults to `true`."] + #[serde( + rename = "EarlyMedia", + default, + skip_serializing_if = "Option::is_none" + )] + pub early_media: Option, + #[doc = "The maximum number of participants in the conference. Can be a positive integer from \ + `2` to `250`. The default value is `250`."] + #[serde( + rename = "MaxParticipants", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_participants: Option, + #[doc = "Whether to record the conference the participant is joining. Can be: `true`, \ + `false`, `record-from-start`, and `do-not-record`. The default value is `false`."] + #[serde( + rename = "ConferenceRecord", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_record: Option, + #[doc = "Whether to trim leading and trailing silence from your recorded conference audio \ + files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`."] + #[serde( + rename = "ConferenceTrim", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_trim: Option, + #[doc = "The URL we should call using the `conference_status_callback_method` when the \ + conference events in `conference_status_callback_event` occur. Only the value set by \ + the first participant to join the conference is used. Subsequent \ + `conference_status_callback` values are ignored."] + #[serde( + rename = "ConferenceStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_status_callback: Option, + #[doc = "The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or \ + `POST` and defaults to `POST`."] + #[serde( + rename = "ConferenceStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_status_callback_method: Option, + #[doc = "The conference state changes that should generate a call to \ + `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, \ + `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a \ + space. Defaults to `start end`."] + #[serde( + rename = "ConferenceStatusCallbackEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_status_callback_event: Option>, + #[doc = "The recording channels for the final recording. Can be: `mono` or `dual` and the \ + default is `mono`."] + #[serde( + rename = "RecordingChannels", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_channels: Option, + #[doc = "The URL that we should call using the `recording_status_callback_method` when the \ + recording status changes."] + #[serde( + rename = "RecordingStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback: Option, + #[doc = "The HTTP method we should use when we call `recording_status_callback`. Can be: \ + `GET` or `POST` and defaults to `POST`."] + #[serde( + rename = "RecordingStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback_method: + Option, + #[doc = "The SIP username used for authentication."] + #[serde( + rename = "SipAuthUsername", + default, + skip_serializing_if = "Option::is_none" + )] + pub sip_auth_username: Option, + #[doc = "The SIP password for authentication."] + #[serde( + rename = "SipAuthPassword", + default, + skip_serializing_if = "Option::is_none" + )] + pub sip_auth_password: Option, + #[doc = "The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`."] + #[serde(rename = "Region", default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The URL we should call using the `conference_recording_status_callback_method` when \ + the conference recording is available."] + #[serde( + rename = "ConferenceRecordingStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_recording_status_callback: Option, + #[doc = "The HTTP method we should use to call `conference_recording_status_callback`. Can \ + be: `GET` or `POST` and defaults to `POST`."] + #[serde( + rename = "ConferenceRecordingStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_recording_status_callback_method: + Option, + #[doc = "The recording state changes that should generate a call to \ + `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, \ + `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a \ + space, ex: `'in-progress completed failed'`."] + #[serde( + rename = "RecordingStatusCallbackEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_status_callback_event: Option>, + #[doc = "The conference recording state changes that generate a call to \ + `conference_recording_status_callback`. Can be: `in-progress`, `completed`, \ + `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress \ + completed failed'`"] + #[serde( + rename = "ConferenceRecordingStatusCallbackEvent", + default, + skip_serializing_if = "Option::is_none" + )] + pub conference_recording_status_callback_event: Option>, + #[doc = "Whether the participant is coaching another call. Can be: `true` or `false`. If not \ + present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, \ + `call_sid_to_coach` must be defined."] + #[serde(rename = "Coaching", default, skip_serializing_if = "Option::is_none")] + pub coaching: Option, + #[doc = "The SID of the participant who is being `coached`. The participant being coached is \ + the only participant who can hear the participant who is `coaching`."] + #[serde( + rename = "CallSidToCoach", + default, + skip_serializing_if = "Option::is_none" + )] + pub call_sid_to_coach: Option, + #[doc = "Jitter buffer size for the connecting participant. Twilio will use this setting to \ + apply Jitter Buffer before participant's audio is mixed into the conference. Can be: \ + `off`, `small`, `medium`, and `large`. Default to `large`."] + #[serde( + rename = "JitterBufferSize", + default, + skip_serializing_if = "Option::is_none" + )] + pub jitter_buffer_size: Option, + #[doc = "The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that \ + `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. \ + (Beta)"] + #[serde(rename = "Byoc", default, skip_serializing_if = "Option::is_none")] + pub byoc: Option, + #[doc = "The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint."] + #[serde(rename = "CallerId", default, skip_serializing_if = "Option::is_none")] + pub caller_id: Option, + #[doc = "The Reason for the outgoing call. Use it to specify the purpose of the call that is \ + presented on the called party's phone. (Branded Calls Beta)"] + #[serde( + rename = "CallReason", + default, + skip_serializing_if = "Option::is_none" + )] + pub call_reason: Option, + #[doc = "The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The \ + default is `both`. `inbound` records the audio that is received by Twilio. \ + `outbound` records the audio that is sent from Twilio. `both` records the audio that \ + is received and sent by Twilio."] + #[serde( + rename = "RecordingTrack", + default, + skip_serializing_if = "Option::is_none" + )] + pub recording_track: Option, + #[doc = "The maximum duration of the call in seconds. Constraints depend on account and \ + configuration."] + #[serde(rename = "TimeLimit", default, skip_serializing_if = "Option::is_none")] + pub time_limit: Option, + #[doc = "Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection)."] + #[serde( + rename = "MachineDetection", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection: Option, + #[doc = "The number of seconds that we should attempt to detect an answering machine before \ + timing out and sending a voice request with `AnsweredBy` of `unknown`. The default \ + timeout is 30 seconds."] + #[serde( + rename = "MachineDetectionTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_timeout: Option, + #[doc = "The number of milliseconds that is used as the measuring stick for the length of the \ + speech activity, where durations lower than this value will be interpreted as a \ + human and longer than this value as a machine. Possible Values: 1000-6000. Default: \ + 2400."] + #[serde( + rename = "MachineDetectionSpeechThreshold", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_speech_threshold: Option, + #[doc = "The number of milliseconds of silence after speech activity at which point the \ + speech activity is considered complete. Possible Values: 500-5000. Default: 1200."] + #[serde( + rename = "MachineDetectionSpeechEndThreshold", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_speech_end_threshold: Option, + #[doc = "The number of milliseconds of initial silence after which an `unknown` AnsweredBy \ + result will be returned. Possible Values: 2000-10000. Default: 5000."] + #[serde( + rename = "MachineDetectionSilenceTimeout", + default, + skip_serializing_if = "Option::is_none" + )] + pub machine_detection_silence_timeout: Option, + #[doc = "The URL that we should call using the `amd_status_callback_method` to notify \ + customer application whether the call was answered by human, machine or fax."] + #[serde( + rename = "AmdStatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub amd_status_callback: Option, + #[doc = "The HTTP method we should use when calling the `amd_status_callback` URL. Can be: \ + `GET` or `POST` and the default is `POST`."] + #[serde( + rename = "AmdStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub amd_status_callback_method: Option, +} + +impl std::fmt::Display for CreateParticipantRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateParticipantRequest { + const LENGTH: usize = 46; + fn fields(&self) -> Vec> { + vec![ + self.from.clone().into(), + self.to.clone().into(), + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(status_callback_event) = &self.status_callback_event { + format!("{:?}", status_callback_event).into() + } else { + String::new().into() + }, + if let Some(label) = &self.label { + format!("{:?}", label).into() + } else { + String::new().into() + }, + if let Some(timeout) = &self.timeout { + format!("{:?}", timeout).into() + } else { + String::new().into() + }, + if let Some(record) = &self.record { + format!("{:?}", record).into() + } else { + String::new().into() + }, + if let Some(muted) = &self.muted { + format!("{:?}", muted).into() + } else { + String::new().into() + }, + if let Some(beep) = &self.beep { + format!("{:?}", beep).into() + } else { + String::new().into() + }, + if let Some(start_conference_on_enter) = &self.start_conference_on_enter { + format!("{:?}", start_conference_on_enter).into() + } else { + String::new().into() + }, + if let Some(end_conference_on_exit) = &self.end_conference_on_exit { + format!("{:?}", end_conference_on_exit).into() + } else { + String::new().into() + }, + if let Some(wait_url) = &self.wait_url { + format!("{:?}", wait_url).into() + } else { + String::new().into() + }, + if let Some(wait_method) = &self.wait_method { + format!("{:?}", wait_method).into() + } else { + String::new().into() + }, + if let Some(early_media) = &self.early_media { + format!("{:?}", early_media).into() + } else { + String::new().into() + }, + if let Some(max_participants) = &self.max_participants { + format!("{:?}", max_participants).into() + } else { + String::new().into() + }, + if let Some(conference_record) = &self.conference_record { + format!("{:?}", conference_record).into() + } else { + String::new().into() + }, + if let Some(conference_trim) = &self.conference_trim { + format!("{:?}", conference_trim).into() + } else { + String::new().into() + }, + if let Some(conference_status_callback) = &self.conference_status_callback { + format!("{:?}", conference_status_callback).into() + } else { + String::new().into() + }, + if let Some(conference_status_callback_method) = &self.conference_status_callback_method + { + format!("{:?}", conference_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(conference_status_callback_event) = &self.conference_status_callback_event { + format!("{:?}", conference_status_callback_event).into() + } else { + String::new().into() + }, + if let Some(recording_channels) = &self.recording_channels { + format!("{:?}", recording_channels).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback) = &self.recording_status_callback { + format!("{:?}", recording_status_callback).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback_method) = &self.recording_status_callback_method { + format!("{:?}", recording_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(sip_auth_username) = &self.sip_auth_username { + format!("{:?}", sip_auth_username).into() + } else { + String::new().into() + }, + if let Some(sip_auth_password) = &self.sip_auth_password { + format!("{:?}", sip_auth_password).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(conference_recording_status_callback) = + &self.conference_recording_status_callback + { + format!("{:?}", conference_recording_status_callback).into() + } else { + String::new().into() + }, + if let Some(conference_recording_status_callback_method) = + &self.conference_recording_status_callback_method + { + format!("{:?}", conference_recording_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(recording_status_callback_event) = &self.recording_status_callback_event { + format!("{:?}", recording_status_callback_event).into() + } else { + String::new().into() + }, + if let Some(conference_recording_status_callback_event) = + &self.conference_recording_status_callback_event + { + format!("{:?}", conference_recording_status_callback_event).into() + } else { + String::new().into() + }, + if let Some(coaching) = &self.coaching { + format!("{:?}", coaching).into() + } else { + String::new().into() + }, + if let Some(call_sid_to_coach) = &self.call_sid_to_coach { + format!("{:?}", call_sid_to_coach).into() + } else { + String::new().into() + }, + if let Some(jitter_buffer_size) = &self.jitter_buffer_size { + format!("{:?}", jitter_buffer_size).into() + } else { + String::new().into() + }, + if let Some(byoc) = &self.byoc { + format!("{:?}", byoc).into() + } else { + String::new().into() + }, + if let Some(caller_id) = &self.caller_id { + format!("{:?}", caller_id).into() + } else { + String::new().into() + }, + if let Some(call_reason) = &self.call_reason { + format!("{:?}", call_reason).into() + } else { + String::new().into() + }, + if let Some(recording_track) = &self.recording_track { + format!("{:?}", recording_track).into() + } else { + String::new().into() + }, + if let Some(time_limit) = &self.time_limit { + format!("{:?}", time_limit).into() + } else { + String::new().into() + }, + if let Some(machine_detection) = &self.machine_detection { + format!("{:?}", machine_detection).into() + } else { + String::new().into() + }, + if let Some(machine_detection_timeout) = &self.machine_detection_timeout { + format!("{:?}", machine_detection_timeout).into() + } else { + String::new().into() + }, + if let Some(machine_detection_speech_threshold) = + &self.machine_detection_speech_threshold + { + format!("{:?}", machine_detection_speech_threshold).into() + } else { + String::new().into() + }, + if let Some(machine_detection_speech_end_threshold) = + &self.machine_detection_speech_end_threshold + { + format!("{:?}", machine_detection_speech_end_threshold).into() + } else { + String::new().into() + }, + if let Some(machine_detection_silence_timeout) = &self.machine_detection_silence_timeout + { + format!("{:?}", machine_detection_silence_timeout).into() + } else { + String::new().into() + }, + if let Some(amd_status_callback) = &self.amd_status_callback { + format!("{:?}", amd_status_callback).into() + } else { + String::new().into() + }, + if let Some(amd_status_callback_method) = &self.amd_status_callback_method { + format!("{:?}", amd_status_callback_method).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "from".into(), + "to".into(), + "status_callback".into(), + "status_callback_method".into(), + "status_callback_event".into(), + "label".into(), + "timeout".into(), + "record".into(), + "muted".into(), + "beep".into(), + "start_conference_on_enter".into(), + "end_conference_on_exit".into(), + "wait_url".into(), + "wait_method".into(), + "early_media".into(), + "max_participants".into(), + "conference_record".into(), + "conference_trim".into(), + "conference_status_callback".into(), + "conference_status_callback_method".into(), + "conference_status_callback_event".into(), + "recording_channels".into(), + "recording_status_callback".into(), + "recording_status_callback_method".into(), + "sip_auth_username".into(), + "sip_auth_password".into(), + "region".into(), + "conference_recording_status_callback".into(), + "conference_recording_status_callback_method".into(), + "recording_status_callback_event".into(), + "conference_recording_status_callback_event".into(), + "coaching".into(), + "call_sid_to_coach".into(), + "jitter_buffer_size".into(), + "byoc".into(), + "caller_id".into(), + "call_reason".into(), + "recording_track".into(), + "time_limit".into(), + "machine_detection".into(), + "machine_detection_timeout".into(), + "machine_detection_speech_threshold".into(), + "machine_detection_speech_end_threshold".into(), + "machine_detection_silence_timeout".into(), + "amd_status_callback".into(), + "amd_status_callback_method".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreatePaymentsRequest { + #[doc = "A unique token that will be used to ensure that multiple API calls with the same \ + information do not result in multiple transactions. This should be a unique string \ + value per API call and can be a randomly generated."] + #[serde(rename = "IdempotencyKey")] + pub idempotency_key: String, + #[doc = "Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback)"] + #[serde(rename = "StatusCallback")] + pub status_callback: String, + #[serde( + rename = "BankAccountType", + default, + skip_serializing_if = "Option::is_none" + )] + pub bank_account_type: Option, + #[doc = "A positive decimal value less than 1,000,000 to charge against the credit card or \ + bank account. Default currency can be overwritten with `currency` field. Leave blank \ + or set to 0 to tokenize."] + #[serde( + rename = "ChargeAmount", + default, + skip_serializing_if = "Option::is_none" + )] + pub charge_amount: Option, + #[doc = "The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted."] + #[serde(rename = "Currency", default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[doc = "The description can be used to provide more details regarding the transaction. This \ + information is submitted along with the payment details to the Payment Connector \ + which are then posted on the transactions."] + #[serde( + rename = "Description", + default, + skip_serializing_if = "Option::is_none" + )] + pub description: Option, + #[doc = "A list of inputs that should be accepted. Currently only `dtmf` is supported. All \ + digits captured during a pay session are redacted from the logs."] + #[serde(rename = "Input", default, skip_serializing_if = "Option::is_none")] + pub input: Option, + #[doc = "A positive integer that is used to validate the length of the `PostalCode` inputted \ + by the user. User must enter this many digits."] + #[serde( + rename = "MinPostalCodeLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub min_postal_code_length: Option, + #[doc = "A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors)."] + #[serde(rename = "Parameter", default, skip_serializing_if = "Option::is_none")] + pub parameter: Option, + #[doc = "This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`."] + #[serde( + rename = "PaymentConnector", + default, + skip_serializing_if = "Option::is_none" + )] + pub payment_connector: Option, + #[serde( + rename = "PaymentMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub payment_method: Option, + #[doc = "Indicates whether the credit card postal code (zip code) is a required piece of \ + payment information that must be provided by the caller. The default is `true`."] + #[serde( + rename = "PostalCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub postal_code: Option, + #[doc = "Indicates whether the credit card security code is a required piece of payment \ + information that must be provided by the caller. The default is `true`."] + #[serde( + rename = "SecurityCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub security_code: Option, + #[doc = "The number of seconds that should wait for the caller to press a digit between \ + each subsequent digit, after the first one, before moving on to validate the digits \ + captured. The default is `5`, maximum is `600`."] + #[serde(rename = "Timeout", default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "TokenType", default, skip_serializing_if = "Option::is_none")] + pub token_type: Option, + #[doc = "Credit card types separated by space that Pay should accept. The default value is \ + `visa mastercard amex`"] + #[serde( + rename = "ValidCardTypes", + default, + skip_serializing_if = "Option::is_none" + )] + pub valid_card_types: Option, +} + +impl std::fmt::Display for CreatePaymentsRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreatePaymentsRequest { + const LENGTH: usize = 16; + fn fields(&self) -> Vec> { + vec![ + self.idempotency_key.clone().into(), + self.status_callback.clone().into(), + if let Some(bank_account_type) = &self.bank_account_type { + format!("{:?}", bank_account_type).into() + } else { + String::new().into() + }, + if let Some(charge_amount) = &self.charge_amount { + format!("{:?}", charge_amount).into() + } else { + String::new().into() + }, + if let Some(currency) = &self.currency { + format!("{:?}", currency).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(input) = &self.input { + format!("{:?}", input).into() + } else { + String::new().into() + }, + if let Some(min_postal_code_length) = &self.min_postal_code_length { + format!("{:?}", min_postal_code_length).into() + } else { + String::new().into() + }, + if let Some(parameter) = &self.parameter { + format!("{:?}", parameter).into() + } else { + String::new().into() + }, + if let Some(payment_connector) = &self.payment_connector { + format!("{:?}", payment_connector).into() + } else { + String::new().into() + }, + if let Some(payment_method) = &self.payment_method { + format!("{:?}", payment_method).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(security_code) = &self.security_code { + format!("{:?}", security_code).into() + } else { + String::new().into() + }, + if let Some(timeout) = &self.timeout { + format!("{:?}", timeout).into() + } else { + String::new().into() + }, + if let Some(token_type) = &self.token_type { + format!("{:?}", token_type).into() + } else { + String::new().into() + }, + if let Some(valid_card_types) = &self.valid_card_types { + format!("{:?}", valid_card_types).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "idempotency_key".into(), + "status_callback".into(), + "bank_account_type".into(), + "charge_amount".into(), + "currency".into(), + "description".into(), + "input".into(), + "min_postal_code_length".into(), + "parameter".into(), + "payment_connector".into(), + "payment_method".into(), + "postal_code".into(), + "security_code".into(), + "timeout".into(), + "token_type".into(), + "valid_card_types".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdatePaymentsRequest { + #[doc = "A unique token that will be used to ensure that multiple API calls with the same \ + information do not result in multiple transactions. This should be a unique string \ + value per API call and can be a randomly generated."] + #[serde(rename = "IdempotencyKey")] + pub idempotency_key: String, + #[doc = "Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests."] + #[serde(rename = "StatusCallback")] + pub status_callback: String, + #[serde(rename = "Capture", default, skip_serializing_if = "Option::is_none")] + pub capture: Option, + #[serde(rename = "Status", default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl std::fmt::Display for UpdatePaymentsRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdatePaymentsRequest { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + self.idempotency_key.clone().into(), + self.status_callback.clone().into(), + if let Some(capture) = &self.capture { + format!("{:?}", capture).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "idempotency_key".into(), + "status_callback".into(), + "capture".into(), + "status".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateQueueRequest { + #[doc = "A descriptive string that you created to describe this resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The maximum number of calls allowed to be in the queue. The default is 100. The \ + maximum is 5000."] + #[serde(rename = "MaxSize", default, skip_serializing_if = "Option::is_none")] + pub max_size: Option, +} + +impl std::fmt::Display for UpdateQueueRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateQueueRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(max_size) = &self.max_size { + format!("{:?}", max_size).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["friendly_name".into(), "max_size".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListQueueResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queues: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListQueueResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListQueueResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(queues) = &self.queues { + format!("{:?}", queues).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "queues".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateQueueRequest { + #[doc = "A descriptive string that you created to describe this resource. It can be up to 64 \ + characters long."] + #[serde(rename = "FriendlyName")] + pub friendly_name: String, + #[doc = "The maximum number of calls allowed to be in the queue. The default is 100. The \ + maximum is 5000."] + #[serde(rename = "MaxSize", default, skip_serializing_if = "Option::is_none")] + pub max_size: Option, +} + +impl std::fmt::Display for CreateQueueRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateQueueRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.friendly_name.clone().into(), + if let Some(max_size) = &self.max_size { + format!("{:?}", max_size).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["friendly_name".into(), "max_size".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListRecordingResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recordings: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListRecordingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListRecordingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(recordings) = &self.recordings { + format!("{:?}", recordings).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "recordings".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListRecordingAddOnResultResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub add_on_results: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListRecordingAddOnResultResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListRecordingAddOnResultResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(add_on_results) = &self.add_on_results { + format!("{:?}", add_on_results).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "add_on_results".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListRecordingAddOnResultPayloadResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payloads: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListRecordingAddOnResultPayloadResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListRecordingAddOnResultPayloadResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(payloads) = &self.payloads { + format!("{:?}", payloads).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "payloads".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListRecordingTranscriptionResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub transcriptions: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListRecordingTranscriptionResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListRecordingTranscriptionResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(transcriptions) = &self.transcriptions { + format!("{:?}", transcriptions).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "transcriptions".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateShortCodeRequestSmsMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or \ + `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateShortCodeRequestSmsFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateShortCodeRequest { + #[doc = "A descriptive string that you created to describe this resource. It can be up to 64 \ + characters long. By default, the `FriendlyName` is the short code."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The API version to use to start a new TwiML session. Can be: `2010-04-01` or \ + `2008-08-01`."] + #[serde( + rename = "ApiVersion", + default, + skip_serializing_if = "Option::is_none" + )] + pub api_version: Option, + #[doc = "The URL we should call when receiving an incoming SMS message to this short code."] + #[serde(rename = "SmsUrl", default, skip_serializing_if = "Option::is_none")] + pub sms_url: Option, + #[doc = "The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`."] + #[serde(rename = "SmsMethod", default, skip_serializing_if = "Option::is_none")] + pub sms_method: Option, + #[doc = "The URL that we should call if an error occurs while retrieving or executing the \ + TwiML from `sms_url`."] + #[serde( + rename = "SmsFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_url: Option, + #[doc = "The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or \ + `POST`."] + #[serde( + rename = "SmsFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub sms_fallback_method: Option, +} + +impl std::fmt::Display for UpdateShortCodeRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateShortCodeRequest { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(api_version) = &self.api_version { + format!("{:?}", api_version).into() + } else { + String::new().into() + }, + if let Some(sms_url) = &self.sms_url { + format!("{:?}", sms_url).into() + } else { + String::new().into() + }, + if let Some(sms_method) = &self.sms_method { + format!("{:?}", sms_method).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_url) = &self.sms_fallback_url { + format!("{:?}", sms_fallback_url).into() + } else { + String::new().into() + }, + if let Some(sms_fallback_method) = &self.sms_fallback_method { + format!("{:?}", sms_fallback_method).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "api_version".into(), + "sms_url".into(), + "sms_method".into(), + "sms_fallback_url".into(), + "sms_fallback_method".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListShortCodeResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub short_codes: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListShortCodeResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListShortCodeResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(short_codes) = &self.short_codes { + format!("{:?}", short_codes).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "short_codes".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateSigningKeyRequest { + #[doc = ""] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, +} + +impl std::fmt::Display for UpdateSigningKeyRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateSigningKeyRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipAuthCallsCredentialListMappingResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contents: Option< + Vec, + >, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipAuthCallsCredentialListMappingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipAuthCallsCredentialListMappingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(contents) = &self.contents { + format!("{:?}", contents).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "contents".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipAuthCallsCredentialListMappingRequest { + #[doc = "The SID of the CredentialList resource to map to the SIP domain."] + #[serde(rename = "CredentialListSid")] + pub credential_list_sid: String, +} + +impl std::fmt::Display for CreateSipAuthCallsCredentialListMappingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipAuthCallsCredentialListMappingRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.credential_list_sid.clone().into()] + } + + fn headers() -> Vec> { + vec!["credential_list_sid".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipAuthCallsIpAccessControlListMappingResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contents: Option< + Vec, + >, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipAuthCallsIpAccessControlListMappingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipAuthCallsIpAccessControlListMappingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(contents) = &self.contents { + format!("{:?}", contents).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "contents".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipAuthCallsIpAccessControlListMappingRequest { + #[doc = "The SID of the IpAccessControlList resource to map to the SIP domain."] + #[serde(rename = "IpAccessControlListSid")] + pub ip_access_control_list_sid: String, +} + +impl std::fmt::Display for CreateSipAuthCallsIpAccessControlListMappingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipAuthCallsIpAccessControlListMappingRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.ip_access_control_list_sid.clone().into()] + } + + fn headers() -> Vec> { + vec!["ip_access_control_list_sid".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipAuthRegistrationsCredentialListMappingResponse { # [serde (default , skip_serializing_if = "Option::is_none")] pub contents : Option < Vec < ApiV2010AccountSipSipDomainSipAuthSipAuthRegistrationsSipAuthRegistrationsCredentialListMapping > > , # [serde (default , skip_serializing_if = "Option::is_none")] pub end : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub first_page_uri : Option < String > , # [serde (default , skip_serializing_if = "Option::is_none")] pub next_page_uri : Option < String > , # [serde (default , skip_serializing_if = "Option::is_none")] pub page : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub page_size : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub previous_page_uri : Option < String > , # [serde (default , skip_serializing_if = "Option::is_none")] pub start : Option < i64 > , # [serde (default , skip_serializing_if = "Option::is_none")] pub uri : Option < String > , } + +impl std::fmt::Display for ListSipAuthRegistrationsCredentialListMappingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipAuthRegistrationsCredentialListMappingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(contents) = &self.contents { + format!("{:?}", contents).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "contents".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipAuthRegistrationsCredentialListMappingRequest { + #[doc = "The SID of the CredentialList resource to map to the SIP domain."] + #[serde(rename = "CredentialListSid")] + pub credential_list_sid: String, +} + +impl std::fmt::Display for CreateSipAuthRegistrationsCredentialListMappingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipAuthRegistrationsCredentialListMappingRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.credential_list_sid.clone().into()] + } + + fn headers() -> Vec> { + vec!["credential_list_sid".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipCredentialResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipCredentialResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipCredentialResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(credentials) = &self.credentials { + format!("{:?}", credentials).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "credentials".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipCredentialRequest { + #[doc = "The username that will be passed when authenticating SIP requests. The username \ + should be sent in response to Twilio's challenge of the initial INVITE. It can be up \ + to 32 characters long."] + #[serde(rename = "Username")] + pub username: String, + #[doc = "The password that the username will use when authenticating SIP requests. The \ + password must be a minimum of 12 characters, contain at least 1 digit, and have \ + mixed case. (eg `IWasAtSignal2018`)"] + #[serde(rename = "Password")] + pub password: String, +} + +impl std::fmt::Display for CreateSipCredentialRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipCredentialRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![self.username.clone().into(), self.password.clone().into()] + } + + fn headers() -> Vec> { + vec!["username".into(), "password".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateSipCredentialRequest { + #[doc = "The password that the username will use when authenticating SIP requests. The \ + password must be a minimum of 12 characters, contain at least 1 digit, and have \ + mixed case. (eg `IWasAtSignal2018`)"] + #[serde(rename = "Password", default, skip_serializing_if = "Option::is_none")] + pub password: Option, +} + +impl std::fmt::Display for UpdateSipCredentialRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateSipCredentialRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(password) = &self.password { + format!("{:?}", password).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["password".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipCredentialListResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credential_lists: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipCredentialListResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipCredentialListResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(credential_lists) = &self.credential_lists { + format!("{:?}", credential_lists).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "credential_lists".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipCredentialListRequest { + #[doc = "A human readable descriptive text that describes the CredentialList, up to 64 \ + characters long."] + #[serde(rename = "FriendlyName")] + pub friendly_name: String, +} + +impl std::fmt::Display for CreateSipCredentialListRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipCredentialListRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.friendly_name.clone().into()] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateSipCredentialListRequest { + #[doc = "A human readable descriptive text for a CredentialList, up to 64 characters long."] + #[serde(rename = "FriendlyName")] + pub friendly_name: String, +} + +impl std::fmt::Display for UpdateSipCredentialListRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateSipCredentialListRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.friendly_name.clone().into()] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipCredentialListMappingResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credential_list_mappings: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipCredentialListMappingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipCredentialListMappingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(credential_list_mappings) = &self.credential_list_mappings { + format!("{:?}", credential_list_mappings).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "credential_list_mappings".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipCredentialListMappingRequest { + #[doc = "A 34 character string that uniquely identifies the CredentialList resource to map to \ + the SIP domain."] + #[serde(rename = "CredentialListSid")] + pub credential_list_sid: String, +} + +impl std::fmt::Display for CreateSipCredentialListMappingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipCredentialListMappingRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.credential_list_sid.clone().into()] + } + + fn headers() -> Vec> { + vec!["credential_list_sid".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipDomainResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domains: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipDomainResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipDomainResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(domains) = &self.domains { + format!("{:?}", domains).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "domains".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateSipDomainRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateSipDomainRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or \ + `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateSipDomainRequestVoiceStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipDomainRequest { + #[doc = "The unique address you reserve on Twilio to which you route your SIP traffic. Domain \ + names can contain letters, digits, and \"-\" and must end with `sip.twilio.com`."] + #[serde(rename = "DomainName")] + pub domain_name: String, + #[doc = "A descriptive string that you created to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The URL we should when the domain receives a call."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The URL that we should call when an error occurs while retrieving or executing the \ + TwiML from `voice_url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL that we should call to pass status parameters (such as call ended) to your \ + application."] + #[serde( + rename = "VoiceStatusCallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_status_callback_url: Option, + #[doc = "The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or \ + `POST`."] + #[serde( + rename = "VoiceStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_status_callback_method: Option, + #[doc = "Whether to allow SIP Endpoints to register with the domain to receive calls. Can be \ + `true` or `false`. `true` allows SIP Endpoints to register with the domain to \ + receive calls, `false` does not."] + #[serde( + rename = "SipRegistration", + default, + skip_serializing_if = "Option::is_none" + )] + pub sip_registration: Option, + #[doc = "Whether emergency calling is enabled for the domain. If enabled, allows emergency \ + calls on the domain from phone numbers with validated addresses."] + #[serde( + rename = "EmergencyCallingEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_calling_enabled: Option, + #[doc = "Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and \ + SRTP will be negotiated on all incoming calls to this sip domain."] + #[serde(rename = "Secure", default, skip_serializing_if = "Option::is_none")] + pub secure: Option, + #[doc = "The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will \ + be associated with."] + #[serde( + rename = "ByocTrunkSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub byoc_trunk_sid: Option, + #[doc = "Whether an emergency caller sid is configured for the domain. If present, this phone \ + number will be used as the callback for the emergency call."] + #[serde( + rename = "EmergencyCallerSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_caller_sid: Option, +} + +impl std::fmt::Display for CreateSipDomainRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipDomainRequest { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + self.domain_name.clone().into(), + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_status_callback_url) = &self.voice_status_callback_url { + format!("{:?}", voice_status_callback_url).into() + } else { + String::new().into() + }, + if let Some(voice_status_callback_method) = &self.voice_status_callback_method { + format!("{:?}", voice_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(sip_registration) = &self.sip_registration { + format!("{:?}", sip_registration).into() + } else { + String::new().into() + }, + if let Some(emergency_calling_enabled) = &self.emergency_calling_enabled { + format!("{:?}", emergency_calling_enabled).into() + } else { + String::new().into() + }, + if let Some(secure) = &self.secure { + format!("{:?}", secure).into() + } else { + String::new().into() + }, + if let Some(byoc_trunk_sid) = &self.byoc_trunk_sid { + format!("{:?}", byoc_trunk_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_caller_sid) = &self.emergency_caller_sid { + format!("{:?}", emergency_caller_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "domain_name".into(), + "friendly_name".into(), + "voice_url".into(), + "voice_method".into(), + "voice_fallback_url".into(), + "voice_fallback_method".into(), + "voice_status_callback_url".into(), + "voice_status_callback_method".into(), + "sip_registration".into(), + "emergency_calling_enabled".into(), + "secure".into(), + "byoc_trunk_sid".into(), + "emergency_caller_sid".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateSipDomainRequestVoiceFallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `voice_url`"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateSipDomainRequestVoiceMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[doc = "The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or \ + `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateSipDomainRequestVoiceStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateSipDomainRequest { + #[doc = "A descriptive string that you created to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."] + #[serde( + rename = "VoiceFallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_method: Option, + #[doc = "The URL that we should call when an error occurs while retrieving or executing the \ + TwiML requested by `voice_url`."] + #[serde( + rename = "VoiceFallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_fallback_url: Option, + #[doc = "The HTTP method we should use to call `voice_url`"] + #[serde( + rename = "VoiceMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_method: Option, + #[doc = "The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or \ + `POST`."] + #[serde( + rename = "VoiceStatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_status_callback_method: Option, + #[doc = "The URL that we should call to pass status parameters (such as call ended) to your \ + application."] + #[serde( + rename = "VoiceStatusCallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub voice_status_callback_url: Option, + #[doc = "The URL we should call when the domain receives a call."] + #[serde(rename = "VoiceUrl", default, skip_serializing_if = "Option::is_none")] + pub voice_url: Option, + #[doc = "Whether to allow SIP Endpoints to register with the domain to receive calls. Can be \ + `true` or `false`. `true` allows SIP Endpoints to register with the domain to \ + receive calls, `false` does not."] + #[serde( + rename = "SipRegistration", + default, + skip_serializing_if = "Option::is_none" + )] + pub sip_registration: Option, + #[doc = "The unique address you reserve on Twilio to which you route your SIP traffic. Domain \ + names can contain letters, digits, and \"-\" and must end with `sip.twilio.com`."] + #[serde( + rename = "DomainName", + default, + skip_serializing_if = "Option::is_none" + )] + pub domain_name: Option, + #[doc = "Whether emergency calling is enabled for the domain. If enabled, allows emergency \ + calls on the domain from phone numbers with validated addresses."] + #[serde( + rename = "EmergencyCallingEnabled", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_calling_enabled: Option, + #[doc = "Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and \ + SRTP will be negotiated on all incoming calls to this sip domain."] + #[serde(rename = "Secure", default, skip_serializing_if = "Option::is_none")] + pub secure: Option, + #[doc = "The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will \ + be associated with."] + #[serde( + rename = "ByocTrunkSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub byoc_trunk_sid: Option, + #[doc = "Whether an emergency caller sid is configured for the domain. If present, this phone \ + number will be used as the callback for the emergency call."] + #[serde( + rename = "EmergencyCallerSid", + default, + skip_serializing_if = "Option::is_none" + )] + pub emergency_caller_sid: Option, +} + +impl std::fmt::Display for UpdateSipDomainRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateSipDomainRequest { + const LENGTH: usize = 13; + fn fields(&self) -> Vec> { + vec![ + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_method) = &self.voice_fallback_method { + format!("{:?}", voice_fallback_method).into() + } else { + String::new().into() + }, + if let Some(voice_fallback_url) = &self.voice_fallback_url { + format!("{:?}", voice_fallback_url).into() + } else { + String::new().into() + }, + if let Some(voice_method) = &self.voice_method { + format!("{:?}", voice_method).into() + } else { + String::new().into() + }, + if let Some(voice_status_callback_method) = &self.voice_status_callback_method { + format!("{:?}", voice_status_callback_method).into() + } else { + String::new().into() + }, + if let Some(voice_status_callback_url) = &self.voice_status_callback_url { + format!("{:?}", voice_status_callback_url).into() + } else { + String::new().into() + }, + if let Some(voice_url) = &self.voice_url { + format!("{:?}", voice_url).into() + } else { + String::new().into() + }, + if let Some(sip_registration) = &self.sip_registration { + format!("{:?}", sip_registration).into() + } else { + String::new().into() + }, + if let Some(domain_name) = &self.domain_name { + format!("{:?}", domain_name).into() + } else { + String::new().into() + }, + if let Some(emergency_calling_enabled) = &self.emergency_calling_enabled { + format!("{:?}", emergency_calling_enabled).into() + } else { + String::new().into() + }, + if let Some(secure) = &self.secure { + format!("{:?}", secure).into() + } else { + String::new().into() + }, + if let Some(byoc_trunk_sid) = &self.byoc_trunk_sid { + format!("{:?}", byoc_trunk_sid).into() + } else { + String::new().into() + }, + if let Some(emergency_caller_sid) = &self.emergency_caller_sid { + format!("{:?}", emergency_caller_sid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "voice_fallback_method".into(), + "voice_fallback_url".into(), + "voice_method".into(), + "voice_status_callback_method".into(), + "voice_status_callback_url".into(), + "voice_url".into(), + "sip_registration".into(), + "domain_name".into(), + "emergency_calling_enabled".into(), + "secure".into(), + "byoc_trunk_sid".into(), + "emergency_caller_sid".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipIpAccessControlListResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip_access_control_lists: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipIpAccessControlListResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipIpAccessControlListResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(ip_access_control_lists) = &self.ip_access_control_lists { + format!("{:?}", ip_access_control_lists).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "ip_access_control_lists".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipIpAccessControlListRequest { + #[doc = "A human readable descriptive text that describes the IpAccessControlList, up to 255 \ + characters long."] + #[serde(rename = "FriendlyName")] + pub friendly_name: String, +} + +impl std::fmt::Display for CreateSipIpAccessControlListRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipIpAccessControlListRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.friendly_name.clone().into()] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateSipIpAccessControlListRequest { + #[doc = "A human readable descriptive text, up to 255 characters long."] + #[serde(rename = "FriendlyName")] + pub friendly_name: String, +} + +impl std::fmt::Display for UpdateSipIpAccessControlListRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateSipIpAccessControlListRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.friendly_name.clone().into()] + } + + fn headers() -> Vec> { + vec!["friendly_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipIpAccessControlListMappingResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip_access_control_list_mappings: + Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipIpAccessControlListMappingResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipIpAccessControlListMappingResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(ip_access_control_list_mappings) = &self.ip_access_control_list_mappings { + format!("{:?}", ip_access_control_list_mappings).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "ip_access_control_list_mappings".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipIpAccessControlListMappingRequest { + #[doc = "The unique id of the IP access control list to map to the SIP domain."] + #[serde(rename = "IpAccessControlListSid")] + pub ip_access_control_list_sid: String, +} + +impl std::fmt::Display for CreateSipIpAccessControlListMappingRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipIpAccessControlListMappingRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.ip_access_control_list_sid.clone().into()] + } + + fn headers() -> Vec> { + vec!["ip_access_control_list_sid".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListSipIpAddressResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip_addresses: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListSipIpAddressResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListSipIpAddressResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(ip_addresses) = &self.ip_addresses { + format!("{:?}", ip_addresses).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "ip_addresses".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSipIpAddressRequest { + #[doc = "A human readable descriptive text for this resource, up to 255 characters long."] + #[serde(rename = "FriendlyName")] + pub friendly_name: String, + #[doc = "An IP address in dotted decimal notation from which you want to accept traffic. Any \ + SIP requests from this IP address will be allowed by Twilio. IPv4 only supported \ + today."] + #[serde(rename = "IpAddress")] + pub ip_address: String, + #[doc = "An integer representing the length of the CIDR prefix to use with this IP address \ + when accepting traffic. By default the entire IP address is used."] + #[serde( + rename = "CidrPrefixLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub cidr_prefix_length: Option, +} + +impl std::fmt::Display for CreateSipIpAddressRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSipIpAddressRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + self.friendly_name.clone().into(), + self.ip_address.clone().into(), + if let Some(cidr_prefix_length) = &self.cidr_prefix_length { + format!("{:?}", cidr_prefix_length).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "friendly_name".into(), + "ip_address".into(), + "cidr_prefix_length".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateSipIpAddressRequest { + #[doc = "An IP address in dotted decimal notation from which you want to accept traffic. Any \ + SIP requests from this IP address will be allowed by Twilio. IPv4 only supported \ + today."] + #[serde(rename = "IpAddress", default, skip_serializing_if = "Option::is_none")] + pub ip_address: Option, + #[doc = "A human readable descriptive text for this resource, up to 255 characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[doc = "An integer representing the length of the CIDR prefix to use with this IP address \ + when accepting traffic. By default the entire IP address is used."] + #[serde( + rename = "CidrPrefixLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub cidr_prefix_length: Option, +} + +impl std::fmt::Display for UpdateSipIpAddressRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateSipIpAddressRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(ip_address) = &self.ip_address { + format!("{:?}", ip_address).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(cidr_prefix_length) = &self.cidr_prefix_length { + format!("{:?}", cidr_prefix_length).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "ip_address".into(), + "friendly_name".into(), + "cidr_prefix_length".into(), + ] + } +} + +#[doc = "The http method for the status_callback (one of GET, POST)."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateSiprecRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateSiprecRequest { + #[doc = "The user-specified name of this Siprec, if one was given when the Siprec was \ + created. This may be used to stop the Siprec."] + #[serde(rename = "Name", default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Unique name used when configuring the connector via Marketplace Add-on."] + #[serde( + rename = "ConnectorName", + default, + skip_serializing_if = "Option::is_none" + )] + pub connector_name: Option, + #[serde(rename = "Track", default, skip_serializing_if = "Option::is_none")] + pub track: Option, + #[doc = "Absolute URL of the status callback."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The http method for the status_callback (one of GET, POST)."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter1.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_1_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter1.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_1_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter2.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_2_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter2.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_2_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter3.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_3_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter3.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_3_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter4.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_4_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter4.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_4_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter5.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_5_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter5.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_5_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter6.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_6_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter6.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_6_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter7.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_7_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter7.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_7_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter8.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_8_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter8.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_8_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter9.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_9_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter9.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_9_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter10.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_10_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter10.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_10_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter11.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_11_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter11.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_11_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter12.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_12_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter12.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_12_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter13.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_13_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter13.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_13_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter14.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_14_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter14.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_14_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter15.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_15_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter15.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_15_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter16.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_16_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter16.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_16_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter17.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_17_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter17.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_17_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter18.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_18_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter18.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_18_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter19.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_19_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter19.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_19_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter20.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_20_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter20.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_20_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter21.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_21_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter21.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_21_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter22.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_22_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter22.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_22_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter23.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_23_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter23.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_23_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter24.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_24_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter24.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_24_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter25.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_25_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter25.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_25_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter26.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_26_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter26.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_26_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter27.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_27_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter27.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_27_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter28.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_28_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter28.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_28_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter29.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_29_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter29.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_29_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter30.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_30_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter30.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_30_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter31.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_31_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter31.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_31_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter32.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_32_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter32.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_32_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter33.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_33_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter33.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_33_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter34.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_34_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter34.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_34_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter35.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_35_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter35.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_35_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter36.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_36_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter36.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_36_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter37.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_37_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter37.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_37_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter38.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_38_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter38.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_38_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter39.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_39_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter39.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_39_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter40.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_40_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter40.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_40_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter41.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_41_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter41.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_41_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter42.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_42_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter42.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_42_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter43.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_43_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter43.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_43_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter44.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_44_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter44.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_44_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter45.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_45_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter45.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_45_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter46.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_46_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter46.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_46_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter47.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_47_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter47.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_47_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter48.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_48_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter48.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_48_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter49.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_49_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter49.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_49_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter50.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_50_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter50.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_50_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter51.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_51_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter51.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_51_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter52.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_52_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter52.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_52_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter53.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_53_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter53.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_53_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter54.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_54_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter54.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_54_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter55.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_55_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter55.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_55_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter56.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_56_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter56.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_56_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter57.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_57_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter57.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_57_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter58.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_58_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter58.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_58_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter59.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_59_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter59.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_59_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter60.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_60_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter60.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_60_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter61.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_61_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter61.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_61_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter62.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_62_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter62.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_62_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter63.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_63_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter63.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_63_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter64.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_64_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter64.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_64_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter65.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_65_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter65.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_65_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter66.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_66_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter66.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_66_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter67.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_67_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter67.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_67_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter68.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_68_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter68.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_68_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter69.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_69_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter69.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_69_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter70.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_70_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter70.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_70_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter71.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_71_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter71.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_71_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter72.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_72_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter72.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_72_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter73.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_73_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter73.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_73_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter74.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_74_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter74.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_74_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter75.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_75_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter75.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_75_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter76.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_76_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter76.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_76_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter77.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_77_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter77.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_77_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter78.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_78_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter78.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_78_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter79.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_79_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter79.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_79_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter80.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_80_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter80.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_80_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter81.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_81_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter81.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_81_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter82.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_82_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter82.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_82_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter83.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_83_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter83.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_83_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter84.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_84_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter84.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_84_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter85.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_85_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter85.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_85_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter86.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_86_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter86.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_86_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter87.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_87_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter87.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_87_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter88.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_88_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter88.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_88_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter89.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_89_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter89.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_89_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter90.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_90_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter90.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_90_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter91.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_91_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter91.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_91_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter92.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_92_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter92.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_92_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter93.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_93_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter93.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_93_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter94.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_94_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter94.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_94_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter95.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_95_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter95.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_95_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter96.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_96_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter96.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_96_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter97.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_97_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter97.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_97_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter98.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_98_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter98.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_98_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter99.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_99_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter99.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_99_value: Option, +} + +impl std::fmt::Display for CreateSiprecRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateSiprecRequest { + const LENGTH: usize = 203; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(connector_name) = &self.connector_name { + format!("{:?}", connector_name).into() + } else { + String::new().into() + }, + if let Some(track) = &self.track { + format!("{:?}", track).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(parameter_1_name) = &self.parameter_1_name { + format!("{:?}", parameter_1_name).into() + } else { + String::new().into() + }, + if let Some(parameter_1_value) = &self.parameter_1_value { + format!("{:?}", parameter_1_value).into() + } else { + String::new().into() + }, + if let Some(parameter_2_name) = &self.parameter_2_name { + format!("{:?}", parameter_2_name).into() + } else { + String::new().into() + }, + if let Some(parameter_2_value) = &self.parameter_2_value { + format!("{:?}", parameter_2_value).into() + } else { + String::new().into() + }, + if let Some(parameter_3_name) = &self.parameter_3_name { + format!("{:?}", parameter_3_name).into() + } else { + String::new().into() + }, + if let Some(parameter_3_value) = &self.parameter_3_value { + format!("{:?}", parameter_3_value).into() + } else { + String::new().into() + }, + if let Some(parameter_4_name) = &self.parameter_4_name { + format!("{:?}", parameter_4_name).into() + } else { + String::new().into() + }, + if let Some(parameter_4_value) = &self.parameter_4_value { + format!("{:?}", parameter_4_value).into() + } else { + String::new().into() + }, + if let Some(parameter_5_name) = &self.parameter_5_name { + format!("{:?}", parameter_5_name).into() + } else { + String::new().into() + }, + if let Some(parameter_5_value) = &self.parameter_5_value { + format!("{:?}", parameter_5_value).into() + } else { + String::new().into() + }, + if let Some(parameter_6_name) = &self.parameter_6_name { + format!("{:?}", parameter_6_name).into() + } else { + String::new().into() + }, + if let Some(parameter_6_value) = &self.parameter_6_value { + format!("{:?}", parameter_6_value).into() + } else { + String::new().into() + }, + if let Some(parameter_7_name) = &self.parameter_7_name { + format!("{:?}", parameter_7_name).into() + } else { + String::new().into() + }, + if let Some(parameter_7_value) = &self.parameter_7_value { + format!("{:?}", parameter_7_value).into() + } else { + String::new().into() + }, + if let Some(parameter_8_name) = &self.parameter_8_name { + format!("{:?}", parameter_8_name).into() + } else { + String::new().into() + }, + if let Some(parameter_8_value) = &self.parameter_8_value { + format!("{:?}", parameter_8_value).into() + } else { + String::new().into() + }, + if let Some(parameter_9_name) = &self.parameter_9_name { + format!("{:?}", parameter_9_name).into() + } else { + String::new().into() + }, + if let Some(parameter_9_value) = &self.parameter_9_value { + format!("{:?}", parameter_9_value).into() + } else { + String::new().into() + }, + if let Some(parameter_10_name) = &self.parameter_10_name { + format!("{:?}", parameter_10_name).into() + } else { + String::new().into() + }, + if let Some(parameter_10_value) = &self.parameter_10_value { + format!("{:?}", parameter_10_value).into() + } else { + String::new().into() + }, + if let Some(parameter_11_name) = &self.parameter_11_name { + format!("{:?}", parameter_11_name).into() + } else { + String::new().into() + }, + if let Some(parameter_11_value) = &self.parameter_11_value { + format!("{:?}", parameter_11_value).into() + } else { + String::new().into() + }, + if let Some(parameter_12_name) = &self.parameter_12_name { + format!("{:?}", parameter_12_name).into() + } else { + String::new().into() + }, + if let Some(parameter_12_value) = &self.parameter_12_value { + format!("{:?}", parameter_12_value).into() + } else { + String::new().into() + }, + if let Some(parameter_13_name) = &self.parameter_13_name { + format!("{:?}", parameter_13_name).into() + } else { + String::new().into() + }, + if let Some(parameter_13_value) = &self.parameter_13_value { + format!("{:?}", parameter_13_value).into() + } else { + String::new().into() + }, + if let Some(parameter_14_name) = &self.parameter_14_name { + format!("{:?}", parameter_14_name).into() + } else { + String::new().into() + }, + if let Some(parameter_14_value) = &self.parameter_14_value { + format!("{:?}", parameter_14_value).into() + } else { + String::new().into() + }, + if let Some(parameter_15_name) = &self.parameter_15_name { + format!("{:?}", parameter_15_name).into() + } else { + String::new().into() + }, + if let Some(parameter_15_value) = &self.parameter_15_value { + format!("{:?}", parameter_15_value).into() + } else { + String::new().into() + }, + if let Some(parameter_16_name) = &self.parameter_16_name { + format!("{:?}", parameter_16_name).into() + } else { + String::new().into() + }, + if let Some(parameter_16_value) = &self.parameter_16_value { + format!("{:?}", parameter_16_value).into() + } else { + String::new().into() + }, + if let Some(parameter_17_name) = &self.parameter_17_name { + format!("{:?}", parameter_17_name).into() + } else { + String::new().into() + }, + if let Some(parameter_17_value) = &self.parameter_17_value { + format!("{:?}", parameter_17_value).into() + } else { + String::new().into() + }, + if let Some(parameter_18_name) = &self.parameter_18_name { + format!("{:?}", parameter_18_name).into() + } else { + String::new().into() + }, + if let Some(parameter_18_value) = &self.parameter_18_value { + format!("{:?}", parameter_18_value).into() + } else { + String::new().into() + }, + if let Some(parameter_19_name) = &self.parameter_19_name { + format!("{:?}", parameter_19_name).into() + } else { + String::new().into() + }, + if let Some(parameter_19_value) = &self.parameter_19_value { + format!("{:?}", parameter_19_value).into() + } else { + String::new().into() + }, + if let Some(parameter_20_name) = &self.parameter_20_name { + format!("{:?}", parameter_20_name).into() + } else { + String::new().into() + }, + if let Some(parameter_20_value) = &self.parameter_20_value { + format!("{:?}", parameter_20_value).into() + } else { + String::new().into() + }, + if let Some(parameter_21_name) = &self.parameter_21_name { + format!("{:?}", parameter_21_name).into() + } else { + String::new().into() + }, + if let Some(parameter_21_value) = &self.parameter_21_value { + format!("{:?}", parameter_21_value).into() + } else { + String::new().into() + }, + if let Some(parameter_22_name) = &self.parameter_22_name { + format!("{:?}", parameter_22_name).into() + } else { + String::new().into() + }, + if let Some(parameter_22_value) = &self.parameter_22_value { + format!("{:?}", parameter_22_value).into() + } else { + String::new().into() + }, + if let Some(parameter_23_name) = &self.parameter_23_name { + format!("{:?}", parameter_23_name).into() + } else { + String::new().into() + }, + if let Some(parameter_23_value) = &self.parameter_23_value { + format!("{:?}", parameter_23_value).into() + } else { + String::new().into() + }, + if let Some(parameter_24_name) = &self.parameter_24_name { + format!("{:?}", parameter_24_name).into() + } else { + String::new().into() + }, + if let Some(parameter_24_value) = &self.parameter_24_value { + format!("{:?}", parameter_24_value).into() + } else { + String::new().into() + }, + if let Some(parameter_25_name) = &self.parameter_25_name { + format!("{:?}", parameter_25_name).into() + } else { + String::new().into() + }, + if let Some(parameter_25_value) = &self.parameter_25_value { + format!("{:?}", parameter_25_value).into() + } else { + String::new().into() + }, + if let Some(parameter_26_name) = &self.parameter_26_name { + format!("{:?}", parameter_26_name).into() + } else { + String::new().into() + }, + if let Some(parameter_26_value) = &self.parameter_26_value { + format!("{:?}", parameter_26_value).into() + } else { + String::new().into() + }, + if let Some(parameter_27_name) = &self.parameter_27_name { + format!("{:?}", parameter_27_name).into() + } else { + String::new().into() + }, + if let Some(parameter_27_value) = &self.parameter_27_value { + format!("{:?}", parameter_27_value).into() + } else { + String::new().into() + }, + if let Some(parameter_28_name) = &self.parameter_28_name { + format!("{:?}", parameter_28_name).into() + } else { + String::new().into() + }, + if let Some(parameter_28_value) = &self.parameter_28_value { + format!("{:?}", parameter_28_value).into() + } else { + String::new().into() + }, + if let Some(parameter_29_name) = &self.parameter_29_name { + format!("{:?}", parameter_29_name).into() + } else { + String::new().into() + }, + if let Some(parameter_29_value) = &self.parameter_29_value { + format!("{:?}", parameter_29_value).into() + } else { + String::new().into() + }, + if let Some(parameter_30_name) = &self.parameter_30_name { + format!("{:?}", parameter_30_name).into() + } else { + String::new().into() + }, + if let Some(parameter_30_value) = &self.parameter_30_value { + format!("{:?}", parameter_30_value).into() + } else { + String::new().into() + }, + if let Some(parameter_31_name) = &self.parameter_31_name { + format!("{:?}", parameter_31_name).into() + } else { + String::new().into() + }, + if let Some(parameter_31_value) = &self.parameter_31_value { + format!("{:?}", parameter_31_value).into() + } else { + String::new().into() + }, + if let Some(parameter_32_name) = &self.parameter_32_name { + format!("{:?}", parameter_32_name).into() + } else { + String::new().into() + }, + if let Some(parameter_32_value) = &self.parameter_32_value { + format!("{:?}", parameter_32_value).into() + } else { + String::new().into() + }, + if let Some(parameter_33_name) = &self.parameter_33_name { + format!("{:?}", parameter_33_name).into() + } else { + String::new().into() + }, + if let Some(parameter_33_value) = &self.parameter_33_value { + format!("{:?}", parameter_33_value).into() + } else { + String::new().into() + }, + if let Some(parameter_34_name) = &self.parameter_34_name { + format!("{:?}", parameter_34_name).into() + } else { + String::new().into() + }, + if let Some(parameter_34_value) = &self.parameter_34_value { + format!("{:?}", parameter_34_value).into() + } else { + String::new().into() + }, + if let Some(parameter_35_name) = &self.parameter_35_name { + format!("{:?}", parameter_35_name).into() + } else { + String::new().into() + }, + if let Some(parameter_35_value) = &self.parameter_35_value { + format!("{:?}", parameter_35_value).into() + } else { + String::new().into() + }, + if let Some(parameter_36_name) = &self.parameter_36_name { + format!("{:?}", parameter_36_name).into() + } else { + String::new().into() + }, + if let Some(parameter_36_value) = &self.parameter_36_value { + format!("{:?}", parameter_36_value).into() + } else { + String::new().into() + }, + if let Some(parameter_37_name) = &self.parameter_37_name { + format!("{:?}", parameter_37_name).into() + } else { + String::new().into() + }, + if let Some(parameter_37_value) = &self.parameter_37_value { + format!("{:?}", parameter_37_value).into() + } else { + String::new().into() + }, + if let Some(parameter_38_name) = &self.parameter_38_name { + format!("{:?}", parameter_38_name).into() + } else { + String::new().into() + }, + if let Some(parameter_38_value) = &self.parameter_38_value { + format!("{:?}", parameter_38_value).into() + } else { + String::new().into() + }, + if let Some(parameter_39_name) = &self.parameter_39_name { + format!("{:?}", parameter_39_name).into() + } else { + String::new().into() + }, + if let Some(parameter_39_value) = &self.parameter_39_value { + format!("{:?}", parameter_39_value).into() + } else { + String::new().into() + }, + if let Some(parameter_40_name) = &self.parameter_40_name { + format!("{:?}", parameter_40_name).into() + } else { + String::new().into() + }, + if let Some(parameter_40_value) = &self.parameter_40_value { + format!("{:?}", parameter_40_value).into() + } else { + String::new().into() + }, + if let Some(parameter_41_name) = &self.parameter_41_name { + format!("{:?}", parameter_41_name).into() + } else { + String::new().into() + }, + if let Some(parameter_41_value) = &self.parameter_41_value { + format!("{:?}", parameter_41_value).into() + } else { + String::new().into() + }, + if let Some(parameter_42_name) = &self.parameter_42_name { + format!("{:?}", parameter_42_name).into() + } else { + String::new().into() + }, + if let Some(parameter_42_value) = &self.parameter_42_value { + format!("{:?}", parameter_42_value).into() + } else { + String::new().into() + }, + if let Some(parameter_43_name) = &self.parameter_43_name { + format!("{:?}", parameter_43_name).into() + } else { + String::new().into() + }, + if let Some(parameter_43_value) = &self.parameter_43_value { + format!("{:?}", parameter_43_value).into() + } else { + String::new().into() + }, + if let Some(parameter_44_name) = &self.parameter_44_name { + format!("{:?}", parameter_44_name).into() + } else { + String::new().into() + }, + if let Some(parameter_44_value) = &self.parameter_44_value { + format!("{:?}", parameter_44_value).into() + } else { + String::new().into() + }, + if let Some(parameter_45_name) = &self.parameter_45_name { + format!("{:?}", parameter_45_name).into() + } else { + String::new().into() + }, + if let Some(parameter_45_value) = &self.parameter_45_value { + format!("{:?}", parameter_45_value).into() + } else { + String::new().into() + }, + if let Some(parameter_46_name) = &self.parameter_46_name { + format!("{:?}", parameter_46_name).into() + } else { + String::new().into() + }, + if let Some(parameter_46_value) = &self.parameter_46_value { + format!("{:?}", parameter_46_value).into() + } else { + String::new().into() + }, + if let Some(parameter_47_name) = &self.parameter_47_name { + format!("{:?}", parameter_47_name).into() + } else { + String::new().into() + }, + if let Some(parameter_47_value) = &self.parameter_47_value { + format!("{:?}", parameter_47_value).into() + } else { + String::new().into() + }, + if let Some(parameter_48_name) = &self.parameter_48_name { + format!("{:?}", parameter_48_name).into() + } else { + String::new().into() + }, + if let Some(parameter_48_value) = &self.parameter_48_value { + format!("{:?}", parameter_48_value).into() + } else { + String::new().into() + }, + if let Some(parameter_49_name) = &self.parameter_49_name { + format!("{:?}", parameter_49_name).into() + } else { + String::new().into() + }, + if let Some(parameter_49_value) = &self.parameter_49_value { + format!("{:?}", parameter_49_value).into() + } else { + String::new().into() + }, + if let Some(parameter_50_name) = &self.parameter_50_name { + format!("{:?}", parameter_50_name).into() + } else { + String::new().into() + }, + if let Some(parameter_50_value) = &self.parameter_50_value { + format!("{:?}", parameter_50_value).into() + } else { + String::new().into() + }, + if let Some(parameter_51_name) = &self.parameter_51_name { + format!("{:?}", parameter_51_name).into() + } else { + String::new().into() + }, + if let Some(parameter_51_value) = &self.parameter_51_value { + format!("{:?}", parameter_51_value).into() + } else { + String::new().into() + }, + if let Some(parameter_52_name) = &self.parameter_52_name { + format!("{:?}", parameter_52_name).into() + } else { + String::new().into() + }, + if let Some(parameter_52_value) = &self.parameter_52_value { + format!("{:?}", parameter_52_value).into() + } else { + String::new().into() + }, + if let Some(parameter_53_name) = &self.parameter_53_name { + format!("{:?}", parameter_53_name).into() + } else { + String::new().into() + }, + if let Some(parameter_53_value) = &self.parameter_53_value { + format!("{:?}", parameter_53_value).into() + } else { + String::new().into() + }, + if let Some(parameter_54_name) = &self.parameter_54_name { + format!("{:?}", parameter_54_name).into() + } else { + String::new().into() + }, + if let Some(parameter_54_value) = &self.parameter_54_value { + format!("{:?}", parameter_54_value).into() + } else { + String::new().into() + }, + if let Some(parameter_55_name) = &self.parameter_55_name { + format!("{:?}", parameter_55_name).into() + } else { + String::new().into() + }, + if let Some(parameter_55_value) = &self.parameter_55_value { + format!("{:?}", parameter_55_value).into() + } else { + String::new().into() + }, + if let Some(parameter_56_name) = &self.parameter_56_name { + format!("{:?}", parameter_56_name).into() + } else { + String::new().into() + }, + if let Some(parameter_56_value) = &self.parameter_56_value { + format!("{:?}", parameter_56_value).into() + } else { + String::new().into() + }, + if let Some(parameter_57_name) = &self.parameter_57_name { + format!("{:?}", parameter_57_name).into() + } else { + String::new().into() + }, + if let Some(parameter_57_value) = &self.parameter_57_value { + format!("{:?}", parameter_57_value).into() + } else { + String::new().into() + }, + if let Some(parameter_58_name) = &self.parameter_58_name { + format!("{:?}", parameter_58_name).into() + } else { + String::new().into() + }, + if let Some(parameter_58_value) = &self.parameter_58_value { + format!("{:?}", parameter_58_value).into() + } else { + String::new().into() + }, + if let Some(parameter_59_name) = &self.parameter_59_name { + format!("{:?}", parameter_59_name).into() + } else { + String::new().into() + }, + if let Some(parameter_59_value) = &self.parameter_59_value { + format!("{:?}", parameter_59_value).into() + } else { + String::new().into() + }, + if let Some(parameter_60_name) = &self.parameter_60_name { + format!("{:?}", parameter_60_name).into() + } else { + String::new().into() + }, + if let Some(parameter_60_value) = &self.parameter_60_value { + format!("{:?}", parameter_60_value).into() + } else { + String::new().into() + }, + if let Some(parameter_61_name) = &self.parameter_61_name { + format!("{:?}", parameter_61_name).into() + } else { + String::new().into() + }, + if let Some(parameter_61_value) = &self.parameter_61_value { + format!("{:?}", parameter_61_value).into() + } else { + String::new().into() + }, + if let Some(parameter_62_name) = &self.parameter_62_name { + format!("{:?}", parameter_62_name).into() + } else { + String::new().into() + }, + if let Some(parameter_62_value) = &self.parameter_62_value { + format!("{:?}", parameter_62_value).into() + } else { + String::new().into() + }, + if let Some(parameter_63_name) = &self.parameter_63_name { + format!("{:?}", parameter_63_name).into() + } else { + String::new().into() + }, + if let Some(parameter_63_value) = &self.parameter_63_value { + format!("{:?}", parameter_63_value).into() + } else { + String::new().into() + }, + if let Some(parameter_64_name) = &self.parameter_64_name { + format!("{:?}", parameter_64_name).into() + } else { + String::new().into() + }, + if let Some(parameter_64_value) = &self.parameter_64_value { + format!("{:?}", parameter_64_value).into() + } else { + String::new().into() + }, + if let Some(parameter_65_name) = &self.parameter_65_name { + format!("{:?}", parameter_65_name).into() + } else { + String::new().into() + }, + if let Some(parameter_65_value) = &self.parameter_65_value { + format!("{:?}", parameter_65_value).into() + } else { + String::new().into() + }, + if let Some(parameter_66_name) = &self.parameter_66_name { + format!("{:?}", parameter_66_name).into() + } else { + String::new().into() + }, + if let Some(parameter_66_value) = &self.parameter_66_value { + format!("{:?}", parameter_66_value).into() + } else { + String::new().into() + }, + if let Some(parameter_67_name) = &self.parameter_67_name { + format!("{:?}", parameter_67_name).into() + } else { + String::new().into() + }, + if let Some(parameter_67_value) = &self.parameter_67_value { + format!("{:?}", parameter_67_value).into() + } else { + String::new().into() + }, + if let Some(parameter_68_name) = &self.parameter_68_name { + format!("{:?}", parameter_68_name).into() + } else { + String::new().into() + }, + if let Some(parameter_68_value) = &self.parameter_68_value { + format!("{:?}", parameter_68_value).into() + } else { + String::new().into() + }, + if let Some(parameter_69_name) = &self.parameter_69_name { + format!("{:?}", parameter_69_name).into() + } else { + String::new().into() + }, + if let Some(parameter_69_value) = &self.parameter_69_value { + format!("{:?}", parameter_69_value).into() + } else { + String::new().into() + }, + if let Some(parameter_70_name) = &self.parameter_70_name { + format!("{:?}", parameter_70_name).into() + } else { + String::new().into() + }, + if let Some(parameter_70_value) = &self.parameter_70_value { + format!("{:?}", parameter_70_value).into() + } else { + String::new().into() + }, + if let Some(parameter_71_name) = &self.parameter_71_name { + format!("{:?}", parameter_71_name).into() + } else { + String::new().into() + }, + if let Some(parameter_71_value) = &self.parameter_71_value { + format!("{:?}", parameter_71_value).into() + } else { + String::new().into() + }, + if let Some(parameter_72_name) = &self.parameter_72_name { + format!("{:?}", parameter_72_name).into() + } else { + String::new().into() + }, + if let Some(parameter_72_value) = &self.parameter_72_value { + format!("{:?}", parameter_72_value).into() + } else { + String::new().into() + }, + if let Some(parameter_73_name) = &self.parameter_73_name { + format!("{:?}", parameter_73_name).into() + } else { + String::new().into() + }, + if let Some(parameter_73_value) = &self.parameter_73_value { + format!("{:?}", parameter_73_value).into() + } else { + String::new().into() + }, + if let Some(parameter_74_name) = &self.parameter_74_name { + format!("{:?}", parameter_74_name).into() + } else { + String::new().into() + }, + if let Some(parameter_74_value) = &self.parameter_74_value { + format!("{:?}", parameter_74_value).into() + } else { + String::new().into() + }, + if let Some(parameter_75_name) = &self.parameter_75_name { + format!("{:?}", parameter_75_name).into() + } else { + String::new().into() + }, + if let Some(parameter_75_value) = &self.parameter_75_value { + format!("{:?}", parameter_75_value).into() + } else { + String::new().into() + }, + if let Some(parameter_76_name) = &self.parameter_76_name { + format!("{:?}", parameter_76_name).into() + } else { + String::new().into() + }, + if let Some(parameter_76_value) = &self.parameter_76_value { + format!("{:?}", parameter_76_value).into() + } else { + String::new().into() + }, + if let Some(parameter_77_name) = &self.parameter_77_name { + format!("{:?}", parameter_77_name).into() + } else { + String::new().into() + }, + if let Some(parameter_77_value) = &self.parameter_77_value { + format!("{:?}", parameter_77_value).into() + } else { + String::new().into() + }, + if let Some(parameter_78_name) = &self.parameter_78_name { + format!("{:?}", parameter_78_name).into() + } else { + String::new().into() + }, + if let Some(parameter_78_value) = &self.parameter_78_value { + format!("{:?}", parameter_78_value).into() + } else { + String::new().into() + }, + if let Some(parameter_79_name) = &self.parameter_79_name { + format!("{:?}", parameter_79_name).into() + } else { + String::new().into() + }, + if let Some(parameter_79_value) = &self.parameter_79_value { + format!("{:?}", parameter_79_value).into() + } else { + String::new().into() + }, + if let Some(parameter_80_name) = &self.parameter_80_name { + format!("{:?}", parameter_80_name).into() + } else { + String::new().into() + }, + if let Some(parameter_80_value) = &self.parameter_80_value { + format!("{:?}", parameter_80_value).into() + } else { + String::new().into() + }, + if let Some(parameter_81_name) = &self.parameter_81_name { + format!("{:?}", parameter_81_name).into() + } else { + String::new().into() + }, + if let Some(parameter_81_value) = &self.parameter_81_value { + format!("{:?}", parameter_81_value).into() + } else { + String::new().into() + }, + if let Some(parameter_82_name) = &self.parameter_82_name { + format!("{:?}", parameter_82_name).into() + } else { + String::new().into() + }, + if let Some(parameter_82_value) = &self.parameter_82_value { + format!("{:?}", parameter_82_value).into() + } else { + String::new().into() + }, + if let Some(parameter_83_name) = &self.parameter_83_name { + format!("{:?}", parameter_83_name).into() + } else { + String::new().into() + }, + if let Some(parameter_83_value) = &self.parameter_83_value { + format!("{:?}", parameter_83_value).into() + } else { + String::new().into() + }, + if let Some(parameter_84_name) = &self.parameter_84_name { + format!("{:?}", parameter_84_name).into() + } else { + String::new().into() + }, + if let Some(parameter_84_value) = &self.parameter_84_value { + format!("{:?}", parameter_84_value).into() + } else { + String::new().into() + }, + if let Some(parameter_85_name) = &self.parameter_85_name { + format!("{:?}", parameter_85_name).into() + } else { + String::new().into() + }, + if let Some(parameter_85_value) = &self.parameter_85_value { + format!("{:?}", parameter_85_value).into() + } else { + String::new().into() + }, + if let Some(parameter_86_name) = &self.parameter_86_name { + format!("{:?}", parameter_86_name).into() + } else { + String::new().into() + }, + if let Some(parameter_86_value) = &self.parameter_86_value { + format!("{:?}", parameter_86_value).into() + } else { + String::new().into() + }, + if let Some(parameter_87_name) = &self.parameter_87_name { + format!("{:?}", parameter_87_name).into() + } else { + String::new().into() + }, + if let Some(parameter_87_value) = &self.parameter_87_value { + format!("{:?}", parameter_87_value).into() + } else { + String::new().into() + }, + if let Some(parameter_88_name) = &self.parameter_88_name { + format!("{:?}", parameter_88_name).into() + } else { + String::new().into() + }, + if let Some(parameter_88_value) = &self.parameter_88_value { + format!("{:?}", parameter_88_value).into() + } else { + String::new().into() + }, + if let Some(parameter_89_name) = &self.parameter_89_name { + format!("{:?}", parameter_89_name).into() + } else { + String::new().into() + }, + if let Some(parameter_89_value) = &self.parameter_89_value { + format!("{:?}", parameter_89_value).into() + } else { + String::new().into() + }, + if let Some(parameter_90_name) = &self.parameter_90_name { + format!("{:?}", parameter_90_name).into() + } else { + String::new().into() + }, + if let Some(parameter_90_value) = &self.parameter_90_value { + format!("{:?}", parameter_90_value).into() + } else { + String::new().into() + }, + if let Some(parameter_91_name) = &self.parameter_91_name { + format!("{:?}", parameter_91_name).into() + } else { + String::new().into() + }, + if let Some(parameter_91_value) = &self.parameter_91_value { + format!("{:?}", parameter_91_value).into() + } else { + String::new().into() + }, + if let Some(parameter_92_name) = &self.parameter_92_name { + format!("{:?}", parameter_92_name).into() + } else { + String::new().into() + }, + if let Some(parameter_92_value) = &self.parameter_92_value { + format!("{:?}", parameter_92_value).into() + } else { + String::new().into() + }, + if let Some(parameter_93_name) = &self.parameter_93_name { + format!("{:?}", parameter_93_name).into() + } else { + String::new().into() + }, + if let Some(parameter_93_value) = &self.parameter_93_value { + format!("{:?}", parameter_93_value).into() + } else { + String::new().into() + }, + if let Some(parameter_94_name) = &self.parameter_94_name { + format!("{:?}", parameter_94_name).into() + } else { + String::new().into() + }, + if let Some(parameter_94_value) = &self.parameter_94_value { + format!("{:?}", parameter_94_value).into() + } else { + String::new().into() + }, + if let Some(parameter_95_name) = &self.parameter_95_name { + format!("{:?}", parameter_95_name).into() + } else { + String::new().into() + }, + if let Some(parameter_95_value) = &self.parameter_95_value { + format!("{:?}", parameter_95_value).into() + } else { + String::new().into() + }, + if let Some(parameter_96_name) = &self.parameter_96_name { + format!("{:?}", parameter_96_name).into() + } else { + String::new().into() + }, + if let Some(parameter_96_value) = &self.parameter_96_value { + format!("{:?}", parameter_96_value).into() + } else { + String::new().into() + }, + if let Some(parameter_97_name) = &self.parameter_97_name { + format!("{:?}", parameter_97_name).into() + } else { + String::new().into() + }, + if let Some(parameter_97_value) = &self.parameter_97_value { + format!("{:?}", parameter_97_value).into() + } else { + String::new().into() + }, + if let Some(parameter_98_name) = &self.parameter_98_name { + format!("{:?}", parameter_98_name).into() + } else { + String::new().into() + }, + if let Some(parameter_98_value) = &self.parameter_98_value { + format!("{:?}", parameter_98_value).into() + } else { + String::new().into() + }, + if let Some(parameter_99_name) = &self.parameter_99_name { + format!("{:?}", parameter_99_name).into() + } else { + String::new().into() + }, + if let Some(parameter_99_value) = &self.parameter_99_value { + format!("{:?}", parameter_99_value).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "name".into(), + "connector_name".into(), + "track".into(), + "status_callback".into(), + "status_callback_method".into(), + "parameter_1_name".into(), + "parameter_1_value".into(), + "parameter_2_name".into(), + "parameter_2_value".into(), + "parameter_3_name".into(), + "parameter_3_value".into(), + "parameter_4_name".into(), + "parameter_4_value".into(), + "parameter_5_name".into(), + "parameter_5_value".into(), + "parameter_6_name".into(), + "parameter_6_value".into(), + "parameter_7_name".into(), + "parameter_7_value".into(), + "parameter_8_name".into(), + "parameter_8_value".into(), + "parameter_9_name".into(), + "parameter_9_value".into(), + "parameter_10_name".into(), + "parameter_10_value".into(), + "parameter_11_name".into(), + "parameter_11_value".into(), + "parameter_12_name".into(), + "parameter_12_value".into(), + "parameter_13_name".into(), + "parameter_13_value".into(), + "parameter_14_name".into(), + "parameter_14_value".into(), + "parameter_15_name".into(), + "parameter_15_value".into(), + "parameter_16_name".into(), + "parameter_16_value".into(), + "parameter_17_name".into(), + "parameter_17_value".into(), + "parameter_18_name".into(), + "parameter_18_value".into(), + "parameter_19_name".into(), + "parameter_19_value".into(), + "parameter_20_name".into(), + "parameter_20_value".into(), + "parameter_21_name".into(), + "parameter_21_value".into(), + "parameter_22_name".into(), + "parameter_22_value".into(), + "parameter_23_name".into(), + "parameter_23_value".into(), + "parameter_24_name".into(), + "parameter_24_value".into(), + "parameter_25_name".into(), + "parameter_25_value".into(), + "parameter_26_name".into(), + "parameter_26_value".into(), + "parameter_27_name".into(), + "parameter_27_value".into(), + "parameter_28_name".into(), + "parameter_28_value".into(), + "parameter_29_name".into(), + "parameter_29_value".into(), + "parameter_30_name".into(), + "parameter_30_value".into(), + "parameter_31_name".into(), + "parameter_31_value".into(), + "parameter_32_name".into(), + "parameter_32_value".into(), + "parameter_33_name".into(), + "parameter_33_value".into(), + "parameter_34_name".into(), + "parameter_34_value".into(), + "parameter_35_name".into(), + "parameter_35_value".into(), + "parameter_36_name".into(), + "parameter_36_value".into(), + "parameter_37_name".into(), + "parameter_37_value".into(), + "parameter_38_name".into(), + "parameter_38_value".into(), + "parameter_39_name".into(), + "parameter_39_value".into(), + "parameter_40_name".into(), + "parameter_40_value".into(), + "parameter_41_name".into(), + "parameter_41_value".into(), + "parameter_42_name".into(), + "parameter_42_value".into(), + "parameter_43_name".into(), + "parameter_43_value".into(), + "parameter_44_name".into(), + "parameter_44_value".into(), + "parameter_45_name".into(), + "parameter_45_value".into(), + "parameter_46_name".into(), + "parameter_46_value".into(), + "parameter_47_name".into(), + "parameter_47_value".into(), + "parameter_48_name".into(), + "parameter_48_value".into(), + "parameter_49_name".into(), + "parameter_49_value".into(), + "parameter_50_name".into(), + "parameter_50_value".into(), + "parameter_51_name".into(), + "parameter_51_value".into(), + "parameter_52_name".into(), + "parameter_52_value".into(), + "parameter_53_name".into(), + "parameter_53_value".into(), + "parameter_54_name".into(), + "parameter_54_value".into(), + "parameter_55_name".into(), + "parameter_55_value".into(), + "parameter_56_name".into(), + "parameter_56_value".into(), + "parameter_57_name".into(), + "parameter_57_value".into(), + "parameter_58_name".into(), + "parameter_58_value".into(), + "parameter_59_name".into(), + "parameter_59_value".into(), + "parameter_60_name".into(), + "parameter_60_value".into(), + "parameter_61_name".into(), + "parameter_61_value".into(), + "parameter_62_name".into(), + "parameter_62_value".into(), + "parameter_63_name".into(), + "parameter_63_value".into(), + "parameter_64_name".into(), + "parameter_64_value".into(), + "parameter_65_name".into(), + "parameter_65_value".into(), + "parameter_66_name".into(), + "parameter_66_value".into(), + "parameter_67_name".into(), + "parameter_67_value".into(), + "parameter_68_name".into(), + "parameter_68_value".into(), + "parameter_69_name".into(), + "parameter_69_value".into(), + "parameter_70_name".into(), + "parameter_70_value".into(), + "parameter_71_name".into(), + "parameter_71_value".into(), + "parameter_72_name".into(), + "parameter_72_value".into(), + "parameter_73_name".into(), + "parameter_73_value".into(), + "parameter_74_name".into(), + "parameter_74_value".into(), + "parameter_75_name".into(), + "parameter_75_value".into(), + "parameter_76_name".into(), + "parameter_76_value".into(), + "parameter_77_name".into(), + "parameter_77_value".into(), + "parameter_78_name".into(), + "parameter_78_value".into(), + "parameter_79_name".into(), + "parameter_79_value".into(), + "parameter_80_name".into(), + "parameter_80_value".into(), + "parameter_81_name".into(), + "parameter_81_value".into(), + "parameter_82_name".into(), + "parameter_82_value".into(), + "parameter_83_name".into(), + "parameter_83_value".into(), + "parameter_84_name".into(), + "parameter_84_value".into(), + "parameter_85_name".into(), + "parameter_85_value".into(), + "parameter_86_name".into(), + "parameter_86_value".into(), + "parameter_87_name".into(), + "parameter_87_value".into(), + "parameter_88_name".into(), + "parameter_88_value".into(), + "parameter_89_name".into(), + "parameter_89_value".into(), + "parameter_90_name".into(), + "parameter_90_value".into(), + "parameter_91_name".into(), + "parameter_91_value".into(), + "parameter_92_name".into(), + "parameter_92_value".into(), + "parameter_93_name".into(), + "parameter_93_value".into(), + "parameter_94_name".into(), + "parameter_94_value".into(), + "parameter_95_name".into(), + "parameter_95_value".into(), + "parameter_96_name".into(), + "parameter_96_value".into(), + "parameter_97_name".into(), + "parameter_97_value".into(), + "parameter_98_name".into(), + "parameter_98_value".into(), + "parameter_99_name".into(), + "parameter_99_value".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateSiprecRequest { + #[serde(rename = "Status")] + pub status: SiprecEnumUpdateStatus, +} + +impl std::fmt::Display for UpdateSiprecRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateSiprecRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![format!("{:?}", self.status).into()] + } + + fn headers() -> Vec> { + vec!["status".into()] + } +} + +#[doc = "The http method for the status_callback (one of GET, POST)."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateStreamRequestStatusCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateStreamRequest { + #[doc = "Relative or absolute url where WebSocket connection will be established."] + #[serde(rename = "Url")] + pub url: String, + #[doc = "The user-specified name of this Stream, if one was given when the Stream was \ + created. This may be used to stop the Stream."] + #[serde(rename = "Name", default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "Track", default, skip_serializing_if = "Option::is_none")] + pub track: Option, + #[doc = "Absolute URL of the status callback."] + #[serde( + rename = "StatusCallback", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback: Option, + #[doc = "The http method for the status_callback (one of GET, POST)."] + #[serde( + rename = "StatusCallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub status_callback_method: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter1.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_1_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter1.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_1_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter2.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_2_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter2.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_2_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter3.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_3_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter3.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_3_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter4.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_4_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter4.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_4_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter5.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_5_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter5.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_5_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter6.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_6_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter6.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_6_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter7.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_7_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter7.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_7_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter8.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_8_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter8.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_8_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter9.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_9_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter9.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_9_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter10.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_10_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter10.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_10_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter11.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_11_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter11.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_11_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter12.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_12_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter12.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_12_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter13.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_13_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter13.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_13_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter14.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_14_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter14.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_14_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter15.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_15_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter15.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_15_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter16.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_16_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter16.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_16_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter17.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_17_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter17.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_17_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter18.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_18_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter18.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_18_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter19.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_19_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter19.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_19_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter20.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_20_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter20.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_20_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter21.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_21_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter21.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_21_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter22.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_22_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter22.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_22_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter23.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_23_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter23.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_23_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter24.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_24_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter24.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_24_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter25.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_25_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter25.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_25_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter26.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_26_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter26.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_26_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter27.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_27_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter27.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_27_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter28.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_28_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter28.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_28_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter29.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_29_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter29.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_29_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter30.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_30_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter30.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_30_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter31.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_31_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter31.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_31_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter32.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_32_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter32.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_32_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter33.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_33_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter33.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_33_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter34.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_34_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter34.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_34_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter35.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_35_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter35.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_35_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter36.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_36_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter36.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_36_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter37.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_37_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter37.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_37_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter38.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_38_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter38.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_38_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter39.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_39_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter39.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_39_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter40.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_40_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter40.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_40_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter41.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_41_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter41.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_41_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter42.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_42_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter42.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_42_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter43.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_43_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter43.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_43_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter44.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_44_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter44.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_44_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter45.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_45_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter45.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_45_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter46.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_46_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter46.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_46_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter47.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_47_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter47.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_47_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter48.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_48_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter48.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_48_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter49.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_49_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter49.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_49_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter50.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_50_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter50.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_50_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter51.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_51_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter51.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_51_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter52.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_52_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter52.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_52_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter53.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_53_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter53.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_53_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter54.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_54_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter54.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_54_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter55.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_55_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter55.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_55_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter56.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_56_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter56.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_56_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter57.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_57_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter57.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_57_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter58.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_58_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter58.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_58_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter59.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_59_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter59.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_59_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter60.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_60_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter60.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_60_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter61.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_61_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter61.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_61_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter62.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_62_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter62.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_62_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter63.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_63_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter63.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_63_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter64.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_64_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter64.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_64_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter65.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_65_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter65.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_65_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter66.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_66_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter66.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_66_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter67.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_67_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter67.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_67_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter68.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_68_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter68.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_68_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter69.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_69_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter69.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_69_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter70.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_70_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter70.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_70_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter71.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_71_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter71.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_71_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter72.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_72_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter72.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_72_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter73.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_73_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter73.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_73_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter74.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_74_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter74.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_74_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter75.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_75_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter75.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_75_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter76.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_76_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter76.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_76_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter77.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_77_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter77.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_77_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter78.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_78_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter78.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_78_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter79.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_79_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter79.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_79_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter80.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_80_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter80.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_80_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter81.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_81_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter81.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_81_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter82.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_82_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter82.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_82_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter83.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_83_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter83.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_83_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter84.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_84_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter84.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_84_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter85.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_85_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter85.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_85_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter86.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_86_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter86.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_86_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter87.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_87_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter87.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_87_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter88.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_88_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter88.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_88_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter89.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_89_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter89.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_89_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter90.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_90_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter90.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_90_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter91.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_91_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter91.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_91_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter92.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_92_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter92.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_92_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter93.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_93_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter93.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_93_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter94.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_94_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter94.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_94_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter95.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_95_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter95.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_95_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter96.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_96_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter96.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_96_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter97.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_97_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter97.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_97_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter98.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_98_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter98.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_98_value: Option, + #[doc = "Parameter name"] + #[serde( + rename = "Parameter99.Name", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_99_name: Option, + #[doc = "Parameter value"] + #[serde( + rename = "Parameter99.Value", + default, + skip_serializing_if = "Option::is_none" + )] + pub parameter_99_value: Option, +} + +impl std::fmt::Display for CreateStreamRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateStreamRequest { + const LENGTH: usize = 203; + fn fields(&self) -> Vec> { + vec![ + self.url.clone().into(), + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(track) = &self.track { + format!("{:?}", track).into() + } else { + String::new().into() + }, + if let Some(status_callback) = &self.status_callback { + format!("{:?}", status_callback).into() + } else { + String::new().into() + }, + if let Some(status_callback_method) = &self.status_callback_method { + format!("{:?}", status_callback_method).into() + } else { + String::new().into() + }, + if let Some(parameter_1_name) = &self.parameter_1_name { + format!("{:?}", parameter_1_name).into() + } else { + String::new().into() + }, + if let Some(parameter_1_value) = &self.parameter_1_value { + format!("{:?}", parameter_1_value).into() + } else { + String::new().into() + }, + if let Some(parameter_2_name) = &self.parameter_2_name { + format!("{:?}", parameter_2_name).into() + } else { + String::new().into() + }, + if let Some(parameter_2_value) = &self.parameter_2_value { + format!("{:?}", parameter_2_value).into() + } else { + String::new().into() + }, + if let Some(parameter_3_name) = &self.parameter_3_name { + format!("{:?}", parameter_3_name).into() + } else { + String::new().into() + }, + if let Some(parameter_3_value) = &self.parameter_3_value { + format!("{:?}", parameter_3_value).into() + } else { + String::new().into() + }, + if let Some(parameter_4_name) = &self.parameter_4_name { + format!("{:?}", parameter_4_name).into() + } else { + String::new().into() + }, + if let Some(parameter_4_value) = &self.parameter_4_value { + format!("{:?}", parameter_4_value).into() + } else { + String::new().into() + }, + if let Some(parameter_5_name) = &self.parameter_5_name { + format!("{:?}", parameter_5_name).into() + } else { + String::new().into() + }, + if let Some(parameter_5_value) = &self.parameter_5_value { + format!("{:?}", parameter_5_value).into() + } else { + String::new().into() + }, + if let Some(parameter_6_name) = &self.parameter_6_name { + format!("{:?}", parameter_6_name).into() + } else { + String::new().into() + }, + if let Some(parameter_6_value) = &self.parameter_6_value { + format!("{:?}", parameter_6_value).into() + } else { + String::new().into() + }, + if let Some(parameter_7_name) = &self.parameter_7_name { + format!("{:?}", parameter_7_name).into() + } else { + String::new().into() + }, + if let Some(parameter_7_value) = &self.parameter_7_value { + format!("{:?}", parameter_7_value).into() + } else { + String::new().into() + }, + if let Some(parameter_8_name) = &self.parameter_8_name { + format!("{:?}", parameter_8_name).into() + } else { + String::new().into() + }, + if let Some(parameter_8_value) = &self.parameter_8_value { + format!("{:?}", parameter_8_value).into() + } else { + String::new().into() + }, + if let Some(parameter_9_name) = &self.parameter_9_name { + format!("{:?}", parameter_9_name).into() + } else { + String::new().into() + }, + if let Some(parameter_9_value) = &self.parameter_9_value { + format!("{:?}", parameter_9_value).into() + } else { + String::new().into() + }, + if let Some(parameter_10_name) = &self.parameter_10_name { + format!("{:?}", parameter_10_name).into() + } else { + String::new().into() + }, + if let Some(parameter_10_value) = &self.parameter_10_value { + format!("{:?}", parameter_10_value).into() + } else { + String::new().into() + }, + if let Some(parameter_11_name) = &self.parameter_11_name { + format!("{:?}", parameter_11_name).into() + } else { + String::new().into() + }, + if let Some(parameter_11_value) = &self.parameter_11_value { + format!("{:?}", parameter_11_value).into() + } else { + String::new().into() + }, + if let Some(parameter_12_name) = &self.parameter_12_name { + format!("{:?}", parameter_12_name).into() + } else { + String::new().into() + }, + if let Some(parameter_12_value) = &self.parameter_12_value { + format!("{:?}", parameter_12_value).into() + } else { + String::new().into() + }, + if let Some(parameter_13_name) = &self.parameter_13_name { + format!("{:?}", parameter_13_name).into() + } else { + String::new().into() + }, + if let Some(parameter_13_value) = &self.parameter_13_value { + format!("{:?}", parameter_13_value).into() + } else { + String::new().into() + }, + if let Some(parameter_14_name) = &self.parameter_14_name { + format!("{:?}", parameter_14_name).into() + } else { + String::new().into() + }, + if let Some(parameter_14_value) = &self.parameter_14_value { + format!("{:?}", parameter_14_value).into() + } else { + String::new().into() + }, + if let Some(parameter_15_name) = &self.parameter_15_name { + format!("{:?}", parameter_15_name).into() + } else { + String::new().into() + }, + if let Some(parameter_15_value) = &self.parameter_15_value { + format!("{:?}", parameter_15_value).into() + } else { + String::new().into() + }, + if let Some(parameter_16_name) = &self.parameter_16_name { + format!("{:?}", parameter_16_name).into() + } else { + String::new().into() + }, + if let Some(parameter_16_value) = &self.parameter_16_value { + format!("{:?}", parameter_16_value).into() + } else { + String::new().into() + }, + if let Some(parameter_17_name) = &self.parameter_17_name { + format!("{:?}", parameter_17_name).into() + } else { + String::new().into() + }, + if let Some(parameter_17_value) = &self.parameter_17_value { + format!("{:?}", parameter_17_value).into() + } else { + String::new().into() + }, + if let Some(parameter_18_name) = &self.parameter_18_name { + format!("{:?}", parameter_18_name).into() + } else { + String::new().into() + }, + if let Some(parameter_18_value) = &self.parameter_18_value { + format!("{:?}", parameter_18_value).into() + } else { + String::new().into() + }, + if let Some(parameter_19_name) = &self.parameter_19_name { + format!("{:?}", parameter_19_name).into() + } else { + String::new().into() + }, + if let Some(parameter_19_value) = &self.parameter_19_value { + format!("{:?}", parameter_19_value).into() + } else { + String::new().into() + }, + if let Some(parameter_20_name) = &self.parameter_20_name { + format!("{:?}", parameter_20_name).into() + } else { + String::new().into() + }, + if let Some(parameter_20_value) = &self.parameter_20_value { + format!("{:?}", parameter_20_value).into() + } else { + String::new().into() + }, + if let Some(parameter_21_name) = &self.parameter_21_name { + format!("{:?}", parameter_21_name).into() + } else { + String::new().into() + }, + if let Some(parameter_21_value) = &self.parameter_21_value { + format!("{:?}", parameter_21_value).into() + } else { + String::new().into() + }, + if let Some(parameter_22_name) = &self.parameter_22_name { + format!("{:?}", parameter_22_name).into() + } else { + String::new().into() + }, + if let Some(parameter_22_value) = &self.parameter_22_value { + format!("{:?}", parameter_22_value).into() + } else { + String::new().into() + }, + if let Some(parameter_23_name) = &self.parameter_23_name { + format!("{:?}", parameter_23_name).into() + } else { + String::new().into() + }, + if let Some(parameter_23_value) = &self.parameter_23_value { + format!("{:?}", parameter_23_value).into() + } else { + String::new().into() + }, + if let Some(parameter_24_name) = &self.parameter_24_name { + format!("{:?}", parameter_24_name).into() + } else { + String::new().into() + }, + if let Some(parameter_24_value) = &self.parameter_24_value { + format!("{:?}", parameter_24_value).into() + } else { + String::new().into() + }, + if let Some(parameter_25_name) = &self.parameter_25_name { + format!("{:?}", parameter_25_name).into() + } else { + String::new().into() + }, + if let Some(parameter_25_value) = &self.parameter_25_value { + format!("{:?}", parameter_25_value).into() + } else { + String::new().into() + }, + if let Some(parameter_26_name) = &self.parameter_26_name { + format!("{:?}", parameter_26_name).into() + } else { + String::new().into() + }, + if let Some(parameter_26_value) = &self.parameter_26_value { + format!("{:?}", parameter_26_value).into() + } else { + String::new().into() + }, + if let Some(parameter_27_name) = &self.parameter_27_name { + format!("{:?}", parameter_27_name).into() + } else { + String::new().into() + }, + if let Some(parameter_27_value) = &self.parameter_27_value { + format!("{:?}", parameter_27_value).into() + } else { + String::new().into() + }, + if let Some(parameter_28_name) = &self.parameter_28_name { + format!("{:?}", parameter_28_name).into() + } else { + String::new().into() + }, + if let Some(parameter_28_value) = &self.parameter_28_value { + format!("{:?}", parameter_28_value).into() + } else { + String::new().into() + }, + if let Some(parameter_29_name) = &self.parameter_29_name { + format!("{:?}", parameter_29_name).into() + } else { + String::new().into() + }, + if let Some(parameter_29_value) = &self.parameter_29_value { + format!("{:?}", parameter_29_value).into() + } else { + String::new().into() + }, + if let Some(parameter_30_name) = &self.parameter_30_name { + format!("{:?}", parameter_30_name).into() + } else { + String::new().into() + }, + if let Some(parameter_30_value) = &self.parameter_30_value { + format!("{:?}", parameter_30_value).into() + } else { + String::new().into() + }, + if let Some(parameter_31_name) = &self.parameter_31_name { + format!("{:?}", parameter_31_name).into() + } else { + String::new().into() + }, + if let Some(parameter_31_value) = &self.parameter_31_value { + format!("{:?}", parameter_31_value).into() + } else { + String::new().into() + }, + if let Some(parameter_32_name) = &self.parameter_32_name { + format!("{:?}", parameter_32_name).into() + } else { + String::new().into() + }, + if let Some(parameter_32_value) = &self.parameter_32_value { + format!("{:?}", parameter_32_value).into() + } else { + String::new().into() + }, + if let Some(parameter_33_name) = &self.parameter_33_name { + format!("{:?}", parameter_33_name).into() + } else { + String::new().into() + }, + if let Some(parameter_33_value) = &self.parameter_33_value { + format!("{:?}", parameter_33_value).into() + } else { + String::new().into() + }, + if let Some(parameter_34_name) = &self.parameter_34_name { + format!("{:?}", parameter_34_name).into() + } else { + String::new().into() + }, + if let Some(parameter_34_value) = &self.parameter_34_value { + format!("{:?}", parameter_34_value).into() + } else { + String::new().into() + }, + if let Some(parameter_35_name) = &self.parameter_35_name { + format!("{:?}", parameter_35_name).into() + } else { + String::new().into() + }, + if let Some(parameter_35_value) = &self.parameter_35_value { + format!("{:?}", parameter_35_value).into() + } else { + String::new().into() + }, + if let Some(parameter_36_name) = &self.parameter_36_name { + format!("{:?}", parameter_36_name).into() + } else { + String::new().into() + }, + if let Some(parameter_36_value) = &self.parameter_36_value { + format!("{:?}", parameter_36_value).into() + } else { + String::new().into() + }, + if let Some(parameter_37_name) = &self.parameter_37_name { + format!("{:?}", parameter_37_name).into() + } else { + String::new().into() + }, + if let Some(parameter_37_value) = &self.parameter_37_value { + format!("{:?}", parameter_37_value).into() + } else { + String::new().into() + }, + if let Some(parameter_38_name) = &self.parameter_38_name { + format!("{:?}", parameter_38_name).into() + } else { + String::new().into() + }, + if let Some(parameter_38_value) = &self.parameter_38_value { + format!("{:?}", parameter_38_value).into() + } else { + String::new().into() + }, + if let Some(parameter_39_name) = &self.parameter_39_name { + format!("{:?}", parameter_39_name).into() + } else { + String::new().into() + }, + if let Some(parameter_39_value) = &self.parameter_39_value { + format!("{:?}", parameter_39_value).into() + } else { + String::new().into() + }, + if let Some(parameter_40_name) = &self.parameter_40_name { + format!("{:?}", parameter_40_name).into() + } else { + String::new().into() + }, + if let Some(parameter_40_value) = &self.parameter_40_value { + format!("{:?}", parameter_40_value).into() + } else { + String::new().into() + }, + if let Some(parameter_41_name) = &self.parameter_41_name { + format!("{:?}", parameter_41_name).into() + } else { + String::new().into() + }, + if let Some(parameter_41_value) = &self.parameter_41_value { + format!("{:?}", parameter_41_value).into() + } else { + String::new().into() + }, + if let Some(parameter_42_name) = &self.parameter_42_name { + format!("{:?}", parameter_42_name).into() + } else { + String::new().into() + }, + if let Some(parameter_42_value) = &self.parameter_42_value { + format!("{:?}", parameter_42_value).into() + } else { + String::new().into() + }, + if let Some(parameter_43_name) = &self.parameter_43_name { + format!("{:?}", parameter_43_name).into() + } else { + String::new().into() + }, + if let Some(parameter_43_value) = &self.parameter_43_value { + format!("{:?}", parameter_43_value).into() + } else { + String::new().into() + }, + if let Some(parameter_44_name) = &self.parameter_44_name { + format!("{:?}", parameter_44_name).into() + } else { + String::new().into() + }, + if let Some(parameter_44_value) = &self.parameter_44_value { + format!("{:?}", parameter_44_value).into() + } else { + String::new().into() + }, + if let Some(parameter_45_name) = &self.parameter_45_name { + format!("{:?}", parameter_45_name).into() + } else { + String::new().into() + }, + if let Some(parameter_45_value) = &self.parameter_45_value { + format!("{:?}", parameter_45_value).into() + } else { + String::new().into() + }, + if let Some(parameter_46_name) = &self.parameter_46_name { + format!("{:?}", parameter_46_name).into() + } else { + String::new().into() + }, + if let Some(parameter_46_value) = &self.parameter_46_value { + format!("{:?}", parameter_46_value).into() + } else { + String::new().into() + }, + if let Some(parameter_47_name) = &self.parameter_47_name { + format!("{:?}", parameter_47_name).into() + } else { + String::new().into() + }, + if let Some(parameter_47_value) = &self.parameter_47_value { + format!("{:?}", parameter_47_value).into() + } else { + String::new().into() + }, + if let Some(parameter_48_name) = &self.parameter_48_name { + format!("{:?}", parameter_48_name).into() + } else { + String::new().into() + }, + if let Some(parameter_48_value) = &self.parameter_48_value { + format!("{:?}", parameter_48_value).into() + } else { + String::new().into() + }, + if let Some(parameter_49_name) = &self.parameter_49_name { + format!("{:?}", parameter_49_name).into() + } else { + String::new().into() + }, + if let Some(parameter_49_value) = &self.parameter_49_value { + format!("{:?}", parameter_49_value).into() + } else { + String::new().into() + }, + if let Some(parameter_50_name) = &self.parameter_50_name { + format!("{:?}", parameter_50_name).into() + } else { + String::new().into() + }, + if let Some(parameter_50_value) = &self.parameter_50_value { + format!("{:?}", parameter_50_value).into() + } else { + String::new().into() + }, + if let Some(parameter_51_name) = &self.parameter_51_name { + format!("{:?}", parameter_51_name).into() + } else { + String::new().into() + }, + if let Some(parameter_51_value) = &self.parameter_51_value { + format!("{:?}", parameter_51_value).into() + } else { + String::new().into() + }, + if let Some(parameter_52_name) = &self.parameter_52_name { + format!("{:?}", parameter_52_name).into() + } else { + String::new().into() + }, + if let Some(parameter_52_value) = &self.parameter_52_value { + format!("{:?}", parameter_52_value).into() + } else { + String::new().into() + }, + if let Some(parameter_53_name) = &self.parameter_53_name { + format!("{:?}", parameter_53_name).into() + } else { + String::new().into() + }, + if let Some(parameter_53_value) = &self.parameter_53_value { + format!("{:?}", parameter_53_value).into() + } else { + String::new().into() + }, + if let Some(parameter_54_name) = &self.parameter_54_name { + format!("{:?}", parameter_54_name).into() + } else { + String::new().into() + }, + if let Some(parameter_54_value) = &self.parameter_54_value { + format!("{:?}", parameter_54_value).into() + } else { + String::new().into() + }, + if let Some(parameter_55_name) = &self.parameter_55_name { + format!("{:?}", parameter_55_name).into() + } else { + String::new().into() + }, + if let Some(parameter_55_value) = &self.parameter_55_value { + format!("{:?}", parameter_55_value).into() + } else { + String::new().into() + }, + if let Some(parameter_56_name) = &self.parameter_56_name { + format!("{:?}", parameter_56_name).into() + } else { + String::new().into() + }, + if let Some(parameter_56_value) = &self.parameter_56_value { + format!("{:?}", parameter_56_value).into() + } else { + String::new().into() + }, + if let Some(parameter_57_name) = &self.parameter_57_name { + format!("{:?}", parameter_57_name).into() + } else { + String::new().into() + }, + if let Some(parameter_57_value) = &self.parameter_57_value { + format!("{:?}", parameter_57_value).into() + } else { + String::new().into() + }, + if let Some(parameter_58_name) = &self.parameter_58_name { + format!("{:?}", parameter_58_name).into() + } else { + String::new().into() + }, + if let Some(parameter_58_value) = &self.parameter_58_value { + format!("{:?}", parameter_58_value).into() + } else { + String::new().into() + }, + if let Some(parameter_59_name) = &self.parameter_59_name { + format!("{:?}", parameter_59_name).into() + } else { + String::new().into() + }, + if let Some(parameter_59_value) = &self.parameter_59_value { + format!("{:?}", parameter_59_value).into() + } else { + String::new().into() + }, + if let Some(parameter_60_name) = &self.parameter_60_name { + format!("{:?}", parameter_60_name).into() + } else { + String::new().into() + }, + if let Some(parameter_60_value) = &self.parameter_60_value { + format!("{:?}", parameter_60_value).into() + } else { + String::new().into() + }, + if let Some(parameter_61_name) = &self.parameter_61_name { + format!("{:?}", parameter_61_name).into() + } else { + String::new().into() + }, + if let Some(parameter_61_value) = &self.parameter_61_value { + format!("{:?}", parameter_61_value).into() + } else { + String::new().into() + }, + if let Some(parameter_62_name) = &self.parameter_62_name { + format!("{:?}", parameter_62_name).into() + } else { + String::new().into() + }, + if let Some(parameter_62_value) = &self.parameter_62_value { + format!("{:?}", parameter_62_value).into() + } else { + String::new().into() + }, + if let Some(parameter_63_name) = &self.parameter_63_name { + format!("{:?}", parameter_63_name).into() + } else { + String::new().into() + }, + if let Some(parameter_63_value) = &self.parameter_63_value { + format!("{:?}", parameter_63_value).into() + } else { + String::new().into() + }, + if let Some(parameter_64_name) = &self.parameter_64_name { + format!("{:?}", parameter_64_name).into() + } else { + String::new().into() + }, + if let Some(parameter_64_value) = &self.parameter_64_value { + format!("{:?}", parameter_64_value).into() + } else { + String::new().into() + }, + if let Some(parameter_65_name) = &self.parameter_65_name { + format!("{:?}", parameter_65_name).into() + } else { + String::new().into() + }, + if let Some(parameter_65_value) = &self.parameter_65_value { + format!("{:?}", parameter_65_value).into() + } else { + String::new().into() + }, + if let Some(parameter_66_name) = &self.parameter_66_name { + format!("{:?}", parameter_66_name).into() + } else { + String::new().into() + }, + if let Some(parameter_66_value) = &self.parameter_66_value { + format!("{:?}", parameter_66_value).into() + } else { + String::new().into() + }, + if let Some(parameter_67_name) = &self.parameter_67_name { + format!("{:?}", parameter_67_name).into() + } else { + String::new().into() + }, + if let Some(parameter_67_value) = &self.parameter_67_value { + format!("{:?}", parameter_67_value).into() + } else { + String::new().into() + }, + if let Some(parameter_68_name) = &self.parameter_68_name { + format!("{:?}", parameter_68_name).into() + } else { + String::new().into() + }, + if let Some(parameter_68_value) = &self.parameter_68_value { + format!("{:?}", parameter_68_value).into() + } else { + String::new().into() + }, + if let Some(parameter_69_name) = &self.parameter_69_name { + format!("{:?}", parameter_69_name).into() + } else { + String::new().into() + }, + if let Some(parameter_69_value) = &self.parameter_69_value { + format!("{:?}", parameter_69_value).into() + } else { + String::new().into() + }, + if let Some(parameter_70_name) = &self.parameter_70_name { + format!("{:?}", parameter_70_name).into() + } else { + String::new().into() + }, + if let Some(parameter_70_value) = &self.parameter_70_value { + format!("{:?}", parameter_70_value).into() + } else { + String::new().into() + }, + if let Some(parameter_71_name) = &self.parameter_71_name { + format!("{:?}", parameter_71_name).into() + } else { + String::new().into() + }, + if let Some(parameter_71_value) = &self.parameter_71_value { + format!("{:?}", parameter_71_value).into() + } else { + String::new().into() + }, + if let Some(parameter_72_name) = &self.parameter_72_name { + format!("{:?}", parameter_72_name).into() + } else { + String::new().into() + }, + if let Some(parameter_72_value) = &self.parameter_72_value { + format!("{:?}", parameter_72_value).into() + } else { + String::new().into() + }, + if let Some(parameter_73_name) = &self.parameter_73_name { + format!("{:?}", parameter_73_name).into() + } else { + String::new().into() + }, + if let Some(parameter_73_value) = &self.parameter_73_value { + format!("{:?}", parameter_73_value).into() + } else { + String::new().into() + }, + if let Some(parameter_74_name) = &self.parameter_74_name { + format!("{:?}", parameter_74_name).into() + } else { + String::new().into() + }, + if let Some(parameter_74_value) = &self.parameter_74_value { + format!("{:?}", parameter_74_value).into() + } else { + String::new().into() + }, + if let Some(parameter_75_name) = &self.parameter_75_name { + format!("{:?}", parameter_75_name).into() + } else { + String::new().into() + }, + if let Some(parameter_75_value) = &self.parameter_75_value { + format!("{:?}", parameter_75_value).into() + } else { + String::new().into() + }, + if let Some(parameter_76_name) = &self.parameter_76_name { + format!("{:?}", parameter_76_name).into() + } else { + String::new().into() + }, + if let Some(parameter_76_value) = &self.parameter_76_value { + format!("{:?}", parameter_76_value).into() + } else { + String::new().into() + }, + if let Some(parameter_77_name) = &self.parameter_77_name { + format!("{:?}", parameter_77_name).into() + } else { + String::new().into() + }, + if let Some(parameter_77_value) = &self.parameter_77_value { + format!("{:?}", parameter_77_value).into() + } else { + String::new().into() + }, + if let Some(parameter_78_name) = &self.parameter_78_name { + format!("{:?}", parameter_78_name).into() + } else { + String::new().into() + }, + if let Some(parameter_78_value) = &self.parameter_78_value { + format!("{:?}", parameter_78_value).into() + } else { + String::new().into() + }, + if let Some(parameter_79_name) = &self.parameter_79_name { + format!("{:?}", parameter_79_name).into() + } else { + String::new().into() + }, + if let Some(parameter_79_value) = &self.parameter_79_value { + format!("{:?}", parameter_79_value).into() + } else { + String::new().into() + }, + if let Some(parameter_80_name) = &self.parameter_80_name { + format!("{:?}", parameter_80_name).into() + } else { + String::new().into() + }, + if let Some(parameter_80_value) = &self.parameter_80_value { + format!("{:?}", parameter_80_value).into() + } else { + String::new().into() + }, + if let Some(parameter_81_name) = &self.parameter_81_name { + format!("{:?}", parameter_81_name).into() + } else { + String::new().into() + }, + if let Some(parameter_81_value) = &self.parameter_81_value { + format!("{:?}", parameter_81_value).into() + } else { + String::new().into() + }, + if let Some(parameter_82_name) = &self.parameter_82_name { + format!("{:?}", parameter_82_name).into() + } else { + String::new().into() + }, + if let Some(parameter_82_value) = &self.parameter_82_value { + format!("{:?}", parameter_82_value).into() + } else { + String::new().into() + }, + if let Some(parameter_83_name) = &self.parameter_83_name { + format!("{:?}", parameter_83_name).into() + } else { + String::new().into() + }, + if let Some(parameter_83_value) = &self.parameter_83_value { + format!("{:?}", parameter_83_value).into() + } else { + String::new().into() + }, + if let Some(parameter_84_name) = &self.parameter_84_name { + format!("{:?}", parameter_84_name).into() + } else { + String::new().into() + }, + if let Some(parameter_84_value) = &self.parameter_84_value { + format!("{:?}", parameter_84_value).into() + } else { + String::new().into() + }, + if let Some(parameter_85_name) = &self.parameter_85_name { + format!("{:?}", parameter_85_name).into() + } else { + String::new().into() + }, + if let Some(parameter_85_value) = &self.parameter_85_value { + format!("{:?}", parameter_85_value).into() + } else { + String::new().into() + }, + if let Some(parameter_86_name) = &self.parameter_86_name { + format!("{:?}", parameter_86_name).into() + } else { + String::new().into() + }, + if let Some(parameter_86_value) = &self.parameter_86_value { + format!("{:?}", parameter_86_value).into() + } else { + String::new().into() + }, + if let Some(parameter_87_name) = &self.parameter_87_name { + format!("{:?}", parameter_87_name).into() + } else { + String::new().into() + }, + if let Some(parameter_87_value) = &self.parameter_87_value { + format!("{:?}", parameter_87_value).into() + } else { + String::new().into() + }, + if let Some(parameter_88_name) = &self.parameter_88_name { + format!("{:?}", parameter_88_name).into() + } else { + String::new().into() + }, + if let Some(parameter_88_value) = &self.parameter_88_value { + format!("{:?}", parameter_88_value).into() + } else { + String::new().into() + }, + if let Some(parameter_89_name) = &self.parameter_89_name { + format!("{:?}", parameter_89_name).into() + } else { + String::new().into() + }, + if let Some(parameter_89_value) = &self.parameter_89_value { + format!("{:?}", parameter_89_value).into() + } else { + String::new().into() + }, + if let Some(parameter_90_name) = &self.parameter_90_name { + format!("{:?}", parameter_90_name).into() + } else { + String::new().into() + }, + if let Some(parameter_90_value) = &self.parameter_90_value { + format!("{:?}", parameter_90_value).into() + } else { + String::new().into() + }, + if let Some(parameter_91_name) = &self.parameter_91_name { + format!("{:?}", parameter_91_name).into() + } else { + String::new().into() + }, + if let Some(parameter_91_value) = &self.parameter_91_value { + format!("{:?}", parameter_91_value).into() + } else { + String::new().into() + }, + if let Some(parameter_92_name) = &self.parameter_92_name { + format!("{:?}", parameter_92_name).into() + } else { + String::new().into() + }, + if let Some(parameter_92_value) = &self.parameter_92_value { + format!("{:?}", parameter_92_value).into() + } else { + String::new().into() + }, + if let Some(parameter_93_name) = &self.parameter_93_name { + format!("{:?}", parameter_93_name).into() + } else { + String::new().into() + }, + if let Some(parameter_93_value) = &self.parameter_93_value { + format!("{:?}", parameter_93_value).into() + } else { + String::new().into() + }, + if let Some(parameter_94_name) = &self.parameter_94_name { + format!("{:?}", parameter_94_name).into() + } else { + String::new().into() + }, + if let Some(parameter_94_value) = &self.parameter_94_value { + format!("{:?}", parameter_94_value).into() + } else { + String::new().into() + }, + if let Some(parameter_95_name) = &self.parameter_95_name { + format!("{:?}", parameter_95_name).into() + } else { + String::new().into() + }, + if let Some(parameter_95_value) = &self.parameter_95_value { + format!("{:?}", parameter_95_value).into() + } else { + String::new().into() + }, + if let Some(parameter_96_name) = &self.parameter_96_name { + format!("{:?}", parameter_96_name).into() + } else { + String::new().into() + }, + if let Some(parameter_96_value) = &self.parameter_96_value { + format!("{:?}", parameter_96_value).into() + } else { + String::new().into() + }, + if let Some(parameter_97_name) = &self.parameter_97_name { + format!("{:?}", parameter_97_name).into() + } else { + String::new().into() + }, + if let Some(parameter_97_value) = &self.parameter_97_value { + format!("{:?}", parameter_97_value).into() + } else { + String::new().into() + }, + if let Some(parameter_98_name) = &self.parameter_98_name { + format!("{:?}", parameter_98_name).into() + } else { + String::new().into() + }, + if let Some(parameter_98_value) = &self.parameter_98_value { + format!("{:?}", parameter_98_value).into() + } else { + String::new().into() + }, + if let Some(parameter_99_name) = &self.parameter_99_name { + format!("{:?}", parameter_99_name).into() + } else { + String::new().into() + }, + if let Some(parameter_99_value) = &self.parameter_99_value { + format!("{:?}", parameter_99_value).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "url".into(), + "name".into(), + "track".into(), + "status_callback".into(), + "status_callback_method".into(), + "parameter_1_name".into(), + "parameter_1_value".into(), + "parameter_2_name".into(), + "parameter_2_value".into(), + "parameter_3_name".into(), + "parameter_3_value".into(), + "parameter_4_name".into(), + "parameter_4_value".into(), + "parameter_5_name".into(), + "parameter_5_value".into(), + "parameter_6_name".into(), + "parameter_6_value".into(), + "parameter_7_name".into(), + "parameter_7_value".into(), + "parameter_8_name".into(), + "parameter_8_value".into(), + "parameter_9_name".into(), + "parameter_9_value".into(), + "parameter_10_name".into(), + "parameter_10_value".into(), + "parameter_11_name".into(), + "parameter_11_value".into(), + "parameter_12_name".into(), + "parameter_12_value".into(), + "parameter_13_name".into(), + "parameter_13_value".into(), + "parameter_14_name".into(), + "parameter_14_value".into(), + "parameter_15_name".into(), + "parameter_15_value".into(), + "parameter_16_name".into(), + "parameter_16_value".into(), + "parameter_17_name".into(), + "parameter_17_value".into(), + "parameter_18_name".into(), + "parameter_18_value".into(), + "parameter_19_name".into(), + "parameter_19_value".into(), + "parameter_20_name".into(), + "parameter_20_value".into(), + "parameter_21_name".into(), + "parameter_21_value".into(), + "parameter_22_name".into(), + "parameter_22_value".into(), + "parameter_23_name".into(), + "parameter_23_value".into(), + "parameter_24_name".into(), + "parameter_24_value".into(), + "parameter_25_name".into(), + "parameter_25_value".into(), + "parameter_26_name".into(), + "parameter_26_value".into(), + "parameter_27_name".into(), + "parameter_27_value".into(), + "parameter_28_name".into(), + "parameter_28_value".into(), + "parameter_29_name".into(), + "parameter_29_value".into(), + "parameter_30_name".into(), + "parameter_30_value".into(), + "parameter_31_name".into(), + "parameter_31_value".into(), + "parameter_32_name".into(), + "parameter_32_value".into(), + "parameter_33_name".into(), + "parameter_33_value".into(), + "parameter_34_name".into(), + "parameter_34_value".into(), + "parameter_35_name".into(), + "parameter_35_value".into(), + "parameter_36_name".into(), + "parameter_36_value".into(), + "parameter_37_name".into(), + "parameter_37_value".into(), + "parameter_38_name".into(), + "parameter_38_value".into(), + "parameter_39_name".into(), + "parameter_39_value".into(), + "parameter_40_name".into(), + "parameter_40_value".into(), + "parameter_41_name".into(), + "parameter_41_value".into(), + "parameter_42_name".into(), + "parameter_42_value".into(), + "parameter_43_name".into(), + "parameter_43_value".into(), + "parameter_44_name".into(), + "parameter_44_value".into(), + "parameter_45_name".into(), + "parameter_45_value".into(), + "parameter_46_name".into(), + "parameter_46_value".into(), + "parameter_47_name".into(), + "parameter_47_value".into(), + "parameter_48_name".into(), + "parameter_48_value".into(), + "parameter_49_name".into(), + "parameter_49_value".into(), + "parameter_50_name".into(), + "parameter_50_value".into(), + "parameter_51_name".into(), + "parameter_51_value".into(), + "parameter_52_name".into(), + "parameter_52_value".into(), + "parameter_53_name".into(), + "parameter_53_value".into(), + "parameter_54_name".into(), + "parameter_54_value".into(), + "parameter_55_name".into(), + "parameter_55_value".into(), + "parameter_56_name".into(), + "parameter_56_value".into(), + "parameter_57_name".into(), + "parameter_57_value".into(), + "parameter_58_name".into(), + "parameter_58_value".into(), + "parameter_59_name".into(), + "parameter_59_value".into(), + "parameter_60_name".into(), + "parameter_60_value".into(), + "parameter_61_name".into(), + "parameter_61_value".into(), + "parameter_62_name".into(), + "parameter_62_value".into(), + "parameter_63_name".into(), + "parameter_63_value".into(), + "parameter_64_name".into(), + "parameter_64_value".into(), + "parameter_65_name".into(), + "parameter_65_value".into(), + "parameter_66_name".into(), + "parameter_66_value".into(), + "parameter_67_name".into(), + "parameter_67_value".into(), + "parameter_68_name".into(), + "parameter_68_value".into(), + "parameter_69_name".into(), + "parameter_69_value".into(), + "parameter_70_name".into(), + "parameter_70_value".into(), + "parameter_71_name".into(), + "parameter_71_value".into(), + "parameter_72_name".into(), + "parameter_72_value".into(), + "parameter_73_name".into(), + "parameter_73_value".into(), + "parameter_74_name".into(), + "parameter_74_value".into(), + "parameter_75_name".into(), + "parameter_75_value".into(), + "parameter_76_name".into(), + "parameter_76_value".into(), + "parameter_77_name".into(), + "parameter_77_value".into(), + "parameter_78_name".into(), + "parameter_78_value".into(), + "parameter_79_name".into(), + "parameter_79_value".into(), + "parameter_80_name".into(), + "parameter_80_value".into(), + "parameter_81_name".into(), + "parameter_81_value".into(), + "parameter_82_name".into(), + "parameter_82_value".into(), + "parameter_83_name".into(), + "parameter_83_value".into(), + "parameter_84_name".into(), + "parameter_84_value".into(), + "parameter_85_name".into(), + "parameter_85_value".into(), + "parameter_86_name".into(), + "parameter_86_value".into(), + "parameter_87_name".into(), + "parameter_87_value".into(), + "parameter_88_name".into(), + "parameter_88_value".into(), + "parameter_89_name".into(), + "parameter_89_value".into(), + "parameter_90_name".into(), + "parameter_90_value".into(), + "parameter_91_name".into(), + "parameter_91_value".into(), + "parameter_92_name".into(), + "parameter_92_value".into(), + "parameter_93_name".into(), + "parameter_93_value".into(), + "parameter_94_name".into(), + "parameter_94_value".into(), + "parameter_95_name".into(), + "parameter_95_value".into(), + "parameter_96_name".into(), + "parameter_96_value".into(), + "parameter_97_name".into(), + "parameter_97_value".into(), + "parameter_98_name".into(), + "parameter_98_value".into(), + "parameter_99_name".into(), + "parameter_99_value".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateStreamRequest { + #[serde(rename = "Status")] + pub status: StreamEnumUpdateStatus, +} + +impl std::fmt::Display for UpdateStreamRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateStreamRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![format!("{:?}", self.status).into()] + } + + fn headers() -> Vec> { + vec!["status".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateTokenRequest { + #[doc = "The duration in seconds for which the generated credentials are valid. The default \ + value is 86400 (24 hours)."] + #[serde(rename = "Ttl", default, skip_serializing_if = "Option::is_none")] + pub ttl: Option, +} + +impl std::fmt::Display for CreateTokenRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateTokenRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(ttl) = &self.ttl { + format!("{:?}", ttl).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["ttl".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListTranscriptionResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub transcriptions: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListTranscriptionResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListTranscriptionResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(transcriptions) = &self.transcriptions { + format!("{:?}", transcriptions).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "transcriptions".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordAllTimeResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordAllTimeResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordAllTimeResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordDailyResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordDailyResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordDailyResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordLastMonthResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordLastMonthResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordLastMonthResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordMonthlyResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordMonthlyResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordMonthlyResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordThisMonthResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordThisMonthResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordThisMonthResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordTodayResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordTodayResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordTodayResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordYearlyResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordYearlyResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordYearlyResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageRecordYesterdayResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_records: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageRecordYesterdayResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageRecordYesterdayResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_records) = &self.usage_records { + format!("{:?}", usage_records).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_records".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the \ + default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UpdateUsageTriggerRequestCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UpdateUsageTriggerRequest { + #[doc = "The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and \ + the default is `POST`."] + #[serde( + rename = "CallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_method: Option, + #[doc = "The URL we should call using `callback_method` when the trigger fires."] + #[serde( + rename = "CallbackUrl", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_url: Option, + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, +} + +impl std::fmt::Display for UpdateUsageTriggerRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UpdateUsageTriggerRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(callback_method) = &self.callback_method { + format!("{:?}", callback_method).into() + } else { + String::new().into() + }, + if let Some(callback_url) = &self.callback_url { + format!("{:?}", callback_url).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "callback_method".into(), + "callback_url".into(), + "friendly_name".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ListUsageTriggerResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage_triggers: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_page_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl std::fmt::Display for ListUsageTriggerResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ListUsageTriggerResponse { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(usage_triggers) = &self.usage_triggers { + format!("{:?}", usage_triggers).into() + } else { + String::new().into() + }, + if let Some(end) = &self.end { + format!("{:?}", end).into() + } else { + String::new().into() + }, + if let Some(first_page_uri) = &self.first_page_uri { + format!("{:?}", first_page_uri).into() + } else { + String::new().into() + }, + if let Some(next_page_uri) = &self.next_page_uri { + format!("{:?}", next_page_uri).into() + } else { + String::new().into() + }, + if let Some(page) = &self.page { + format!("{:?}", page).into() + } else { + String::new().into() + }, + if let Some(page_size) = &self.page_size { + format!("{:?}", page_size).into() + } else { + String::new().into() + }, + if let Some(previous_page_uri) = &self.previous_page_uri { + format!("{:?}", previous_page_uri).into() + } else { + String::new().into() + }, + if let Some(start) = &self.start { + format!("{:?}", start).into() + } else { + String::new().into() + }, + if let Some(uri) = &self.uri { + format!("{:?}", uri).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "usage_triggers".into(), + "end".into(), + "first_page_uri".into(), + "next_page_uri".into(), + "page".into(), + "page_size".into(), + "previous_page_uri".into(), + "start".into(), + "uri".into(), + ] + } +} + +#[doc = "The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the \ + default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateUsageTriggerRequestCallbackMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateUsageTriggerRequest { + #[doc = "The URL we should call using `callback_method` when the trigger fires."] + #[serde(rename = "CallbackUrl")] + pub callback_url: String, + #[doc = "The usage value at which the trigger should fire. For convenience, you can use an \ + offset value such as `+30` to specify a trigger_value that is 30 units more than the \ + current usage value. Be sure to urlencode a `+` as `%2B`."] + #[serde(rename = "TriggerValue")] + pub trigger_value: String, + #[serde(rename = "UsageCategory")] + pub usage_category: UsageTriggerEnumUsageCategory, + #[doc = "The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and \ + the default is `POST`."] + #[serde( + rename = "CallbackMethod", + default, + skip_serializing_if = "Option::is_none" + )] + pub callback_method: Option, + #[doc = "A descriptive string that you create to describe the resource. It can be up to 64 \ + characters long."] + #[serde( + rename = "FriendlyName", + default, + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option, + #[serde(rename = "Recurring", default, skip_serializing_if = "Option::is_none")] + pub recurring: Option, + #[serde(rename = "TriggerBy", default, skip_serializing_if = "Option::is_none")] + pub trigger_by: Option, +} + +impl std::fmt::Display for CreateUsageTriggerRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateUsageTriggerRequest { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + self.callback_url.clone().into(), + self.trigger_value.clone().into(), + format!("{:?}", self.usage_category).into(), + if let Some(callback_method) = &self.callback_method { + format!("{:?}", callback_method).into() + } else { + String::new().into() + }, + if let Some(friendly_name) = &self.friendly_name { + format!("{:?}", friendly_name).into() + } else { + String::new().into() + }, + if let Some(recurring) = &self.recurring { + format!("{:?}", recurring).into() + } else { + String::new().into() + }, + if let Some(trigger_by) = &self.trigger_by { + format!("{:?}", trigger_by).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "callback_url".into(), + "trigger_value".into(), + "usage_category".into(), + "callback_method".into(), + "friendly_name".into(), + "recurring".into(), + "trigger_by".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateUserDefinedMessageRequest { + #[doc = "The User Defined Message in the form of URL-encoded JSON string."] + #[serde(rename = "Content")] + pub content: String, + #[doc = "A unique string value to identify API call. This should be a unique string value per \ + API call and can be a randomly generated."] + #[serde( + rename = "IdempotencyKey", + default, + skip_serializing_if = "Option::is_none" + )] + pub idempotency_key: Option, +} + +impl std::fmt::Display for CreateUserDefinedMessageRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateUserDefinedMessageRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.content.clone().into(), + if let Some(idempotency_key) = &self.idempotency_key { + format!("{:?}", idempotency_key).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["content".into(), "idempotency_key".into()] + } +} + +#[doc = "The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. \ + Default is `POST`."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CreateUserDefinedMessageSubscriptionRequestMethod { + #[serde(rename = "HEAD")] + #[display("HEAD")] + Head, + #[serde(rename = "GET")] + #[display("GET")] + Get, + #[serde(rename = "POST")] + #[display("POST")] + Post, + #[serde(rename = "PATCH")] + #[display("PATCH")] + Patch, + #[serde(rename = "PUT")] + #[display("PUT")] + Put, + #[serde(rename = "DELETE")] + #[display("DELETE")] + Delete, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CreateUserDefinedMessageSubscriptionRequest { + #[doc = "The URL we should call using the `method` to send user defined events to your \ + application. URLs must contain a valid hostname (underscores are not permitted)."] + #[serde(rename = "Callback")] + pub callback: String, + #[doc = "A unique string value to identify API call. This should be a unique string value per \ + API call and can be a randomly generated."] + #[serde( + rename = "IdempotencyKey", + default, + skip_serializing_if = "Option::is_none" + )] + pub idempotency_key: Option, + #[doc = "The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or \ + `POST`. Default is `POST`."] + #[serde(rename = "Method", default, skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +impl std::fmt::Display for CreateUserDefinedMessageSubscriptionRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CreateUserDefinedMessageSubscriptionRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + self.callback.clone().into(), + if let Some(idempotency_key) = &self.idempotency_key { + format!("{:?}", idempotency_key).into() + } else { + String::new().into() + }, + if let Some(method) = &self.method { + format!("{:?}", method).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["callback".into(), "idempotency_key".into(), "method".into()] + } +}