pub struct Inboxes {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Inboxes
impl Inboxes
Sourcepub async fn list_inbox_channels<'a>(
&'a self,
inbox_id: &'a str,
) -> Result<ListInboxChannelsResponse, Error>
pub async fn list_inbox_channels<'a>( &'a self, inbox_id: &'a str, ) -> Result<ListInboxChannelsResponse, Error>
List inbox channels
List the channels in an inbox.
Parameters:
inbox_id: &'astr
: The Inbox ID (required)
async fn example_inboxes_list_inbox_channels() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListInboxChannelsResponse =
client.inboxes().list_inbox_channels("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list<'a>(&'a self) -> Result<ListInboxesResponse, Error>
pub async fn list<'a>(&'a self) -> Result<ListInboxesResponse, Error>
List inboxes
List the inboxes of the company.
async fn example_inboxes_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListInboxesResponse = client.inboxes().list().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_inbox<'a>(&'a self, body: &CreateInbox) -> Result<(), Error>
pub async fn create_inbox<'a>(&'a self, body: &CreateInbox) -> Result<(), Error>
Create inbox
Create an inbox in the default team.
async fn example_inboxes_create_inbox() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.inboxes()
.create_inbox(&front_api::types::CreateInbox {
name: "some-string".to_string(),
teammate_ids: Some(vec!["some-string".to_string()]),
})
.await?;
Ok(())
}
Sourcepub async fn list_team<'a>(
&'a self,
team_id: &'a str,
) -> Result<ListTeamInboxesResponse, Error>
pub async fn list_team<'a>( &'a self, team_id: &'a str, ) -> Result<ListTeamInboxesResponse, Error>
List team inboxes
List the inboxes belonging to a team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_inboxes_list_team() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeamInboxesResponse =
client.inboxes().list_team("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_team_inbox<'a>(
&'a self,
team_id: &'a str,
body: &CreateInbox,
) -> Result<(), Error>
pub async fn create_team_inbox<'a>( &'a self, team_id: &'a str, body: &CreateInbox, ) -> Result<(), Error>
Create team inbox
Create an inbox for a team.
Parameters:
team_id: &'astr
: The tag ID (required)
async fn example_inboxes_create_team_inbox() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.inboxes()
.create_team_inbox(
"some-string",
&front_api::types::CreateInbox {
name: "some-string".to_string(),
teammate_ids: Some(vec!["some-string".to_string()]),
},
)
.await?;
Ok(())
}
Sourcepub async fn get_inbox<'a>(
&'a self,
inbox_id: &'a str,
) -> Result<InboxResponse, Error>
pub async fn get_inbox<'a>( &'a self, inbox_id: &'a str, ) -> Result<InboxResponse, Error>
Get inbox
Fetch an inbox.
Parameters:
inbox_id: &'astr
: The Inbox ID (required)
async fn example_inboxes_get_inbox() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::InboxResponse = client.inboxes().get_inbox("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_inbox_conversations<'a>(
&'a self,
inbox_id: &'a str,
limit: Option<i64>,
page_token: Option<String>,
q: Option<String>,
) -> Result<ListInboxConversationsResponse, Error>
pub async fn list_inbox_conversations<'a>( &'a self, inbox_id: &'a str, limit: Option<i64>, page_token: Option<String>, q: Option<String>, ) -> Result<ListInboxConversationsResponse, Error>
List inbox conversations
List the conversations in an inbox. 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:
inbox_id: &'astr
: The Inbox ID (required)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
).
async fn example_inboxes_list_inbox_conversations() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListInboxConversationsResponse = client
.inboxes()
.list_inbox_conversations(
"some-string",
Some(4 as i64),
Some("some-string".to_string()),
Some("some-string".to_string()),
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_inbox_teammates<'a>(
&'a self,
inbox_id: &'a str,
) -> Result<ListInboxTeammatesResponse, Error>
pub async fn list_inbox_teammates<'a>( &'a self, inbox_id: &'a str, ) -> Result<ListInboxTeammatesResponse, Error>
List inbox access
List the teammates with access to an inbox.
Parameters:
inbox_id: &'astr
: The Inbox ID (required)
async fn example_inboxes_list_inbox_teammates() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListInboxTeammatesResponse =
client.inboxes().list_inbox_teammates("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn add_inbox_teammates<'a>(
&'a self,
inbox_id: &'a str,
body: &TeammateIds,
) -> Result<(), Error>
pub async fn add_inbox_teammates<'a>( &'a self, inbox_id: &'a str, body: &TeammateIds, ) -> Result<(), Error>
Add inbox access
Give access to one or more teammates to an inbox.
Parameters:
inbox_id: &'astr
: The Inbox ID (required)
async fn example_inboxes_add_inbox_teammates() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.inboxes()
.add_inbox_teammates(
"some-string",
&front_api::types::TeammateIds {
teammate_ids: vec!["some-string".to_string()],
},
)
.await?;
Ok(())
}
Sourcepub async fn remove_inbox_teammates<'a>(
&'a self,
inbox_id: &'a str,
body: &TeammateIds,
) -> Result<(), Error>
pub async fn remove_inbox_teammates<'a>( &'a self, inbox_id: &'a str, body: &TeammateIds, ) -> Result<(), Error>
Removes inbox access
Remove access of one or more teammates from an inbox.
Parameters:
inbox_id: &'astr
: The Inbox ID (required)
async fn example_inboxes_remove_inbox_teammates() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.inboxes()
.remove_inbox_teammates(
"some-string",
&front_api::types::TeammateIds {
teammate_ids: vec!["some-string".to_string()],
},
)
.await?;
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Inboxes
impl !RefUnwindSafe for Inboxes
impl Send for Inboxes
impl Sync for Inboxes
impl Unpin for Inboxes
impl !UnwindSafe for Inboxes
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