pub struct Teammates {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Teammates
impl Teammates
Sourcepub async fn list<'a>(&'a self) -> Result<ListTeammatesResponse, Error>
pub async fn list<'a>(&'a self) -> Result<ListTeammatesResponse, Error>
List teammates
List the teammates in the company.
async fn example_teammates_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeammatesResponse = client.teammates().list().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(
&'a self,
teammate_id: &'a str,
) -> Result<TeammateResponse, Error>
pub async fn get<'a>( &'a self, teammate_id: &'a str, ) -> Result<TeammateResponse, Error>
Get teammate
Fetch a teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_teammates_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::TeammateResponse = client.teammates().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn update<'a>(
&'a self,
teammate_id: &'a str,
body: &UpdateTeammate,
) -> Result<(), Error>
pub async fn update<'a>( &'a self, teammate_id: &'a str, body: &UpdateTeammate, ) -> Result<(), Error>
Update teammate
Update a teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_teammates_update() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.teammates()
.update(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
Ok(())
}
Sourcepub async fn list_assigned_conversations<'a>(
&'a self,
limit: Option<i64>,
page_token: Option<String>,
q: Option<String>,
teammate_id: &'a str,
) -> Result<ListAssignedConversationsResponse, Error>
pub async fn list_assigned_conversations<'a>( &'a self, limit: Option<i64>, page_token: Option<String>, q: Option<String>, teammate_id: &'a str, ) -> Result<ListAssignedConversationsResponse, Error>
List assigned conversations
List the conversations assigned to a teammate in reverse chronological order (most recently updated first). 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
).teammate_id: &'astr
: The teammate ID (required)
async fn example_teammates_list_assigned_conversations() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListAssignedConversationsResponse = client
.teammates()
.list_assigned_conversations(
Some(4 as i64),
Some("some-string".to_string()),
Some("some-string".to_string()),
"some-string",
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_inboxes<'a>(
&'a self,
teammate_id: &'a str,
) -> Result<ListTeammateInboxesResponse, Error>
pub async fn list_inboxes<'a>( &'a self, teammate_id: &'a str, ) -> Result<ListTeammateInboxesResponse, Error>
List teammate inboxes
Returns list of inboxes the teammate has access to.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
NOTE: This operation is marked as deprecated.
async fn example_teammates_list_inboxes() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeammateInboxesResponse =
client.teammates().list_inboxes("some-string").await?;
println!("{:?}", result);
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Teammates
impl !RefUnwindSafe for Teammates
impl Send for Teammates
impl Sync for Teammates
impl Unpin for Teammates
impl !UnwindSafe for Teammates
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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