aws-sdk-wellarchitected 1.110.0

AWS SDK for AWS Well-Architected Tool
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_agent_recommendation_generation::_start_agent_recommendation_generation_input::StartAgentRecommendationGenerationInputBuilder;

pub use crate::operation::start_agent_recommendation_generation::_start_agent_recommendation_generation_output::StartAgentRecommendationGenerationOutputBuilder;

impl crate::operation::start_agent_recommendation_generation::builders::StartAgentRecommendationGenerationInputBuilder {
    /// 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_agent_recommendation_generation::StartAgentRecommendationGenerationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGenerationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_agent_recommendation_generation();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartAgentRecommendationGeneration`.
///
/// <p>Initiates a new recommendation generation process for the specified optimization profile. This asynchronous operation analyzes your Amazon Web Services resources and generates optimization recommendations based on the configured pillars and scope. Use GetAgentRecommendationGeneration to check status.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartAgentRecommendationGenerationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_agent_recommendation_generation::builders::StartAgentRecommendationGenerationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGenerationOutput,
        crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGenerationError,
    > for StartAgentRecommendationGenerationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGenerationOutput,
            crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGenerationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartAgentRecommendationGenerationFluentBuilder {
    /// Creates a new `StartAgentRecommendationGenerationFluentBuilder`.
    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 StartAgentRecommendationGeneration as a reference.
    pub fn as_input(&self) -> &crate::operation::start_agent_recommendation_generation::builders::StartAgentRecommendationGenerationInputBuilder {
        &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_agent_recommendation_generation::StartAgentRecommendationGenerationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGenerationError,
            ::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_agent_recommendation_generation::StartAgentRecommendationGeneration::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGeneration::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_agent_recommendation_generation::StartAgentRecommendationGenerationOutput,
        crate::operation::start_agent_recommendation_generation::StartAgentRecommendationGenerationError,
        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 Amazon Resource Name (ARN) of the optimization profile to use for generating recommendations.</p>
    pub fn profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.profile_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the optimization profile to use for generating recommendations.</p>
    pub fn set_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_profile_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the optimization profile to use for generating recommendations.</p>
    pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_profile_arn()
    }
    ///
    /// Appends an item to `types`.
    ///
    /// To override the contents of this collection use [`set_types`](Self::set_types).
    ///
    /// <p>The types of recommendations to generate.</p>
    pub fn types(mut self, input: crate::types::RecommendationType) -> Self {
        self.inner = self.inner.types(input);
        self
    }
    /// <p>The types of recommendations to generate.</p>
    pub fn set_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationType>>) -> Self {
        self.inner = self.inner.set_types(input);
        self
    }
    /// <p>The types of recommendations to generate.</p>
    pub fn get_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationType>> {
        self.inner.get_types()
    }
    /// <p>An optional name for this generation process to help identify it in lists and logs.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>An optional name for this generation process to help identify it in lists and logs.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>An optional name for this generation process to help identify it in lists and logs.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>Optional additional context to guide the recommendation generation, such as specific business requirements or constraints.</p>
    pub fn additional_context(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.inner = self.inner.additional_context(input);
        self
    }
    /// <p>Optional additional context to guide the recommendation generation, such as specific business requirements or constraints.</p>
    pub fn set_additional_context(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.inner = self.inner.set_additional_context(input);
        self
    }
    /// <p>Optional additional context to guide the recommendation generation, such as specific business requirements or constraints.</p>
    pub fn get_additional_context(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        self.inner.get_additional_context()
    }
    /// <p>Scope configuration to focus the generation on specific pillars or goals.</p>
    pub fn scope(mut self, input: crate::types::Scope) -> Self {
        self.inner = self.inner.scope(input);
        self
    }
    /// <p>Scope configuration to focus the generation on specific pillars or goals.</p>
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
        self.inner = self.inner.set_scope(input);
        self
    }
    /// <p>Scope configuration to focus the generation on specific pillars or goals.</p>
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
        self.inner.get_scope()
    }
}