pub struct Links {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Links
impl Links
Sourcepub async fn list_conversations<'a>(
&'a self,
limit: Option<i64>,
link_id: &'a str,
page_token: Option<String>,
q: Option<String>,
) -> Result<ListLinkConversationsResponse, Error>
pub async fn list_conversations<'a>( &'a self, limit: Option<i64>, link_id: &'a str, page_token: Option<String>, q: Option<String>, ) -> Result<ListLinkConversationsResponse, Error>
List link conversations
List the conversations linked to a specific link. For more advanced filtering, see the search endpoint.
⚠️ Deprecated field included
This endpoint returns a deprecated
last_message
field in the top-level conversation bodies listed. Please use the_links.related.last_message
field instead.
Parameters:
limit: Option<i64>
: Max number of results per pagelink_id: &'astr
: The Link ID (required)page_token: Option<String>
: Token to use to request the next pageq: Option<String>
: Search query object with a propertystatuses
, whose value should be a list of conversation statuses (assigned
,unassigned
,archived
, ordeleted
).
async fn example_links_list_conversations() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListLinkConversationsResponse = client
.links()
.list_conversations(
Some(4 as i64),
"some-string",
Some("some-string".to_string()),
Some("some-string".to_string()),
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn list<'a>(
&'a self,
limit: Option<i64>,
page_token: Option<String>,
q: Option<String>,
) -> Result<ListLinksResponse, Error>
pub async fn list<'a>( &'a self, limit: Option<i64>, page_token: Option<String>, q: Option<String>, ) -> Result<ListLinksResponse, Error>
List links
List the links of the company paginated by id. Allows filtering by link type via the q.types param.
Parameters:
limit: Option<i64>
: Max number of results per pagepage_token: Option<String>
: Token to use to request the next pageq: Option<String>
: Search query object with a propertytypes
, whose value should be a list of link types (examples -web
,jira
,asana
).
async fn example_links_list() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::ListLinksResponse = client
.links()
.list(
Some(4 as i64),
Some("some-string".to_string()),
Some("some-string".to_string()),
)
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn create<'a>(
&'a self,
body: &CreateLink,
) -> Result<LinkResponse, Error>
pub async fn create<'a>( &'a self, body: &CreateLink, ) -> Result<LinkResponse, Error>
Create link
Create a link. If the link is resolved to an installed links integration, any name retrieved from the integration will override the provided name.
async fn example_links_create() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::LinkResponse = client
.links()
.create(&front_api::types::CreateLink {
name: Some("some-string".to_string()),
external_url: "some-string".to_string(),
})
.await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn get<'a>(&'a self, link_id: &'a str) -> Result<LinkResponse, Error>
pub async fn get<'a>(&'a self, link_id: &'a str) -> Result<LinkResponse, Error>
Get link
Fetch a link.
Parameters:
link_id: &'astr
: The link ID (required)
async fn example_links_get() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::LinkResponse = client.links().get("some-string").await?;
println!("{:?}", result);
Ok(())
}
Sourcepub async fn update<'a>(
&'a self,
link_id: &'a str,
body: &UpdateLink,
) -> Result<(), Error>
pub async fn update<'a>( &'a self, link_id: &'a str, body: &UpdateLink, ) -> Result<(), Error>
Update a link
Update a link.
Parameters:
link_id: &'astr
: The link ID (required)
async fn example_links_update() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
client
.links()
.update(
"some-string",
&serde_json::Value::String("some-string".to_string()),
)
.await?;
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Links
impl !RefUnwindSafe for Links
impl Send for Links
impl Sync for Links
impl Unpin for Links
impl !UnwindSafe for Links
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