aws-sdk-rds 1.131.0

AWS SDK for Amazon Relational Database Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The representation of a metric.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Metric {
    /// <p>The name of a metric.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A list of metric references (thresholds).</p>
    pub references: ::std::option::Option<::std::vec::Vec<crate::types::MetricReference>>,
    /// <p>The details of different statistics for a metric. The description might contain markdown.</p>
    pub statistics_details: ::std::option::Option<::std::string::String>,
    /// <p>The query to retrieve metric data points.</p>
    pub metric_query: ::std::option::Option<crate::types::MetricQuery>,
}
impl Metric {
    /// <p>The name of a metric.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A list of metric references (thresholds).</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.references.is_none()`.
    pub fn references(&self) -> &[crate::types::MetricReference] {
        self.references.as_deref().unwrap_or_default()
    }
    /// <p>The details of different statistics for a metric. The description might contain markdown.</p>
    pub fn statistics_details(&self) -> ::std::option::Option<&str> {
        self.statistics_details.as_deref()
    }
    /// <p>The query to retrieve metric data points.</p>
    pub fn metric_query(&self) -> ::std::option::Option<&crate::types::MetricQuery> {
        self.metric_query.as_ref()
    }
}
impl Metric {
    /// Creates a new builder-style object to manufacture [`Metric`](crate::types::Metric).
    pub fn builder() -> crate::types::builders::MetricBuilder {
        crate::types::builders::MetricBuilder::default()
    }
}

/// A builder for [`Metric`](crate::types::Metric).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct MetricBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) references: ::std::option::Option<::std::vec::Vec<crate::types::MetricReference>>,
    pub(crate) statistics_details: ::std::option::Option<::std::string::String>,
    pub(crate) metric_query: ::std::option::Option<crate::types::MetricQuery>,
}
impl MetricBuilder {
    /// <p>The name of a metric.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of a metric.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of a metric.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `references`.
    ///
    /// To override the contents of this collection use [`set_references`](Self::set_references).
    ///
    /// <p>A list of metric references (thresholds).</p>
    pub fn references(mut self, input: crate::types::MetricReference) -> Self {
        let mut v = self.references.unwrap_or_default();
        v.push(input);
        self.references = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of metric references (thresholds).</p>
    pub fn set_references(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricReference>>) -> Self {
        self.references = input;
        self
    }
    /// <p>A list of metric references (thresholds).</p>
    pub fn get_references(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricReference>> {
        &self.references
    }
    /// <p>The details of different statistics for a metric. The description might contain markdown.</p>
    pub fn statistics_details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.statistics_details = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The details of different statistics for a metric. The description might contain markdown.</p>
    pub fn set_statistics_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.statistics_details = input;
        self
    }
    /// <p>The details of different statistics for a metric. The description might contain markdown.</p>
    pub fn get_statistics_details(&self) -> &::std::option::Option<::std::string::String> {
        &self.statistics_details
    }
    /// <p>The query to retrieve metric data points.</p>
    pub fn metric_query(mut self, input: crate::types::MetricQuery) -> Self {
        self.metric_query = ::std::option::Option::Some(input);
        self
    }
    /// <p>The query to retrieve metric data points.</p>
    pub fn set_metric_query(mut self, input: ::std::option::Option<crate::types::MetricQuery>) -> Self {
        self.metric_query = input;
        self
    }
    /// <p>The query to retrieve metric data points.</p>
    pub fn get_metric_query(&self) -> &::std::option::Option<crate::types::MetricQuery> {
        &self.metric_query
    }
    /// Consumes the builder and constructs a [`Metric`](crate::types::Metric).
    pub fn build(self) -> crate::types::Metric {
        crate::types::Metric {
            name: self.name,
            references: self.references,
            statistics_details: self.statistics_details,
            metric_query: self.metric_query,
        }
    }
}