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.

/// Output for CreateMetric.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateMetricOutput {
    /// The newly created metric, in the app's draft. It goes live on the next app-level PublishDraft.
    pub metric: ::std::option::Option<crate::types::Metric>,
    _request_id: Option<String>,
}
impl CreateMetricOutput {
    /// The newly created metric, in the app's draft. It goes live on the next app-level PublishDraft.
    pub fn metric(&self) -> ::std::option::Option<&crate::types::Metric> {
        self.metric.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for CreateMetricOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateMetricOutput {
    /// Creates a new builder-style object to manufacture [`CreateMetricOutput`](crate::operation::create_metric::CreateMetricOutput).
    pub fn builder() -> crate::operation::create_metric::builders::CreateMetricOutputBuilder {
        crate::operation::create_metric::builders::CreateMetricOutputBuilder::default()
    }
}

/// A builder for [`CreateMetricOutput`](crate::operation::create_metric::CreateMetricOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateMetricOutputBuilder {
    pub(crate) metric: ::std::option::Option<crate::types::Metric>,
    _request_id: Option<String>,
}
impl CreateMetricOutputBuilder {
    /// The newly created metric, in the app's draft. It goes live on the next app-level PublishDraft.
    /// This field is required.
    pub fn metric(mut self, input: crate::types::Metric) -> Self {
        self.metric = ::std::option::Option::Some(input);
        self
    }
    /// The newly created metric, in the app's draft. It goes live on the next app-level PublishDraft.
    pub fn set_metric(mut self, input: ::std::option::Option<crate::types::Metric>) -> Self {
        self.metric = input;
        self
    }
    /// The newly created metric, in the app's draft. It goes live on the next app-level PublishDraft.
    pub fn get_metric(&self) -> &::std::option::Option<crate::types::Metric> {
        &self.metric
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateMetricOutput`](crate::operation::create_metric::CreateMetricOutput).
    pub fn build(self) -> crate::operation::create_metric::CreateMetricOutput {
        crate::operation::create_metric::CreateMetricOutput {
            metric: self.metric,
            _request_id: self._request_id,
        }
    }
}