pub struct MessageTemplates {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl MessageTemplates
impl MessageTemplates
Sourcepub async fn get_child_templates<'a>(
&'a self,
message_template_folder_id: &'a str,
) -> Result<GetChildTemplatesResponse, Error>
pub async fn get_child_templates<'a>( &'a self, message_template_folder_id: &'a str, ) -> Result<GetChildTemplatesResponse, Error>
Get child templates
Fetch the child message templates of a message template folder.
Parameters:
message_template_folder_id: &'astr
: The message template folder ID (required)
async fn example_message_templates_get_child_templates() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::GetChildTemplatesResponse = client
.message_templates()
.get_child_templates("some-string")
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_child_template<'a>(
&'a self,
message_template_folder_id: &'a str,
body: &CreateMessageTemplateAsChild,
) -> Result<MessageTemplateResponse, Error>
pub async fn create_child_template<'a>( &'a self, message_template_folder_id: &'a str, body: &CreateMessageTemplateAsChild, ) -> Result<MessageTemplateResponse, Error>
Create child template
Create a new message template as a child of the given folder
Parameters:
message_template_folder_id: &'astr
: The parent message template folder ID (required)
async fn example_message_templates_create_child_template() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::MessageTemplateResponse = client
.message_templates()
.create_child_template(
"some-string",
&front_api::types::CreateMessageTemplateAsChild {
name: "some-string".to_string(),
subject: Some("some-string".to_string()),
body: "some-string".to_string(),
inbox_ids: Some(vec!["some-string".to_string()]),
},
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list<'a>(&'a self) -> Result<ListMessageTemplatesResponse, Error>
pub async fn list<'a>(&'a self) -> Result<ListMessageTemplatesResponse, Error>
List message templates
List the message templates.
async fn example_message_templates_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListMessageTemplatesResponse =
client.message_templates().list().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create<'a>(
&'a self,
body: &CreateSharedMessageTemplate,
) -> Result<MessageTemplateResponse, Error>
pub async fn create<'a>( &'a self, body: &CreateSharedMessageTemplate, ) -> Result<MessageTemplateResponse, Error>
Create message template
Create a new message template.
async fn example_message_templates_create() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::MessageTemplateResponse = client
.message_templates()
.create(&front_api::types::CreateSharedMessageTemplate {
name: "some-string".to_string(),
subject: Some("some-string".to_string()),
body: "some-string".to_string(),
folder_id: Some("some-string".to_string()),
inbox_ids: Some(vec!["some-string".to_string()]),
})
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_team<'a>(
&'a self,
team_id: &'a str,
) -> Result<ListTeamMessageTemplatesResponse, Error>
pub async fn list_team<'a>( &'a self, team_id: &'a str, ) -> Result<ListTeamMessageTemplatesResponse, Error>
List team message templates
List the message templates belonging to the requested team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_message_templates_list_team() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeamMessageTemplatesResponse =
client.message_templates().list_team("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_team<'a>(
&'a self,
team_id: &'a str,
body: &CreateSharedMessageTemplate,
) -> Result<MessageTemplateResponse, Error>
pub async fn create_team<'a>( &'a self, team_id: &'a str, body: &CreateSharedMessageTemplate, ) -> Result<MessageTemplateResponse, Error>
Create team message template
Create a new message template for the given team
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_message_templates_create_team() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::MessageTemplateResponse = client
.message_templates()
.create_team(
"some-string",
&front_api::types::CreateSharedMessageTemplate {
name: "some-string".to_string(),
subject: Some("some-string".to_string()),
body: "some-string".to_string(),
folder_id: Some("some-string".to_string()),
inbox_ids: Some(vec!["some-string".to_string()]),
},
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_teammate<'a>(
&'a self,
teammate_id: &'a str,
) -> Result<ListTeammateMessageTemplatesResponse, Error>
pub async fn list_teammate<'a>( &'a self, teammate_id: &'a str, ) -> Result<ListTeammateMessageTemplatesResponse, Error>
List teammate message templates
List the message templates belonging to the requested teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_message_templates_list_teammate() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeammateMessageTemplatesResponse = client
.message_templates()
.list_teammate("some-string")
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_teammate<'a>(
&'a self,
teammate_id: &'a str,
body: &CreatePrivateMessageTemplate,
) -> Result<MessageTemplateResponse, Error>
pub async fn create_teammate<'a>( &'a self, teammate_id: &'a str, body: &CreatePrivateMessageTemplate, ) -> Result<MessageTemplateResponse, Error>
Create teammate message template
Create a new message template for the given teammate
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_message_templates_create_teammate() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::MessageTemplateResponse = client
.message_templates()
.create_teammate(
"some-string",
&front_api::types::CreatePrivateMessageTemplate {
name: "some-string".to_string(),
subject: Some("some-string".to_string()),
body: "some-string".to_string(),
folder_id: Some("some-string".to_string()),
},
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(
&'a self,
message_template_id: &'a str,
) -> Result<MessageTemplateResponse, Error>
pub async fn get<'a>( &'a self, message_template_id: &'a str, ) -> Result<MessageTemplateResponse, Error>
Get message template
Fetch a message template.
Parameters:
message_template_id: &'astr
: The message template ID (required)
async fn example_message_templates_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::MessageTemplateResponse =
client.message_templates().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn delete<'a>(
&'a self,
message_template_id: &'a str,
) -> Result<(), Error>
pub async fn delete<'a>( &'a self, message_template_id: &'a str, ) -> Result<(), Error>
Delete message template
Delete a message template
Parameters:
message_template_id: &'astr
: The message template ID (required)
async fn example_message_templates_delete() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client.message_templates().delete("some-string").await?;
Ok(())
}
Sourcepub async fn update<'a>(
&'a self,
message_template_id: &'a str,
body: &UpdateMessageTemplate,
) -> Result<MessageTemplateResponse, Error>
pub async fn update<'a>( &'a self, message_template_id: &'a str, body: &UpdateMessageTemplate, ) -> Result<MessageTemplateResponse, Error>
Update message template
Update message template
Parameters:
message_template_id: &'astr
: The message template ID (required)
async fn example_message_templates_update() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::MessageTemplateResponse = client
.message_templates()
.update(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
println!("{:?}", result);
Ok(())
}
Trait Implementations§
Source§impl Clone for MessageTemplates
impl Clone for MessageTemplates
Source§fn clone(&self) -> MessageTemplates
fn clone(&self) -> MessageTemplates
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for MessageTemplates
impl !RefUnwindSafe for MessageTemplates
impl Send for MessageTemplates
impl Sync for MessageTemplates
impl Unpin for MessageTemplates
impl !UnwindSafe for MessageTemplates
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more