aws-sdk-appconfig 1.110.0

AWS SDK for Amazon AppConfig
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateExperimentDefinitionInput {
    /// <p>The application ID or name.</p>
    pub application_identifier: ::std::option::Option<::std::string::String>,
    /// <p>A name for the experiment definition.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The configuration profile ID or name that stores the feature flag.</p>
    pub configuration_profile_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The environment ID or name where the experiment will run.</p>
    pub environment_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The key of the existing feature flag to use with the experiment.</p>
    pub flag_key: ::std::option::Option<::std::string::String>,
    /// <p>A list of treatments to evaluate during the experiment. Each treatment defines a distinct variation compared to the control.</p>
    pub treatments: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>>,
    /// <p>The control treatment that represents the baseline experience for comparison.</p>
    pub control: ::std::option::Option<crate::types::TreatmentInput>,
    /// <p>A rule that defines which users are eligible to be assigned to treatments during the experiment.</p>
    pub audience_rule: ::std::option::Option<::std::string::String>,
    /// <p>A description of the goal or hypothesis the experiment is designed to validate.</p>
    pub hypothesis: ::std::option::Option<::std::string::String>,
    /// <p>A description of the intended audience for the experiment.</p>
    pub audience_description: ::std::option::Option<::std::string::String>,
    /// <p>Information about the conditions under which you would launch the winning treatment.</p>
    pub launch_criteria: ::std::option::Option<::std::string::String>,
    /// <p>The tags to assign to the experiment definition. Tags help organize and categorize your AppConfig resources.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateExperimentDefinitionInput {
    /// <p>The application ID or name.</p>
    pub fn application_identifier(&self) -> ::std::option::Option<&str> {
        self.application_identifier.as_deref()
    }
    /// <p>A name for the experiment definition.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The configuration profile ID or name that stores the feature flag.</p>
    pub fn configuration_profile_identifier(&self) -> ::std::option::Option<&str> {
        self.configuration_profile_identifier.as_deref()
    }
    /// <p>The environment ID or name where the experiment will run.</p>
    pub fn environment_identifier(&self) -> ::std::option::Option<&str> {
        self.environment_identifier.as_deref()
    }
    /// <p>The key of the existing feature flag to use with the experiment.</p>
    pub fn flag_key(&self) -> ::std::option::Option<&str> {
        self.flag_key.as_deref()
    }
    /// <p>A list of treatments to evaluate during the experiment. Each treatment defines a distinct variation compared to the control.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.treatments.is_none()`.
    pub fn treatments(&self) -> &[crate::types::TreatmentInput] {
        self.treatments.as_deref().unwrap_or_default()
    }
    /// <p>The control treatment that represents the baseline experience for comparison.</p>
    pub fn control(&self) -> ::std::option::Option<&crate::types::TreatmentInput> {
        self.control.as_ref()
    }
    /// <p>A rule that defines which users are eligible to be assigned to treatments during the experiment.</p>
    pub fn audience_rule(&self) -> ::std::option::Option<&str> {
        self.audience_rule.as_deref()
    }
    /// <p>A description of the goal or hypothesis the experiment is designed to validate.</p>
    pub fn hypothesis(&self) -> ::std::option::Option<&str> {
        self.hypothesis.as_deref()
    }
    /// <p>A description of the intended audience for the experiment.</p>
    pub fn audience_description(&self) -> ::std::option::Option<&str> {
        self.audience_description.as_deref()
    }
    /// <p>Information about the conditions under which you would launch the winning treatment.</p>
    pub fn launch_criteria(&self) -> ::std::option::Option<&str> {
        self.launch_criteria.as_deref()
    }
    /// <p>The tags to assign to the experiment definition. Tags help organize and categorize your AppConfig resources.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateExperimentDefinitionInput {
    /// Creates a new builder-style object to manufacture [`CreateExperimentDefinitionInput`](crate::operation::create_experiment_definition::CreateExperimentDefinitionInput).
    pub fn builder() -> crate::operation::create_experiment_definition::builders::CreateExperimentDefinitionInputBuilder {
        crate::operation::create_experiment_definition::builders::CreateExperimentDefinitionInputBuilder::default()
    }
}

