pub struct Tags {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Tags
impl Tags
Sourcepub async fn list<'a>(&'a self) -> Result<ListTagsResponse, Error>
pub async fn list<'a>(&'a self) -> Result<ListTagsResponse, Error>
List tags
List the tags of the company.
async fn example_tags_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTagsResponse = client.tags().list().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create<'a>(
&'a self,
body: &CreateTag,
) -> Result<TagResponse, Error>
pub async fn create<'a>( &'a self, body: &CreateTag, ) -> Result<TagResponse, Error>
Create tag
Create a tag.
async fn example_tags_create() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::TagResponse = client
.tags()
.create(&front_api::types::CreateTag {
name: "some-string".to_string(),
highlight: Some(front_api::types::Highlight::Orange),
is_visible_in_conversation_lists: Some(false),
})
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_team<'a>(
&'a self,
team_id: &'a str,
) -> Result<ListTeamTagsResponse, Error>
pub async fn list_team<'a>( &'a self, team_id: &'a str, ) -> Result<ListTeamTagsResponse, Error>
List team tags
List the tags for a team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_tags_list_team() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeamTagsResponse = client.tags().list_team("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_team<'a>(
&'a self,
team_id: &'a str,
body: &CreateTag,
) -> Result<TagResponse, Error>
pub async fn create_team<'a>( &'a self, team_id: &'a str, body: &CreateTag, ) -> Result<TagResponse, Error>
Create team tag
Create a tag for a team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_tags_create_team() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::TagResponse = client
.tags()
.create_team(
"some-string",
&front_api::types::CreateTag {
name: "some-string".to_string(),
highlight: Some(front_api::types::Highlight::LightBlue),
is_visible_in_conversation_lists: Some(false),
},
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_teammate<'a>(
&'a self,
teammate_id: &'a str,
) -> Result<ListTeammateTagsResponse, Error>
pub async fn list_teammate<'a>( &'a self, teammate_id: &'a str, ) -> Result<ListTeammateTagsResponse, Error>
List teammate tags
List the tags for a teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_tags_list_teammate() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeammateTagsResponse =
client.tags().list_teammate("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_teammate<'a>(
&'a self,
teammate_id: &'a str,
body: &CreateTag,
) -> Result<TagResponse, Error>
pub async fn create_teammate<'a>( &'a self, teammate_id: &'a str, body: &CreateTag, ) -> Result<TagResponse, Error>
Create teammate tag
Create a tag for a teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_tags_create_teammate() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::TagResponse = client
.tags()
.create_teammate(
"some-string",
&front_api::types::CreateTag {
name: "some-string".to_string(),
highlight: Some(front_api::types::Highlight::Orange),
is_visible_in_conversation_lists: Some(false),
},
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_children<'a>(
&'a self,
tag_id: &'a str,
) -> Result<ListTagChildrenResponse, Error>
pub async fn list_children<'a>( &'a self, tag_id: &'a str, ) -> Result<ListTagChildrenResponse, Error>
List tag children
List the children of a specific tag.
Parameters:
tag_id: &'astr
: The tag ID (required)
async fn example_tags_list_children() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTagChildrenResponse =
client.tags().list_children("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_child<'a>(
&'a self,
tag_id: &'a str,
body: &CreateTag,
) -> Result<TagResponse, Error>
pub async fn create_child<'a>( &'a self, tag_id: &'a str, body: &CreateTag, ) -> Result<TagResponse, Error>
Create child tag
Creates a child tag.
Parameters:
tag_id: &'astr
: The tag ID (required)
async fn example_tags_create_child() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::TagResponse = client
.tags()
.create_child(
"some-string",
&front_api::types::CreateTag {
name: "some-string".to_string(),
highlight: Some(front_api::types::Highlight::Grey),
is_visible_in_conversation_lists: Some(true),
},
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(&'a self, tag_id: &'a str) -> Result<TagResponse, Error>
pub async fn get<'a>(&'a self, tag_id: &'a str) -> Result<TagResponse, Error>
Get tag
Fetche a tag.
Parameters:
tag_id: &'astr
: The tag ID (required)
async fn example_tags_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::TagResponse = client.tags().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn delete<'a>(&'a self, tag_id: &'a str) -> Result<(), Error>
pub async fn delete<'a>(&'a self, tag_id: &'a str) -> Result<(), Error>
Delete tag
Delete a tag.
Parameters:
tag_id: &'astr
: The ID of the tag to delete (required)
async fn example_tags_delete() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client.tags().delete("some-string").await?;
Ok(())
}
Sourcepub async fn update<'a>(
&'a self,
tag_id: &'a str,
body: &UpdateTag,
) -> Result<(), Error>
pub async fn update<'a>( &'a self, tag_id: &'a str, body: &UpdateTag, ) -> Result<(), Error>
Update a tag
Update a tag.
Parameters:
tag_id: &'astr
: The tag ID (required)
async fn example_tags_update() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.tags()
.update(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
Ok(())
}
Sourcepub async fn list_tagged_conversations<'a>(
&'a self,
limit: Option<i64>,
page_token: Option<String>,
q: Option<String>,
tag_id: &'a str,
) -> Result<ListTaggedConversationsResponse, Error>
pub async fn list_tagged_conversations<'a>( &'a self, limit: Option<i64>, page_token: Option<String>, q: Option<String>, tag_id: &'a str, ) -> Result<ListTaggedConversationsResponse, Error>
List tagged conversations
List the conversations tagged with a tag. For more advanced filtering, see the search endpoint.
⚠️ Deprecated field included
This endpoint returns a deprecated
last_message
field in the top-level conversation bodies listed. Please use the_links.related.last_message
field instead.
Parameters:
limit: Option<i64>
: Max number of results per pagepage_token: Option<String>
: Token to use to request the next pageq: Option<String>
: Search query object with a propertystatuses
, whose value should be a list of conversation statuses (assigned
,unassigned
,archived
, ordeleted
).tag_id: &'astr
: The ID of the tag (required)
async fn example_tags_list_tagged_conversations() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTaggedConversationsResponse = client
.tags()
.list_tagged_conversations(
Some(4 as i64),
Some("some-string".to_string()),
Some("some-string".to_string()),
"some-string",
)
.await?;
println!("{:?}", result);
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tags
impl !RefUnwindSafe for Tags
impl Send for Tags
impl Sync for Tags
impl Unpin for Tags
impl !UnwindSafe for Tags
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