pub struct ContactGroups {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl ContactGroups
impl ContactGroups
Sourcepub async fn list_groups<'a>(&'a self) -> Result<ListGroupsResponse, Error>
pub async fn list_groups<'a>(&'a self) -> Result<ListGroupsResponse, Error>
List groups
List the contact groups.
async fn example_contact_groups_list_groups() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListGroupsResponse = client.contact_groups().list_groups().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_group<'a>(
&'a self,
body: &CreateContactGroup,
) -> Result<(), Error>
pub async fn create_group<'a>( &'a self, body: &CreateContactGroup, ) -> Result<(), Error>
Create group
Create a new contact group in the default team.
async fn example_contact_groups_create_group() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.contact_groups()
.create_group(&front_api::types::CreateContactGroup {
name: "some-string".to_string(),
})
.await?;
Ok(())
}
Sourcepub async fn list_team_groups<'a>(
&'a self,
team_id: &'a str,
) -> Result<ListTeamGroupsResponse, Error>
pub async fn list_team_groups<'a>( &'a self, team_id: &'a str, ) -> Result<ListTeamGroupsResponse, Error>
List team groups
List contact groups belonging to the requested team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_contact_groups_list_team_groups() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeamGroupsResponse = client
.contact_groups()
.list_team_groups("some-string")
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_team_group<'a>(
&'a self,
team_id: &'a str,
body: &CreateContactGroup,
) -> Result<(), Error>
pub async fn create_team_group<'a>( &'a self, team_id: &'a str, body: &CreateContactGroup, ) -> Result<(), Error>
Create team group
Create a new contact group for the requested team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_contact_groups_create_team_group() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.contact_groups()
.create_team_group(
"some-string",
&front_api::types::CreateContactGroup {
name: "some-string".to_string(),
},
)
.await?;
Ok(())
}
Sourcepub async fn list_teammate_groups<'a>(
&'a self,
teammate_id: &'a str,
) -> Result<ListTeammateGroupsResponse, Error>
pub async fn list_teammate_groups<'a>( &'a self, teammate_id: &'a str, ) -> Result<ListTeammateGroupsResponse, Error>
List teammate groups
List the contact groups belonging to the requested teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_contact_groups_list_teammate_groups() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeammateGroupsResponse = client
.contact_groups()
.list_teammate_groups("some-string")
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create_teammate_group<'a>(
&'a self,
teammate_id: &'a str,
body: &CreateContactGroup,
) -> Result<(), Error>
pub async fn create_teammate_group<'a>( &'a self, teammate_id: &'a str, body: &CreateContactGroup, ) -> Result<(), Error>
Create teammate group
Create a new contact group for the requested teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_contact_groups_create_teammate_group() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.contact_groups()
.create_teammate_group(
"some-string",
&front_api::types::CreateContactGroup {
name: "some-string".to_string(),
},
)
.await?;
Ok(())
}
Sourcepub async fn delete_group<'a>(
&'a self,
contact_group_id: &'a str,
) -> Result<(), Error>
pub async fn delete_group<'a>( &'a self, contact_group_id: &'a str, ) -> Result<(), Error>
Delete group
Delete a contact group.
Parameters:
contact_group_id: &'astr
: The contact group ID (required)
async fn example_contact_groups_delete_group() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client.contact_groups().delete_group("some-string").await?;
Ok(())
}
Sourcepub async fn list_group_contacts<'a>(
&'a self,
contact_group_id: &'a str,
limit: Option<i64>,
page_token: Option<String>,
) -> Result<ListGroupContactsResponse, Error>
pub async fn list_group_contacts<'a>( &'a self, contact_group_id: &'a str, limit: Option<i64>, page_token: Option<String>, ) -> Result<ListGroupContactsResponse, Error>
List contacts in group
List the contacts belonging to the requested group.
Parameters:
contact_group_id: &'astr
: The contact group ID (required)limit: Option<i64>
: Max number of results per pagepage_token: Option<String>
: Token to use to request the next page
async fn example_contact_groups_list_group_contacts() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListGroupContactsResponse = client
.contact_groups()
.list_group_contacts(
"some-string",
Some(4 as i64),
Some("some-string".to_string()),
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn add_contacts_to_group<'a>(
&'a self,
contact_group_id: &'a str,
body: &AddContactsToGroup,
) -> Result<(), Error>
pub async fn add_contacts_to_group<'a>( &'a self, contact_group_id: &'a str, body: &AddContactsToGroup, ) -> Result<(), Error>
Add contacts to group
Add contacts to the requested group.
Parameters:
contact_group_id: &'astr
: The contact group ID (required)
async fn example_contact_groups_add_contacts_to_group() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.contact_groups()
.add_contacts_to_group(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
Ok(())
}
Trait Implementations§
Source§impl Clone for ContactGroups
impl Clone for ContactGroups
Source§fn clone(&self) -> ContactGroups
fn clone(&self) -> ContactGroups
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ContactGroups
impl !RefUnwindSafe for ContactGroups
impl Send for ContactGroups
impl Sync for ContactGroups
impl Unpin for ContactGroups
impl !UnwindSafe for ContactGroups
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