pub struct Channels {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Channels
impl Channels
Sourcepub async fn list<'a>(&'a self) -> Result<ListChannelsResponse, Error>
pub async fn list<'a>(&'a self) -> Result<ListChannelsResponse, Error>
List channels
List the channels of the company.
async fn example_channels_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListChannelsResponse = client.channels().list().await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_team<'a>(
&'a self,
team_id: &'a str,
) -> Result<ListTeamChannelsResponse, Error>
pub async fn list_team<'a>( &'a self, team_id: &'a str, ) -> Result<ListTeamChannelsResponse, Error>
List team channels
List the channels of a team.
Parameters:
team_id: &'astr
: The team ID (required)
async fn example_channels_list_team() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeamChannelsResponse =
client.channels().list_team("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_teammate<'a>(
&'a self,
teammate_id: &'a str,
) -> Result<ListTeammateChannelsResponse, Error>
pub async fn list_teammate<'a>( &'a self, teammate_id: &'a str, ) -> Result<ListTeammateChannelsResponse, Error>
List teammate channels
List the channels of a teammate.
Parameters:
teammate_id: &'astr
: The teammate ID (required)
async fn example_channels_list_teammate() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListTeammateChannelsResponse =
client.channels().list_teammate("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(
&'a self,
channel_id: &'a str,
) -> Result<ChannelResponse, Error>
pub async fn get<'a>( &'a self, channel_id: &'a str, ) -> Result<ChannelResponse, Error>
Get channel
Fetch a channel.
Parameters:
channel_id: &'astr
: The Channel ID (required)
async fn example_channels_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ChannelResponse = client.channels().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn update<'a>(
&'a self,
channel_id: &'a str,
body: &UpdateChannel,
) -> Result<(), Error>
pub async fn update<'a>( &'a self, channel_id: &'a str, body: &UpdateChannel, ) -> Result<(), Error>
Update Channel
Update a channel.
Parameters:
channel_id: &'astr
: The Channel ID (required)
async fn example_channels_update() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.channels()
.update(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
Ok(())
}
Sourcepub async fn validate<'a>(
&'a self,
channel_id: &'a str,
) -> Result<ValidateChannelResponse, Error>
pub async fn validate<'a>( &'a self, channel_id: &'a str, ) -> Result<ValidateChannelResponse, Error>
Validate channel
Asynchronously validate a channel
Parameters:
channel_id: &'astr
: The Channel ID (required)
async fn example_channels_validate() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ValidateChannelResponse =
client.channels().validate("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create<'a>(
&'a self,
inbox_id: &'a str,
body: &CreateChannel,
) -> Result<(), Error>
pub async fn create<'a>( &'a self, inbox_id: &'a str, body: &CreateChannel, ) -> Result<(), Error>
Create a channel
Create a channel in an inbox.
Parameters:
inbox_id: &'astr
: The Inbox ID (required)
async fn example_channels_create() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.channels()
.create(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Channels
impl !RefUnwindSafe for Channels
impl Send for Channels
impl Sync for Channels
impl Unpin for Channels
impl !UnwindSafe for Channels
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