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.
pub use crate::operation::create_experiment_definition::_create_experiment_definition_input::CreateExperimentDefinitionInputBuilder;

pub use crate::operation::create_experiment_definition::_create_experiment_definition_output::CreateExperimentDefinitionOutputBuilder;

impl crate::operation::create_experiment_definition::builders::CreateExperimentDefinitionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_experiment_definition::CreateExperimentDefinitionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_experiment_definition::CreateExperimentDefinitionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_experiment_definition();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateExperimentDefinition`.
///
/// <p>Creates an experiment definition in AppConfig. An experiment definition describes the purpose, scope, and operational configuration of an experiment, including the target audience, feature flag, and treatment configurations.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateExperimentDefinitionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_experiment_definition::builders::CreateExperimentDefinitionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_experiment_definition::CreateExperimentDefinitionOutput,
        crate::operation::create_experiment_definition::CreateExperimentDefinitionError,
    > for CreateExperimentDefinitionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_experiment_definition::CreateExperimentDefinitionOutput,
            crate::operation::create_experiment_definition::CreateExperimentDefinitionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateExperimentDefinitionFluentBuilder {
    /// Creates a new `CreateExperimentDefinitionFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateExperimentDefinition as a reference.
    pub fn as_input(&self) -> &crate::operation::create_experiment_definition::builders::CreateExperimentDefinitionInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_experiment_definition::CreateExperimentDefinitionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_experiment_definition::CreateExperimentDefinitionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_experiment_definition::CreateExperimentDefinition::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_experiment_definition::CreateExperimentDefinition::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_experiment_definition::CreateExperimentDefinitionOutput,
        crate::operation::create_experiment_definition::CreateExperimentDefinitionError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The application ID or name.</p>
    pub fn application_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.application_identifier(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.inner = self.inner.set_application_identifier(input);
        self
    }
    /// <p>The application ID or name.</p>
    pub fn get_application_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_application_identifier()
    }
    /// <p>A name for the experiment definition.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(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.inner = self.inner.set_name(input);
        self
    }
    /// <p>A name for the experiment definition.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The configuration profile ID or name that stores the feature flag.</p>
    pub fn configuration_profile_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.configuration_profile_identifier(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.inner = self.inner.set_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.inner.get_configuration_profile_identifier()
    }
    /// <p>The environment ID or name where the experiment will run.</p>
    pub fn environment_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.environment_identifier(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.inner = self.inner.set_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.inner.get_environment_identifier()
    }
    /// <p>The key of the existing feature flag to use with the experiment.</p>
    pub fn flag_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.flag_key(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.inner = self.inner.set_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.inner.get_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 {
        self.inner = self.inner.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 set_treatments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentInput>>) -> Self {
        self.inner = self.inner.set_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.inner.get_treatments()
    }
    /// <p>The control treatment that represents the baseline experience for comparison.</p>
    pub fn control(mut self, input: crate::types::TreatmentInput) -> Self {
        self.inner = self.inner.control(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.inner = self.inner.set_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.inner.get_control()
    }
    /// <p>A rule that defines which users are eligible to be assigned to treatments during the experiment.</p>
    pub fn audience_rule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.audience_rule(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.hypothesis(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.audience_description(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.launch_criteria(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.inner = self.inner.set_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.inner.get_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 {
        self.inner = self.inner.tags(k.into(), v.into());
        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.inner = self.inner.set_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.inner.get_tags()
    }
}