#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Variation {
pub name: ::std::option::Option<::std::string::String>,
pub value: ::std::option::Option<crate::types::VariableValue>,
}
impl Variation {
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
pub fn value(&self) -> ::std::option::Option<&crate::types::VariableValue> {
self.value.as_ref()
}
}
impl Variation {
pub fn builder() -> crate::types::builders::VariationBuilder {
crate::types::builders::VariationBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VariationBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) value: ::std::option::Option<crate::types::VariableValue>,
}
impl VariationBuilder {
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 value(mut self, input: crate::types::VariableValue) -> Self {
self.value = ::std::option::Option::Some(input);
self
}
pub fn set_value(mut self, input: ::std::option::Option<crate::types::VariableValue>) -> Self {
self.value = input;
self
}
pub fn get_value(&self) -> &::std::option::Option<crate::types::VariableValue> {
&self.value
}
pub fn build(self) -> crate::types::Variation {
crate::types::Variation {
name: self.name,
value: self.value,
}
}
}