aws-sdk-iotwireless 1.99.0

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

/// <p>The required list of dimensions for the metric.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Dimension {
    /// <p>The name of the dimension.</p>
    pub name: ::std::option::Option<crate::types::DimensionName>,
    /// <p>The dimension's value.</p>
    pub value: ::std::option::Option<::std::string::String>,
}
impl Dimension {
    /// <p>The name of the dimension.</p>
    pub fn name(&self) -> ::std::option::Option<&crate::types::DimensionName> {
        self.name.as_ref()
    }
    /// <p>The dimension's value.</p>
    pub fn value(&self) -> ::std::option::Option<&str> {
        self.value.as_deref()
    }
}
impl Dimension {
    /// Creates a new builder-style object to manufacture [`Dimension`](crate::types::Dimension).
    pub fn builder() -> crate::types::builders::DimensionBuilder {
        crate::types::builders::DimensionBuilder::default()
    }
}

/// A builder for [`Dimension`](crate::types::Dimension).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DimensionBuilder {
    pub(crate) name: ::std::option::Option<crate::types::DimensionName>,
    pub(crate) value: ::std::option::Option<::std::string::String>,
}
impl DimensionBuilder {
    /// <p>The name of the dimension.</p>
    pub fn name(mut self, input: crate::types::DimensionName) -> Self {
        self.name = ::std::option::Option::Some(input);
        self
    }
    /// <p>The name of the dimension.</p>
    pub fn set_name(mut self, input: ::std::option::Option<crate::types::DimensionName>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the dimension.</p>
    pub fn get_name(&self) -> &::std::option::Option<crate::types::DimensionName> {
        &self.name
    }
    /// <p>The dimension's value.</p>
    pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The dimension's value.</p>
    pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.value = input;
        self
    }
    /// <p>The dimension's value.</p>
    pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.value
    }
    /// Consumes the builder and constructs a [`Dimension`](crate::types::Dimension).
    pub fn build(self) -> crate::types::Dimension {
        crate::types::Dimension {
            name: self.name,
            value: self.value,
        }
    }
}