Skip to main content

aws_sdk_appmonetization/client/
get_metric_usage.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`GetMetricUsage`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder) operation.
4    /// This operation supports pagination; See [`into_paginator()`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::into_paginator).
5    ///
6    /// - The fluent builder is configurable:
7    ///   - [`app_id(impl Into<String>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::app_id) / [`set_app_id(Option<String>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::set_app_id):<br>required: **true**<br>The ID of the app.<br>
8    ///   - [`user_id(impl Into<String>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::user_id) / [`set_user_id(Option<String>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::set_user_id):<br>required: **true**<br>The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.<br>
9    ///   - [`started_at(DateTime)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::started_at) / [`set_started_at(Option<DateTime>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::set_started_at):<br>required: **true**<br>Inclusive start of the reporting window (half-open \[startedAt, endedAt)).<br>
10    ///   - [`ended_at(DateTime)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::ended_at) / [`set_ended_at(Option<DateTime>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::set_ended_at):<br>required: **true**<br>Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.<br>
11    ///   - [`scope(RequestScope)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::scope) / [`set_scope(Option<RequestScope>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::set_scope):<br>required: **true**<br>Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.<br>
12    ///   - [`max_results(i32)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::max_results) / [`set_max_results(Option<i32>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::set_max_results):<br>required: **false**<br>Maximum number of per-metric usage entries to return in this page (1-25, default 25).<br>
13    ///   - [`next_token(impl Into<String>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::next_token) / [`set_next_token(Option<String>)`](crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::set_next_token):<br>required: **false**<br>Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.<br>
14    /// - On success, responds with [`GetMetricUsageOutput`](crate::operation::get_metric_usage::GetMetricUsageOutput) with field(s):
15    ///   - [`usage(Vec::<MetricUsage>)`](crate::operation::get_metric_usage::GetMetricUsageOutput::usage): One entry per metric in this page, carrying its usage over the window. A metric with no events in the window is returned with usage = 0.
16    ///   - [`next_token(Option<String>)`](crate::operation::get_metric_usage::GetMetricUsageOutput::next_token): Opaque continuation token. Present when more metrics remain; pass it back (with the same window) to read the next page. Absent on the last page.
17    /// - On failure, responds with [`SdkError<GetMetricUsageError>`](crate::operation::get_metric_usage::GetMetricUsageError)
18    pub fn get_metric_usage(&self) -> crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder {
19        crate::operation::get_metric_usage::builders::GetMetricUsageFluentBuilder::new(self.handle.clone())
20    }
21}