pub struct Analytics {
pub client: Client,
}Fields§
§client: ClientImplementations§
Source§impl Analytics
impl Analytics
Sourcepub async fn create_report<'a>(
&'a self,
body: &AnalyticsReportRequest2,
) -> Result<AnalyticsReportResponse2, Error>
pub async fn create_report<'a>( &'a self, body: &AnalyticsReportRequest2, ) -> Result<AnalyticsReportResponse2, Error>
Create a new analytics report.
Create a new analytics report for a set of metrics over a specific time span. The report will be executed asynchronously. The response will include a link that can be used to retrieve the report status & result.
async fn example_analytics_create_report() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::AnalyticsReportResponse2 = client
.analytics()
.create_report(&serde_json::Value::String("some-string".to_string()))
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn get_report<'a>(
&'a self,
report_uid: &'a str,
) -> Result<AnalyticsReportResponse2, Error>
pub async fn get_report<'a>( &'a self, report_uid: &'a str, ) -> Result<AnalyticsReportResponse2, Error>
Fetch an analytics report.
Parameters:
report_uid: &'astr: The report UID. (required)
async fn example_analytics_get_report() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::AnalyticsReportResponse2 =
client.analytics().get_report("some-string").await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn create_export<'a>(
&'a self,
body: &AnalyticsExportRequest2,
) -> Result<AnalyticsExportResponse2, Error>
pub async fn create_export<'a>( &'a self, body: &AnalyticsExportRequest2, ) -> Result<AnalyticsExportResponse2, Error>
Create a new analytics export.
Create a new analytics export of messages or activities over a specific time span. The export will be executed asynchronously. The response will include a link that can be used to retrieve the export status & result.
async fn example_analytics_create_export() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::AnalyticsExportResponse2 = client
.analytics()
.create_export(&serde_json::Value::String("some-string".to_string()))
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn get_export<'a>(
&'a self,
export_id: &'a str,
) -> Result<AnalyticsExportResponse2, Error>
pub async fn get_export<'a>( &'a self, export_id: &'a str, ) -> Result<AnalyticsExportResponse2, Error>
Fetch an analytics export.
Parameters:
export_id: &'astr: The export ID. (required)
async fn example_analytics_get_export() -> anyhow::Result<()> {
let client = front_api::Client::new_from_env();
let result: front_api::types::AnalyticsExportResponse2 =
client.analytics().get_export("some-string").await?;
println!("{:?}", result);
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Analytics
impl !RefUnwindSafe for Analytics
impl Send for Analytics
impl Sync for Analytics
impl Unpin for Analytics
impl !UnwindSafe for Analytics
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