aws-sdk-bedrockagentruntime 1.126.0

AWS SDK for Agents for Amazon Bedrock Runtime
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_flow_execution::_start_flow_execution_input::StartFlowExecutionInputBuilder;

pub use crate::operation::start_flow_execution::_start_flow_execution_output::StartFlowExecutionOutputBuilder;

impl crate::operation::start_flow_execution::builders::StartFlowExecutionInputBuilder {
    /// 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_flow_execution::StartFlowExecutionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_flow_execution::StartFlowExecutionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_flow_execution();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartFlowExecution`.
///
/// <p>Starts an execution of an Amazon Bedrock flow. Unlike flows that run until completion or time out after five minutes, flow executions let you run flows asynchronously for longer durations. Flow executions also yield control so that your application can perform other tasks.</p>
/// <p>This operation returns an Amazon Resource Name (ARN) that you can use to track and manage your flow execution.</p><note>
/// <p>Flow executions is in preview release for Amazon Bedrock and is subject to change.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartFlowExecutionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_flow_execution::builders::StartFlowExecutionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::start_flow_execution::StartFlowExecutionOutput,
        crate::operation::start_flow_execution::StartFlowExecutionError,
    > for StartFlowExecutionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::start_flow_execution::StartFlowExecutionOutput,
            crate::operation::start_flow_execution::StartFlowExecutionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartFlowExecutionFluentBuilder {
    /// Creates a new `StartFlowExecutionFluentBuilder`.
    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 StartFlowExecution as a reference.
    pub fn as_input(&self) -> &crate::operation::start_flow_execution::builders::StartFlowExecutionInputBuilder {
        &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_flow_execution::StartFlowExecutionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_flow_execution::StartFlowExecutionError,
            ::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_flow_execution::StartFlowExecution::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_flow_execution::StartFlowExecution::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_flow_execution::StartFlowExecutionOutput,
        crate::operation::start_flow_execution::StartFlowExecutionError,
        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 flow to execute.</p>
    pub fn flow_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.flow_identifier(input.into());
        self
    }
    /// <p>The unique identifier of the flow to execute.</p>
    pub fn set_flow_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_flow_identifier(input);
        self
    }
    /// <p>The unique identifier of the flow to execute.</p>
    pub fn get_flow_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_flow_identifier()
    }
    /// <p>The unique identifier of the flow alias to use for the flow execution.</p>
    pub fn flow_alias_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.flow_alias_identifier(input.into());
        self
    }
    /// <p>The unique identifier of the flow alias to use for the flow execution.</p>
    pub fn set_flow_alias_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_flow_alias_identifier(input);
        self
    }
    /// <p>The unique identifier of the flow alias to use for the flow execution.</p>
    pub fn get_flow_alias_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_flow_alias_identifier()
    }
    /// <p>The unique name for the flow execution. If you don't provide one, a system-generated name is used.</p>
    pub fn flow_execution_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.flow_execution_name(input.into());
        self
    }
    /// <p>The unique name for the flow execution. If you don't provide one, a system-generated name is used.</p>
    pub fn set_flow_execution_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_flow_execution_name(input);
        self
    }
    /// <p>The unique name for the flow execution. If you don't provide one, a system-generated name is used.</p>
    pub fn get_flow_execution_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_flow_execution_name()
    }
    ///
    /// Appends an item to `inputs`.
    ///
    /// To override the contents of this collection use [`set_inputs`](Self::set_inputs).
    ///
    /// <p>The input data required for the flow execution. This must match the input schema defined in the flow.</p>
    pub fn inputs(mut self, input: crate::types::FlowInput) -> Self {
        self.inner = self.inner.inputs(input);
        self
    }
    /// <p>The input data required for the flow execution. This must match the input schema defined in the flow.</p>
    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FlowInput>>) -> Self {
        self.inner = self.inner.set_inputs(input);
        self
    }
    /// <p>The input data required for the flow execution. This must match the input schema defined in the flow.</p>
    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FlowInput>> {
        self.inner.get_inputs()
    }
    /// <p>The performance settings for the foundation model used in the flow execution.</p>
    pub fn model_performance_configuration(mut self, input: crate::types::ModelPerformanceConfiguration) -> Self {
        self.inner = self.inner.model_performance_configuration(input);
        self
    }
    /// <p>The performance settings for the foundation model used in the flow execution.</p>
    pub fn set_model_performance_configuration(mut self, input: ::std::option::Option<crate::types::ModelPerformanceConfiguration>) -> Self {
        self.inner = self.inner.set_model_performance_configuration(input);
        self
    }
    /// <p>The performance settings for the foundation model used in the flow execution.</p>
    pub fn get_model_performance_configuration(&self) -> &::std::option::Option<crate::types::ModelPerformanceConfiguration> {
        self.inner.get_model_performance_configuration()
    }
}