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 ArchiveMetric. This operation carries no scope selector: metric authoring always addresses the live app. Metrics in the sandbox are read-only through this API. Read them with GetMetric or ListMetrics using scope=sandbox or stage=DRAFT.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ArchiveMetricInput {
    /// The ID of the app.
    pub app_id: ::std::option::Option<::std::string::String>,
    /// The ID of the metric to archive.
    pub metric_id: ::std::option::Option<::std::string::String>,
}
impl ArchiveMetricInput {
    /// The ID of the app.
    pub fn app_id(&self) -> ::std::option::Option<&str> {
        self.app_id.as_deref()
    }
    /// The ID of the metric to archive.
    pub fn metric_id(&self) -> ::std::option::Option<&str> {
        self.metric_id.as_deref()
    }
}
impl ArchiveMetricInput {
    /// Creates a new builder-style object to manufacture [`ArchiveMetricInput`](crate::operation::archive_metric::ArchiveMetricInput).
    pub fn builder() -> crate::operation::archive_metric::builders::ArchiveMetricInputBuilder {
        crate::operation::archive_metric::builders::ArchiveMetricInputBuilder::default()
    }
}

/// A builder for [`ArchiveMetricInput`](crate::operation::archive_metric::ArchiveMetricInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ArchiveMetricInputBuilder {
    pub(crate) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) metric_id: ::std::option::Option<::std::string::String>,
}
impl ArchiveMetricInputBuilder {
    /// 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 ID of the metric to archive.
    /// This field is required.
    pub fn metric_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.metric_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the metric to archive.
    pub fn set_metric_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.metric_id = input;
        self
    }
    /// The ID of the metric to archive.
    pub fn get_metric_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.metric_id
    }
    /// Consumes the builder and constructs a [`ArchiveMetricInput`](crate::operation::archive_metric::ArchiveMetricInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::archive_metric::ArchiveMetricInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::archive_metric::ArchiveMetricInput {
            app_id: self.app_id,
            metric_id: self.metric_id,
        })
    }
}