#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TreatmentConfig {
pub name: ::std::string::String,
pub description: ::std::option::Option<::std::string::String>,
pub feature: ::std::string::String,
pub variation: ::std::string::String,
}
impl TreatmentConfig {
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn feature(&self) -> &str {
use std::ops::Deref;
self.feature.deref()
}
pub fn variation(&self) -> &str {
use std::ops::Deref;
self.variation.deref()
}
}
impl TreatmentConfig {
pub fn builder() -> crate::types::builders::TreatmentConfigBuilder {
crate::types::builders::TreatmentConfigBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TreatmentConfigBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) feature: ::std::option::Option<::std::string::String>,
pub(crate) variation: ::std::option::Option<::std::string::String>,
}
impl TreatmentConfigBuilder {
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn feature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.feature = ::std::option::Option::Some(input.into());
self
}
pub fn set_feature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.feature = input;
self
}
pub fn get_feature(&self) -> &::std::option::Option<::std::string::String> {
&self.feature
}
pub fn variation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.variation = ::std::option::Option::Some(input.into());
self
}
pub fn set_variation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.variation = input;
self
}
pub fn get_variation(&self) -> &::std::option::Option<::std::string::String> {
&self.variation
}
pub fn build(self) -> ::std::result::Result<crate::types::TreatmentConfig, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::TreatmentConfig {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building TreatmentConfig",
)
})?,
description: self.description,
feature: self.feature.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"feature",
"feature was not specified but it is required when building TreatmentConfig",
)
})?,
variation: self.variation.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"variation",
"variation was not specified but it is required when building TreatmentConfig",
)
})?,
})
}
}