aws-sdk-bedrockagentcore 1.41.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::create_ab_test::_create_ab_test_input::CreateAbTestInputBuilder;

pub use crate::operation::create_ab_test::_create_ab_test_output::CreateAbTestOutputBuilder;

impl crate::operation::create_ab_test::builders::CreateAbTestInputBuilder {
    /// 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_ab_test::CreateAbTestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_ab_test::CreateABTestError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_ab_test();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateABTest`.
///
/// <p>Creates an A/B test for comparing agent configurations. A/B tests split traffic between a control variant and a treatment variant through a gateway, then evaluate performance using online evaluation configurations to determine which variant performs better.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateABTestFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_ab_test::builders::CreateAbTestInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_ab_test::CreateAbTestOutput,
        crate::operation::create_ab_test::CreateABTestError,
    > for CreateABTestFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_ab_test::CreateAbTestOutput,
            crate::operation::create_ab_test::CreateABTestError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateABTestFluentBuilder {
    /// Creates a new `CreateABTestFluentBuilder`.
    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 CreateABTest as a reference.
    pub fn as_input(&self) -> &crate::operation::create_ab_test::builders::CreateAbTestInputBuilder {
        &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_ab_test::CreateAbTestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_ab_test::CreateABTestError,
            ::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_ab_test::CreateABTest::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_ab_test::CreateABTest::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_ab_test::CreateAbTestOutput,
        crate::operation::create_ab_test::CreateABTestError,
        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 name of the A/B test. Must be unique within your account.</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 name of the A/B test. Must be unique within your account.</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 name of the A/B test. Must be unique within your account.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The 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 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 description of the A/B test.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The Amazon Resource Name (ARN) of the gateway to use for traffic splitting.</p>
    pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.gateway_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the gateway to use for traffic splitting.</p>
    pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_gateway_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the gateway to use for traffic splitting.</p>
    pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_gateway_arn()
    }
    ///
    /// Appends an item to `variants`.
    ///
    /// To override the contents of this collection use [`set_variants`](Self::set_variants).
    ///
    /// <p>The list of variants for the A/B test. Must contain exactly two variants: a control (C) and a treatment (T1), each with a configuration bundle or target reference and a traffic weight.</p>
    pub fn variants(mut self, input: crate::types::Variant) -> Self {
        self.inner = self.inner.variants(input);
        self
    }
    /// <p>The list of variants for the A/B test. Must contain exactly two variants: a control (C) and a treatment (T1), each with a configuration bundle or target reference and a traffic weight.</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 list of variants for the A/B test. Must contain exactly two variants: a control (C) and a treatment (T1), each with a configuration bundle or target reference and a traffic weight.</p>
    pub fn get_variants(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Variant>> {
        self.inner.get_variants()
    }
    /// <p>Optional filter to restrict which gateway target paths are included in the A/B test.</p>
    pub fn gateway_filter(mut self, input: crate::types::GatewayFilter) -> Self {
        self.inner = self.inner.gateway_filter(input);
        self
    }
    /// <p>Optional filter to restrict which gateway target paths are included in the A/B test.</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>Optional filter to restrict which gateway target paths are included in the A/B test.</p>
    pub fn get_gateway_filter(&self) -> &::std::option::Option<crate::types::GatewayFilter> {
        self.inner.get_gateway_filter()
    }
    /// <p>The evaluation configuration specifying which online evaluation configurations to use for measuring variant performance.</p>
    pub fn evaluation_config(mut self, input: crate::types::AbTestEvaluationConfig) -> Self {
        self.inner = self.inner.evaluation_config(input);
        self
    }
    /// <p>The evaluation configuration specifying which online evaluation configurations to use for measuring variant performance.</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 evaluation configuration specifying which online evaluation configurations to use for measuring variant performance.</p>
    pub fn get_evaluation_config(&self) -> &::std::option::Option<crate::types::AbTestEvaluationConfig> {
        self.inner.get_evaluation_config()
    }
    /// <p>The IAM role ARN that grants permissions for the A/B test to access gateway and evaluation resources.</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 IAM role ARN that grants permissions for the A/B test to access gateway and evaluation resources.</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 IAM role ARN that grants permissions for the A/B test to access gateway and evaluation resources.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_role_arn()
    }
    /// <p>Whether to enable the A/B test immediately upon creation. If true, traffic splitting begins automatically.</p>
    pub fn enable_on_create(mut self, input: bool) -> Self {
        self.inner = self.inner.enable_on_create(input);
        self
    }
    /// <p>Whether to enable the A/B test immediately upon creation. If true, traffic splitting begins automatically.</p>
    pub fn set_enable_on_create(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_enable_on_create(input);
        self
    }
    /// <p>Whether to enable the A/B test immediately upon creation. If true, traffic splitting begins automatically.</p>
    pub fn get_enable_on_create(&self) -> &::std::option::Option<bool> {
        self.inner.get_enable_on_create()
    }
    /// <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()
    }
}