pub struct Comments {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Comments
impl Comments
Sourcepub async fn list_conversation<'a>(
&'a self,
conversation_id: &'a str,
) -> Result<ListConversationCommentsResponse, Error>
pub async fn list_conversation<'a>( &'a self, conversation_id: &'a str, ) -> Result<ListConversationCommentsResponse, Error>
List conversation comments
List the comments in a conversation in reverse chronological order (newest first).
Parameters:
conversation_id: &'astr
: The conversation ID (required)
async fn example_comments_list_conversation() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListConversationCommentsResponse =
client.comments().list_conversation("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create<'a>(
&'a self,
conversation_id: &'a str,
body: &CreateComment,
) -> Result<CommentResponse, Error>
pub async fn create<'a>( &'a self, conversation_id: &'a str, body: &CreateComment, ) -> Result<CommentResponse, Error>
Create comment
Add a comment to a conversation.
Parameters:
conversation_id: &'astr
: The conversation ID (required)
async fn example_comments_create() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::CommentResponse = client
.comments()
.create(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(
&'a self,
comment_id: &'a str,
) -> Result<CommentResponse, Error>
pub async fn get<'a>( &'a self, comment_id: &'a str, ) -> Result<CommentResponse, Error>
Get comment
Fetches a comment.
Parameters:
comment_id: &'astr
: The Comment ID (required)
async fn example_comments_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::CommentResponse = client.comments().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list_mentions<'a>(
&'a self,
comment_id: &'a str,
) -> Result<ListCommentMentionsResponse, Error>
pub async fn list_mentions<'a>( &'a self, comment_id: &'a str, ) -> Result<ListCommentMentionsResponse, Error>
List comment mentions
List the teammates mentioned in a comment.
Parameters:
comment_id: &'astr
: The Comment ID (required)
async fn example_comments_list_mentions() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListCommentMentionsResponse =
client.comments().list_mentions("some-string").await?;
println!("{:?}", result);
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Comments
impl !RefUnwindSafe for Comments
impl Send for Comments
impl Sync for Comments
impl Unpin for Comments
impl !UnwindSafe for Comments
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