#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DimensionNameValue {
pub dimension_name: ::std::string::String,
pub dimension_value: ::std::string::String,
}
impl DimensionNameValue {
pub fn dimension_name(&self) -> &str {
use std::ops::Deref;
self.dimension_name.deref()
}
pub fn dimension_value(&self) -> &str {
use std::ops::Deref;
self.dimension_value.deref()
}
}
impl DimensionNameValue {
pub fn builder() -> crate::types::builders::DimensionNameValueBuilder {
crate::types::builders::DimensionNameValueBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DimensionNameValueBuilder {
pub(crate) dimension_name: ::std::option::Option<::std::string::String>,
pub(crate) dimension_value: ::std::option::Option<::std::string::String>,
}
impl DimensionNameValueBuilder {
pub fn dimension_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.dimension_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_dimension_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.dimension_name = input;
self
}
pub fn get_dimension_name(&self) -> &::std::option::Option<::std::string::String> {
&self.dimension_name
}
pub fn dimension_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.dimension_value = ::std::option::Option::Some(input.into());
self
}
pub fn set_dimension_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.dimension_value = input;
self
}
pub fn get_dimension_value(&self) -> &::std::option::Option<::std::string::String> {
&self.dimension_value
}
pub fn build(self) -> ::std::result::Result<crate::types::DimensionNameValue, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::DimensionNameValue {
dimension_name: self.dimension_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"dimension_name",
"dimension_name was not specified but it is required when building DimensionNameValue",
)
})?,
dimension_value: self.dimension_value.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"dimension_value",
"dimension_value was not specified but it is required when building DimensionNameValue",
)
})?,
})
}
}