aws-sdk-appmonetization 1.0.0

AWS SDK for AWS App Monetization
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Input for GetMetricUsage.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetMetricUsageInput {
    /// The ID of the app.
    pub app_id: ::std::option::Option<::std::string::String>,
    /// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
    pub user_id: ::std::option::Option<::std::string::String>,
    /// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
    pub started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// 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.
    pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
    pub scope: ::std::option::Option<crate::types::RequestScope>,
    /// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
    pub max_results: ::std::option::Option<i32>,
    /// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
    pub next_token: ::std::option::Option<::std::string::String>,
}
impl GetMetricUsageInput {
    /// The ID of the app.
    pub fn app_id(&self) -> ::std::option::Option<&str> {
        self.app_id.as_deref()
    }
    /// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
    pub fn started_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.started_at.as_ref()
    }
    /// 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.
    pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.ended_at.as_ref()
    }
    /// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
    pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
        self.scope.as_ref()
    }
    /// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl GetMetricUsageInput {
    /// Creates a new builder-style object to manufacture [`GetMetricUsageInput`](crate::operation::get_metric_usage::GetMetricUsageInput).
    pub fn builder() -> crate::operation::get_metric_usage::builders::GetMetricUsageInputBuilder {
        crate::operation::get_metric_usage::builders::GetMetricUsageInputBuilder::default()
    }
}

/// A builder for [`GetMetricUsageInput`](crate::operation::get_metric_usage::GetMetricUsageInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMetricUsageInputBuilder {
    pub(crate) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
}
impl GetMetricUsageInputBuilder {
    /// The ID of the app.
    /// This field is required.
    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the app.
    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_id = input;
        self
    }
    /// The ID of the app.
    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_id
    }
    /// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
    /// This field is required.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
    /// This field is required.
    pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.started_at = ::std::option::Option::Some(input);
        self
    }
    /// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
    pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.started_at = input;
        self
    }
    /// Inclusive start of the reporting window (half-open \[startedAt, endedAt)).
    pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.started_at
    }
    /// 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.
    /// This field is required.
    pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.ended_at = ::std::option::Option::Some(input);
        self
    }
    /// 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.
    pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.ended_at = input;
        self
    }
    /// 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.
    pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.ended_at
    }
    /// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
    /// This field is required.
    pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
        self.scope = ::std::option::Option::Some(input);
        self
    }
    /// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
        self.scope = input;
        self
    }
    /// Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
        &self.scope
    }
    /// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// Maximum number of per-metric usage entries to return in this page (1-25, default 25).
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Consumes the builder and constructs a [`GetMetricUsageInput`](crate::operation::get_metric_usage::GetMetricUsageInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_metric_usage::GetMetricUsageInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_metric_usage::GetMetricUsageInput {
            app_id: self.app_id,
            user_id: self.user_id,
            started_at: self.started_at,
            ended_at: self.ended_at,
            scope: self.scope,
            max_results: self.max_results,
            next_token: self.next_token,
        })
    }
}