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::start_experiment_run::_start_experiment_run_input::StartExperimentRunInputBuilder;

pub use crate::operation::start_experiment_run::_start_experiment_run_output::StartExperimentRunOutputBuilder;

impl crate::operation::start_experiment_run::builders::StartExperimentRunInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::start_experiment_run::StartExperimentRunOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_experiment_run::StartExperimentRunError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_experiment_run();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartExperimentRun`.
///
/// <p>Starts an experiment run for the specified experiment definition. An experiment run delivers treatments to the target audience and collects metrics. You can start multiple experiment runs from the same experiment definition.</p><note>
/// <p>Billing for this experiment begins when you call this operation and continues until the experiment is stopped. For pricing details, see <a href="https://aws.amazon.com/systems-manager/pricing/">AppConfig pricing</a>.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartExperimentRunFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_experiment_run::builders::StartExperimentRunInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::start_experiment_run::StartExperimentRunOutput,
        crate::operation::start_experiment_run::StartExperimentRunError,
    > for StartExperimentRunFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::start_experiment_run::StartExperimentRunOutput,
            crate::operation::start_experiment_run::StartExperimentRunError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartExperimentRunFluentBuilder {
    /// Creates a new `StartExperimentRunFluentBuilder`.
    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 StartExperimentRun as a reference.
    pub fn as_input(&self) -> &crate::operation::start_experiment_run::builders::StartExperimentRunInputBuilder {
        &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::start_experiment_run::StartExperimentRunOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_experiment_run::StartExperimentRunError,
            ::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::start_experiment_run::StartExperimentRun::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_experiment_run::StartExperimentRun::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::start_experiment_run::StartExperimentRunOutput,
        crate::operation::start_experiment_run::StartExperimentRunError,
        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>The experiment definition ID or name.</p>
    pub fn experiment_definition_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.experiment_definition_identifier(input.into());
        self
    }
    /// <p>The experiment definition ID or name.</p>
    pub fn set_experiment_definition_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_experiment_definition_identifier(input);
        self
    }
    /// <p>The experiment definition ID or name.</p>
    pub fn get_experiment_definition_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_experiment_definition_identifier()
    }
    /// <p>A description of this experiment run.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A description of this experiment run.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A description of this experiment run.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The percentage of the target audience to expose to treatments. Set to 0 to validate the experiment before exposing production users.</p>
    pub fn exposure_percentage(mut self, input: f32) -> Self {
        self.inner = self.inner.exposure_percentage(input);
        self
    }
    /// <p>The percentage of the target audience to expose to treatments. Set to 0 to validate the experiment before exposing production users.</p>
    pub fn set_exposure_percentage(mut self, input: ::std::option::Option<f32>) -> Self {
        self.inner = self.inner.set_exposure_percentage(input);
        self
    }
    /// <p>The percentage of the target audience to expose to treatments. Set to 0 to validate the experiment before exposing production users.</p>
    pub fn get_exposure_percentage(&self) -> &::std::option::Option<f32> {
        self.inner.get_exposure_percentage()
    }
    /// <p>Treatment assignment overrides that assign specific entity IDs to treatments directly, bypassing random assignment.</p>
    pub fn treatment_overrides(mut self, input: crate::types::TreatmentOverrides) -> Self {
        self.inner = self.inner.treatment_overrides(input);
        self
    }
    /// <p>Treatment assignment overrides that assign specific entity IDs to treatments directly, bypassing random assignment.</p>
    pub fn set_treatment_overrides(mut self, input: ::std::option::Option<crate::types::TreatmentOverrides>) -> Self {
        self.inner = self.inner.set_treatment_overrides(input);
        self
    }
    /// <p>Treatment assignment overrides that assign specific entity IDs to treatments directly, bypassing random assignment.</p>
    pub fn get_treatment_overrides(&self) -> &::std::option::Option<crate::types::TreatmentOverrides> {
        self.inner.get_treatment_overrides()
    }
    ///
    /// 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 run.</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 run.</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 run.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    /// <p>The deployment parameters for the experiment run, including a KMS key identifier for encryption.</p>
    pub fn deployment_parameters(mut self, input: crate::types::DeploymentParameters) -> Self {
        self.inner = self.inner.deployment_parameters(input);
        self
    }
    /// <p>The deployment parameters for the experiment run, including a KMS key identifier for encryption.</p>
    pub fn set_deployment_parameters(mut self, input: ::std::option::Option<crate::types::DeploymentParameters>) -> Self {
        self.inner = self.inner.set_deployment_parameters(input);
        self
    }
    /// <p>The deployment parameters for the experiment run, including a KMS key identifier for encryption.</p>
    pub fn get_deployment_parameters(&self) -> &::std::option::Option<crate::types::DeploymentParameters> {
        self.inner.get_deployment_parameters()
    }
}