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::start_recommendation::_start_recommendation_input::StartRecommendationInputBuilder;

pub use crate::operation::start_recommendation::_start_recommendation_output::StartRecommendationOutputBuilder;

impl crate::operation::start_recommendation::builders::StartRecommendationInputBuilder {
    /// 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_recommendation::StartRecommendationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_recommendation::StartRecommendationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_recommendation();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartRecommendation`.
///
/// <p>Starts a recommendation job that analyzes agent traces and generates optimization suggestions for system prompts or tool descriptions to improve agent performance.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartRecommendationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_recommendation::builders::StartRecommendationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::start_recommendation::StartRecommendationOutput,
        crate::operation::start_recommendation::StartRecommendationError,
    > for StartRecommendationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::start_recommendation::StartRecommendationOutput,
            crate::operation::start_recommendation::StartRecommendationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartRecommendationFluentBuilder {
    /// Creates a new `StartRecommendationFluentBuilder`.
    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 StartRecommendation as a reference.
    pub fn as_input(&self) -> &crate::operation::start_recommendation::builders::StartRecommendationInputBuilder {
        &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_recommendation::StartRecommendationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_recommendation::StartRecommendationError,
            ::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_recommendation::StartRecommendation::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_recommendation::StartRecommendation::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_recommendation::StartRecommendationOutput,
        crate::operation::start_recommendation::StartRecommendationError,
        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 recommendation. 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 recommendation. 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 recommendation. 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 recommendation.</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 recommendation.</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 recommendation.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The type of recommendation to generate. Valid values are <code>SYSTEM_PROMPT_RECOMMENDATION</code> for system prompt optimization or <code>TOOL_DESCRIPTION_RECOMMENDATION</code> for tool description optimization.</p>
    pub fn r#type(mut self, input: crate::types::RecommendationType) -> Self {
        self.inner = self.inner.r#type(input);
        self
    }
    /// <p>The type of recommendation to generate. Valid values are <code>SYSTEM_PROMPT_RECOMMENDATION</code> for system prompt optimization or <code>TOOL_DESCRIPTION_RECOMMENDATION</code> for tool description optimization.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::RecommendationType>) -> Self {
        self.inner = self.inner.set_type(input);
        self
    }
    /// <p>The type of recommendation to generate. Valid values are <code>SYSTEM_PROMPT_RECOMMENDATION</code> for system prompt optimization or <code>TOOL_DESCRIPTION_RECOMMENDATION</code> for tool description optimization.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::RecommendationType> {
        self.inner.get_type()
    }
    /// <p>The configuration for the recommendation, including the input to optimize, agent traces to analyze, and evaluation settings.</p>
    pub fn recommendation_config(mut self, input: crate::types::RecommendationConfig) -> Self {
        self.inner = self.inner.recommendation_config(input);
        self
    }
    /// <p>The configuration for the recommendation, including the input to optimize, agent traces to analyze, and evaluation settings.</p>
    pub fn set_recommendation_config(mut self, input: ::std::option::Option<crate::types::RecommendationConfig>) -> Self {
        self.inner = self.inner.set_recommendation_config(input);
        self
    }
    /// <p>The configuration for the recommendation, including the input to optimize, agent traces to analyze, and evaluation settings.</p>
    pub fn get_recommendation_config(&self) -> &::std::option::Option<crate::types::RecommendationConfig> {
        self.inner.get_recommendation_config()
    }
    /// <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()
    }
}