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