pub struct Rules {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Rules
impl Rules
Sourcepub async fn list<'a>(&'a self) -> Result<ListRulesResponse, Error>
pub async fn list<'a>(&'a self) -> Result<ListRulesResponse, Error>
List rule
List the rules of the company.
async fn example_rules_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListRulesResponse = client.rules().list().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_team<'a>(
&'a self,
team_id: &'a str,
) -> Result<ListTeamRulesResponse, Error>
pub async fn list_team<'a>( &'a self, team_id: &'a str, ) -> Result<ListTeamRulesResponse, Error>
List team rules
List the rules of a team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_rules_list_team() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeamRulesResponse =
client.rules().list_team("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_teammate<'a>(
&'a self,
teammate_id: &'a str,
) -> Result<ListTeammateRulesResponse, Error>
pub async fn list_teammate<'a>( &'a self, teammate_id: &'a str, ) -> Result<ListTeammateRulesResponse, Error>
List teammate rule
List the rules of a teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_rules_list_teammate() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeammateRulesResponse =
client.rules().list_teammate("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(&'a self, rule_id: &'a str) -> Result<RuleResponse, Error>
pub async fn get<'a>(&'a self, rule_id: &'a str) -> Result<RuleResponse, Error>
Get rule
Fetche a rule.
Parameters:
rule_id: &'astr
: The Rule ID (required)
async fn example_rules_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::RuleResponse = client.rules().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rules
impl !RefUnwindSafe for Rules
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl !UnwindSafe for Rules
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