aws-sdk-bedrockagentcore 1.45.0

AWS SDK for Amazon Bedrock AgentCore
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_ab_test::_update_ab_test_input::UpdateAbTestInputBuilder;

pub use crate::operation::update_ab_test::_update_ab_test_output::UpdateAbTestOutputBuilder;

impl crate::operation::update_ab_test::builders::UpdateAbTestInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_ab_test::UpdateAbTestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_ab_test::UpdateABTestError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_ab_test();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateABTest`.
///
/// <p>Updates an A/B test's configuration, including variants, traffic allocation, evaluation settings, or execution status.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateABTestFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_ab_test::builders::UpdateAbTestInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_ab_test::UpdateAbTestOutput,
        crate::operation::update_ab_test::UpdateABTestError,
    > for UpdateABTestFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_ab_test::UpdateAbTestOutput,
            crate::operation::update_ab_test::UpdateABTestError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateABTestFluentBuilder {
    /// Creates a new `UpdateABTestFluentBuilder`.
    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 UpdateABTest as a reference.
    pub fn as_input(&self) -> &crate::operation::update_ab_test::builders::UpdateAbTestInputBuilder {
        &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::update_ab_test::UpdateAbTestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_ab_test::UpdateABTestError,
            ::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::update_ab_test::UpdateABTest::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_ab_test::UpdateABTest::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::update_ab_test::UpdateAbTestOutput,
        crate::operation::update_ab_test::UpdateABTestError,
        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 unique identifier of the A/B test to update.</p>
    pub fn ab_test_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.ab_test_id(input.into());
        self
    }
    /// <p>The unique identifier of the A/B test to update.</p>
    pub fn set_ab_test_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_ab_test_id(input);
        self
    }
    /// <p>The unique identifier of the A/B test to update.</p>
    pub fn get_ab_test_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_ab_test_id()
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>The updated name of the A/B test.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>The updated name of the A/B test.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>The updated name of the A/B test.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The updated description of the A/B test.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>The updated description of the A/B test.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>The updated description of the A/B test.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    ///
    /// Appends an item to `variants`.
    ///
    /// To override the contents of this collection use [`set_variants`](Self::set_variants).
    ///
    /// <p>The updated list of variants.</p>
    pub fn variants(mut self, input: crate::types::Variant) -> Self {
        self.inner = self.inner.variants(input);
        self
    }
    /// <p>The updated list of variants.</p>
    pub fn set_variants(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Variant>>) -> Self {
        self.inner = self.inner.set_variants(input);
        self
    }
    /// <p>The updated list of variants.</p>
    pub fn get_variants(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Variant>> {
        self.inner.get_variants()
    }
    /// <p>The updated gateway filter.</p>
    pub fn gateway_filter(mut self, input: crate::types::GatewayFilter) -> Self {
        self.inner = self.inner.gateway_filter(input);
        self
    }
    /// <p>The updated gateway filter.</p>
    pub fn set_gateway_filter(mut self, input: ::std::option::Option<crate::types::GatewayFilter>) -> Self {
        self.inner = self.inner.set_gateway_filter(input);
        self
    }
    /// <p>The updated gateway filter.</p>
    pub fn get_gateway_filter(&self) -> &::std::option::Option<crate::types::GatewayFilter> {
        self.inner.get_gateway_filter()
    }
    /// <p>The updated evaluation configuration.</p>
    pub fn evaluation_config(mut self, input: crate::types::AbTestEvaluationConfig) -> Self {
        self.inner = self.inner.evaluation_config(input);
        self
    }
    /// <p>The updated evaluation configuration.</p>
    pub fn set_evaluation_config(mut self, input: ::std::option::Option<crate::types::AbTestEvaluationConfig>) -> Self {
        self.inner = self.inner.set_evaluation_config(input);
        self
    }
    /// <p>The updated evaluation configuration.</p>
    pub fn get_evaluation_config(&self) -> &::std::option::Option<crate::types::AbTestEvaluationConfig> {
        self.inner.get_evaluation_config()
    }
    /// <p>The updated IAM role ARN.</p>
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.role_arn(input.into());
        self
    }
    /// <p>The updated IAM role ARN.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_role_arn(input);
        self
    }
    /// <p>The updated IAM role ARN.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_role_arn()
    }
    /// <p>The updated execution status to enable or disable the A/B test.</p>
    pub fn execution_status(mut self, input: crate::types::AbTestExecutionStatus) -> Self {
        self.inner = self.inner.execution_status(input);
        self
    }
    /// <p>The updated execution status to enable or disable the A/B test.</p>
    pub fn set_execution_status(mut self, input: ::std::option::Option<crate::types::AbTestExecutionStatus>) -> Self {
        self.inner = self.inner.set_execution_status(input);
        self
    }
    /// <p>The updated execution status to enable or disable the A/B test.</p>
    pub fn get_execution_status(&self) -> &::std::option::Option<crate::types::AbTestExecutionStatus> {
        self.inner.get_execution_status()
    }
}