#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateExperimentInput {
#[allow(missing_docs)] pub workspace_id: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub org_id: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub name: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub experiment_type: ::std::option::Option<crate::types::ExperimentType>,
pub context: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
#[allow(missing_docs)] pub variants: ::std::option::Option<::std::vec::Vec::<crate::types::Variant>>,
#[allow(missing_docs)] pub description: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub change_reason: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub metrics: ::std::option::Option<::aws_smithy_types::Document>,
#[allow(missing_docs)] pub experiment_group_id: ::std::option::Option<::std::string::String>,
}
impl CreateExperimentInput {
#[allow(missing_docs)] pub fn workspace_id(&self) -> ::std::option::Option<&str> {
self.workspace_id.as_deref()
}
#[allow(missing_docs)] pub fn org_id(&self) -> ::std::option::Option<&str> {
self.org_id.as_deref()
}
#[allow(missing_docs)] pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
#[allow(missing_docs)] pub fn experiment_type(&self) -> ::std::option::Option<&crate::types::ExperimentType> {
self.experiment_type.as_ref()
}
pub fn context(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
self.context.as_ref()
}
#[allow(missing_docs)] pub fn variants(&self) -> &[crate::types::Variant] {
self.variants.as_deref()
.unwrap_or_default()
}
#[allow(missing_docs)] pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
#[allow(missing_docs)] pub fn change_reason(&self) -> ::std::option::Option<&str> {
self.change_reason.as_deref()
}
#[allow(missing_docs)] pub fn metrics(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
self.metrics.as_ref()
}
#[allow(missing_docs)] pub fn experiment_group_id(&self) -> ::std::option::Option<&str> {
self.experiment_group_id.as_deref()
}
}
impl CreateExperimentInput {
pub fn builder() -> crate::operation::create_experiment::builders::CreateExperimentInputBuilder {
crate::operation::create_experiment::builders::CreateExperimentInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateExperimentInputBuilder {
pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
pub(crate) org_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) experiment_type: ::std::option::Option<crate::types::ExperimentType>,
pub(crate) context: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
pub(crate) variants: ::std::option::Option<::std::vec::Vec::<crate::types::Variant>>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) change_reason: ::std::option::Option<::std::string::String>,
pub(crate) metrics: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) experiment_group_id: ::std::option::Option<::std::string::String>,
}
impl CreateExperimentInputBuilder {
#[allow(missing_docs)] pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.workspace_id = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.workspace_id = input; self
}
#[allow(missing_docs)] pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
&self.workspace_id
}
#[allow(missing_docs)] pub fn org_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.org_id = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_org_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.org_id = input; self
}
#[allow(missing_docs)] pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> {
&self.org_id
}
#[allow(missing_docs)] pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input; self
}
#[allow(missing_docs)] pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
#[allow(missing_docs)] pub fn experiment_type(mut self, input: crate::types::ExperimentType) -> Self {
self.experiment_type = ::std::option::Option::Some(input);
self
}
#[allow(missing_docs)] pub fn set_experiment_type(mut self, input: ::std::option::Option<crate::types::ExperimentType>) -> Self {
self.experiment_type = input; self
}
#[allow(missing_docs)] pub fn get_experiment_type(&self) -> &::std::option::Option<crate::types::ExperimentType> {
&self.experiment_type
}
pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
let mut hash_map = self.context.unwrap_or_default();
hash_map.insert(k.into(), v);
self.context = ::std::option::Option::Some(hash_map);
self
}
pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>) -> Self {
self.context = input; self
}
pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
&self.context
}
pub fn variants(mut self, input: crate::types::Variant) -> Self {
let mut v = self.variants.unwrap_or_default();
v.push(input);
self.variants = ::std::option::Option::Some(v);
self
}
#[allow(missing_docs)] pub fn set_variants(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::Variant>>) -> Self {
self.variants = input; self
}
#[allow(missing_docs)] pub fn get_variants(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::Variant>> {
&self.variants
}
#[allow(missing_docs)] pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input; self
}
#[allow(missing_docs)] pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
#[allow(missing_docs)] pub fn change_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.change_reason = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_change_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.change_reason = input; self
}
#[allow(missing_docs)] pub fn get_change_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.change_reason
}
#[allow(missing_docs)] pub fn metrics(mut self, input: ::aws_smithy_types::Document) -> Self {
self.metrics = ::std::option::Option::Some(input);
self
}
#[allow(missing_docs)] pub fn set_metrics(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.metrics = input; self
}
#[allow(missing_docs)] pub fn get_metrics(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.metrics
}
#[allow(missing_docs)] pub fn experiment_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.experiment_group_id = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_experiment_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.experiment_group_id = input; self
}
#[allow(missing_docs)] pub fn get_experiment_group_id(&self) -> &::std::option::Option<::std::string::String> {
&self.experiment_group_id
}
pub fn build(self) -> ::std::result::Result<crate::operation::create_experiment::CreateExperimentInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(
crate::operation::create_experiment::CreateExperimentInput {
workspace_id: self.workspace_id
,
org_id: self.org_id
,
name: self.name
,
experiment_type: self.experiment_type
,
context: self.context
,
variants: self.variants
,
description: self.description
,
change_reason: self.change_reason
,
metrics: self.metrics
,
experiment_group_id: self.experiment_group_id
,
}
)
}
}