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 GetMetric.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetMetricOutput {
    /// The requested metric.
    pub metric: ::std::option::Option<crate::types::Metric>,
    _request_id: Option<String>,
}
impl GetMetricOutput {
    /// The requested metric.
    pub fn metric(&self) -> ::std::option::Option<&crate::types::Metric> {
        self.metric.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetMetricOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetMetricOutput {
    /// Creates a new builder-style object to manufacture [`GetMetricOutput`](crate::operation::get_metric::GetMetricOutput).
    pub fn builder() -> crate::operation::get_metric::builders::GetMetricOutputBuilder {
        crate::operation::get_metric::builders::GetMetricOutputBuilder::default()
    }
}

/// A builder for [`GetMetricOutput`](crate::operation::get_metric::GetMetricOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMetricOutputBuilder {
    pub(crate) metric: ::std::option::Option<crate::types::Metric>,
    _request_id: Option<String>,
}
impl GetMetricOutputBuilder {
    /// The requested metric.
    /// This field is required.
    pub fn metric(mut self, input: crate::types::Metric) -> Self {
        self.metric = ::std::option::Option::Some(input);
        self
    }
    /// The requested metric.
    pub fn set_metric(mut self, input: ::std::option::Option<crate::types::Metric>) -> Self {
        self.metric = input;
        self
    }
    /// The requested metric.
    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 [`GetMetricOutput`](crate::operation::get_metric::GetMetricOutput).
    pub fn build(self) -> crate::operation::get_metric::GetMetricOutput {
        crate::operation::get_metric::GetMetricOutput {
            metric: self.metric,
            _request_id: self._request_id,
        }
    }
}