#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateExperimentDefinitionInput {
pub application_identifier: ::std::option::Option<::std::string::String>,
pub name: ::std::option::Option<::std::string::String>,
pub configuration_profile_identifier: ::std::option::Option<::std::string::String>,
pub environment_identifier: ::std::option::Option<::std::string::String>,
pub flag_key: ::std::option::Option<::std::string::String>,
pub treatments: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>>,
pub control: ::std::option::Option<crate::types::TreatmentInput>,
pub audience_rule: ::std::option::Option<::std::string::String>,
pub hypothesis: ::std::option::Option<::std::string::String>,
pub audience_description: ::std::option::Option<::std::string::String>,
pub launch_criteria: ::std::option::Option<::std::string::String>,
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateExperimentDefinitionInput {
pub fn application_identifier(&self) -> ::std::option::Option<&str> {
self.application_identifier.as_deref()
}
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
pub fn configuration_profile_identifier(&self) -> ::std::option::Option<&str> {
self.configuration_profile_identifier.as_deref()
}
pub fn environment_identifier(&self) -> ::std::option::Option<&str> {
self.environment_identifier.as_deref()
}
pub fn flag_key(&self) -> ::std::option::Option<&str> {
self.flag_key.as_deref()
}
pub fn treatments(&self) -> &[crate::types::TreatmentInput] {
self.treatments.as_deref().unwrap_or_default()
}
pub fn control(&self) -> ::std::option::Option<&crate::types::TreatmentInput> {
self.control.as_ref()
}
pub fn audience_rule(&self) -> ::std::option::Option<&str> {
self.audience_rule.as_deref()
}
pub fn hypothesis(&self) -> ::std::option::Option<&str> {
self.hypothesis.as_deref()
}
pub fn audience_description(&self) -> ::std::option::Option<&str> {
self.audience_description.as_deref()
}
pub fn launch_criteria(&self) -> ::std::option::Option<&str> {
self.launch_criteria.as_deref()
}
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl CreateExperimentDefinitionInput {
pub fn builder() -> crate::operation::create_experiment_definition::builders::CreateExperimentDefinitionInputBuilder {
crate::operation::create_experiment_definition::builders::CreateExperimentDefinitionInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateExperimentDefinitionInputBuilder {
pub(crate) application_identifier: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) configuration_profile_identifier: ::std::option::Option<::std::string::String>,
pub(crate) environment_identifier: ::std::option::Option<::std::string::String>,
pub(crate) flag_key: ::std::option::Option<::std::string::String>,
pub(crate) treatments: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>>,
pub(crate) control: ::std::option::Option<crate::types::TreatmentInput>,
pub(crate) audience_rule: ::std::option::Option<::std::string::String>,
pub(crate) hypothesis: ::std::option::Option<::std::string::String>,
pub(crate) audience_description: ::std::option::Option<::std::string::String>,
pub(crate) launch_criteria: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateExperimentDefinitionInputBuilder {
pub fn application_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.application_identifier = ::std::option::Option::Some(input.into());
self
}
pub fn set_application_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.application_identifier = input;
self
}
pub fn get_application_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.application_identifier
}
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 configuration_profile_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.configuration_profile_identifier = ::std::option::Option::Some(input.into());
self
}
pub fn set_configuration_profile_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.configuration_profile_identifier = input;
self
}
pub fn get_configuration_profile_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.configuration_profile_identifier
}
pub fn environment_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.environment_identifier = ::std::option::Option::Some(input.into());
self
}
pub fn set_environment_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.environment_identifier = input;
self
}
pub fn get_environment_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.environment_identifier
}
pub fn flag_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.flag_key = ::std::option::Option::Some(input.into());
self
}
pub fn set_flag_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.flag_key = input;
self
}
pub fn get_flag_key(&self) -> &::std::option::Option<::std::string::String> {
&self.flag_key
}
pub fn treatments(mut self, input: crate::types::TreatmentInput) -> Self {
let mut v = self.treatments.unwrap_or_default();
v.push(input);
self.treatments = ::std::option::Option::Some(v);
self
}
pub fn set_treatments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>>) -> Self {
self.treatments = input;
self
}
pub fn get_treatments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>> {
&self.treatments
}
pub fn control(mut self, input: crate::types::TreatmentInput) -> Self {
self.control = ::std::option::Option::Some(input);
self
}
pub fn set_control(mut self, input: ::std::option::Option<crate::types::TreatmentInput>) -> Self {
self.control = input;
self
}
pub fn get_control(&self) -> &::std::option::Option<crate::types::TreatmentInput> {
&self.control
}
pub fn audience_rule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.audience_rule = ::std::option::Option::Some(input.into());
self
}
pub fn set_audience_rule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.audience_rule = input;
self
}
pub fn get_audience_rule(&self) -> &::std::option::Option<::std::string::String> {
&self.audience_rule
}
pub fn hypothesis(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.hypothesis = ::std::option::Option::Some(input.into());
self
}
pub fn set_hypothesis(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.hypothesis = input;
self
}
pub fn get_hypothesis(&self) -> &::std::option::Option<::std::string::String> {
&self.hypothesis
}
pub fn audience_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.audience_description = ::std::option::Option::Some(input.into());
self
}
pub fn set_audience_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.audience_description = input;
self
}
pub fn get_audience_description(&self) -> &::std::option::Option<::std::string::String> {
&self.audience_description
}
pub fn launch_criteria(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.launch_criteria = ::std::option::Option::Some(input.into());
self
}
pub fn set_launch_criteria(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.launch_criteria = input;
self
}
pub fn get_launch_criteria(&self) -> &::std::option::Option<::std::string::String> {
&self.launch_criteria
}
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::create_experiment_definition::CreateExperimentDefinitionInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::create_experiment_definition::CreateExperimentDefinitionInput {
application_identifier: self.application_identifier,
name: self.name,
configuration_profile_identifier: self.configuration_profile_identifier,
environment_identifier: self.environment_identifier,
flag_key: self.flag_key,
treatments: self.treatments,
control: self.control,
audience_rule: self.audience_rule,
hypothesis: self.hypothesis,
audience_description: self.audience_description,
launch_criteria: self.launch_criteria,
tags: self.tags,
})
}
}