pub struct Teams {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Teams
impl Teams
Sourcepub async fn list<'a>(&'a self) -> Result<ListTeamsResponse, Error>
pub async fn list<'a>(&'a self) -> Result<ListTeamsResponse, Error>
List teams
List the teams in the company.
async fn example_teams_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeamsResponse = client.teams().list().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(&'a self, team_id: &'a str) -> Result<TeamResponse, Error>
pub async fn get<'a>(&'a self, team_id: &'a str) -> Result<TeamResponse, Error>
Get team
Fetch a team.
Parameters:
team_id: &'astr
: The Team ID (required)
async fn example_teams_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::TeamResponse = client.teams().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn add_teammates_to<'a>(
&'a self,
team_id: &'a str,
body: &TeammateIds,
) -> Result<(), Error>
pub async fn add_teammates_to<'a>( &'a self, team_id: &'a str, body: &TeammateIds, ) -> Result<(), Error>
Add teammates to team
Add one or more teammates to a team.
Parameters:
team_id: &'astr
: The Team ID (required)
async fn example_teams_add_teammates_to() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.teams()
.add_teammates_to(
"some-string",
&front_api::types::TeammateIds {
teammate_ids: vec!["some-string".to_string()],
},
)
.await?;
Ok(())
}
Sourcepub async fn remove_teammates_from<'a>(
&'a self,
team_id: &'a str,
body: &TeammateIds,
) -> Result<(), Error>
pub async fn remove_teammates_from<'a>( &'a self, team_id: &'a str, body: &TeammateIds, ) -> Result<(), Error>
Remove teammates from team
Remove one or more teammates from a team.
Parameters:
team_id: &'astr
: The Team ID (required)
async fn example_teams_remove_teammates_from() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.teams()
.remove_teammates_from(
"some-string",
&front_api::types::TeammateIds {
teammate_ids: vec!["some-string".to_string()],
},
)
.await?;
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Teams
impl !RefUnwindSafe for Teams
impl Send for Teams
impl Sync for Teams
impl Unpin for Teams
impl !UnwindSafe for Teams
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