/// A builder for [`CreateExperimentDefinitionInput`](crate::operation::create_experiment_definition::CreateExperimentDefinitionInput).
#[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 {
    /// <p>The application ID or name.</p>
    /// This field is required.
    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
    }
    /// <p>The application ID or name.</p>
    pub fn set_application_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_identifier = input;
        self
    }
    /// <p>The application ID or name.</p>
    pub fn get_application_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_identifier
    }
    /// <p>A name for the experiment definition.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A name for the experiment definition.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>A name for the experiment definition.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The configuration profile ID or name that stores the feature flag.</p>
    /// This field is required.
    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
    }
    /// <p>The configuration profile ID or name that stores the feature flag.</p>
    pub fn set_configuration_profile_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.configuration_profile_identifier = input;
        self
    }
    /// <p>The configuration profile ID or name that stores the feature flag.</p>
    pub fn get_configuration_profile_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.configuration_profile_identifier
    }
    /// <p>The environment ID or name where the experiment will run.</p>
    /// This field is required.
    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
    }
    /// <p>The environment ID or name where the experiment will run.</p>
    pub fn set_environment_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_identifier = input;
        self
    }
    /// <p>The environment ID or name where the experiment will run.</p>
    pub fn get_environment_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_identifier
    }
    /// <p>The key of the existing feature flag to use with the experiment.</p>
    /// This field is required.
    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
    }
    /// <p>The key of the existing feature flag to use with the experiment.</p>
    pub fn set_flag_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.flag_key = input;
        self
    }
    /// <p>The key of the existing feature flag to use with the experiment.</p>
    pub fn get_flag_key(&self) -> &::std::option::Option<::std::string::String> {
        &self.flag_key
    }
    /// Appends an item to `treatments`.
    ///
    /// To override the contents of this collection use [`set_treatments`](Self::set_treatments).
    ///
    /// <p>A list of treatments to evaluate during the experiment. Each treatment defines a distinct variation compared to the control.</p>
    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
    }
    /// <p>A list of treatments to evaluate during the experiment. Each treatment defines a distinct variation compared to the control.</p>
    pub fn set_treatments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>>) -> Self {
        self.treatments = input;
        self
    }
    /// <p>A list of treatments to evaluate during the experiment. Each treatment defines a distinct variation compared to the control.</p>
    pub fn get_treatments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>> {
        &self.treatments
    }
    /// <p>The control treatment that represents the baseline experience for comparison.</p>
    /// This field is required.
    pub fn control(mut self, input: crate::types::TreatmentInput) -> Self {
        self.control = ::std::option::Option::Some(input);
        self
    }
    /// <p>The control treatment that represents the baseline experience for comparison.</p>
    pub fn set_control(mut self, input: ::std::option::Option<crate::types::TreatmentInput>) -> Self {
        self.control = input;
        self
    }
    /// <p>The control treatment that represents the baseline experience for comparison.</p>
    pub fn get_control(&self) -> &::std::option::Option<crate::types::TreatmentInput> {
        &self.control
    }
    /// <p>A rule that defines which users are eligible to be assigned to treatments during the experiment.</p>
    /// This field is required.
    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
    }
    /// <p>A rule that defines which users are eligible to be assigned to treatments during the experiment.</p>
    pub fn set_audience_rule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.audience_rule = input;
        self
    }
    /// <p>A rule that defines which users are eligible to be assigned to treatments during the experiment.</p>
    pub fn get_audience_rule(&self) -> &::std::option::Option<::std::string::String> {
        &self.audience_rule
    }
    /// <p>A description of the goal or hypothesis the experiment is designed to validate.</p>
    pub fn hypothesis(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hypothesis = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the goal or hypothesis the experiment is designed to validate.</p>
    pub fn set_hypothesis(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.hypothesis = input;
        self
    }
    /// <p>A description of the goal or hypothesis the experiment is designed to validate.</p>
    pub fn get_hypothesis(&self) -> &::std::option::Option<::std::string::String> {
        &self.hypothesis
    }
    /// <p>A description of the intended audience for the experiment.</p>
    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
    }
    /// <p>A description of the intended audience for the experiment.</p>
    pub fn set_audience_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.audience_description = input;
        self
    }
    /// <p>A description of the intended audience for the experiment.</p>
    pub fn get_audience_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.audience_description
    }
    /// <p>Information about the conditions under which you would launch the winning treatment.</p>
    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
    }
    /// <p>Information about the conditions under which you would launch the winning treatment.</p>
    pub fn set_launch_criteria(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.launch_criteria = input;
        self
    }
    /// <p>Information about the conditions under which you would launch the winning treatment.</p>
    pub fn get_launch_criteria(&self) -> &::std::option::Option<::std::string::String> {
        &self.launch_criteria
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to assign to the experiment definition. Tags help organize and categorize your AppConfig resources.</p>
    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
    }
    /// <p>The tags to assign to the experiment definition. Tags help organize and categorize your AppConfig resources.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags to assign to the experiment definition. Tags help organize and categorize your AppConfig resources.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateExperimentDefinitionInput`](crate::operation::create_experiment_definition::CreateExperimentDefinitionInput).
    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,
        })
    }
}