aws-sdk-bedrockagentcorecontrol 1.4.0

AWS SDK for Amazon Bedrock Agent Core Control Plane Fronting Layer
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_memory::_create_memory_output::CreateMemoryOutputBuilder;

pub use crate::operation::create_memory::_create_memory_input::CreateMemoryInputBuilder;

impl crate::operation::create_memory::builders::CreateMemoryInputBuilder {
    /// 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_memory::CreateMemoryOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_memory::CreateMemoryError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_memory();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateMemory`.
///
/// <p>Creates a new memory.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateMemoryFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_memory::builders::CreateMemoryInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_memory::CreateMemoryOutput,
        crate::operation::create_memory::CreateMemoryError,
    > for CreateMemoryFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_memory::CreateMemoryOutput,
            crate::operation::create_memory::CreateMemoryError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateMemoryFluentBuilder {
    /// Creates a new `CreateMemoryFluentBuilder`.
    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 CreateMemory as a reference.
    pub fn as_input(&self) -> &crate::operation::create_memory::builders::CreateMemoryInputBuilder {
        &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_memory::CreateMemoryOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_memory::CreateMemoryError,
            ::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_memory::CreateMemory::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_memory::CreateMemory::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_memory::CreateMemoryOutput,
        crate::operation::create_memory::CreateMemoryError,
        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>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock 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 operation completes no more than one time. If this token matches a previous request, Amazon Bedrock 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 operation completes no more than one time. If this token matches a previous request, Amazon Bedrock 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 name of the memory. The name 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 memory. The name 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 memory. The name 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 memory.</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 memory.</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 memory.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the memory data.</p>
    pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.encryption_key_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the memory data.</p>
    pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_encryption_key_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the memory data.</p>
    pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_encryption_key_arn()
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for the memory to access Amazon Web Services services.</p>
    pub fn memory_execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.memory_execution_role_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for the memory to access Amazon Web Services services.</p>
    pub fn set_memory_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_memory_execution_role_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for the memory to access Amazon Web Services services.</p>
    pub fn get_memory_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_memory_execution_role_arn()
    }
    /// <p>The duration after which memory events expire. Specified as an ISO 8601 duration.</p>
    pub fn event_expiry_duration(mut self, input: i32) -> Self {
        self.inner = self.inner.event_expiry_duration(input);
        self
    }
    /// <p>The duration after which memory events expire. Specified as an ISO 8601 duration.</p>
    pub fn set_event_expiry_duration(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_event_expiry_duration(input);
        self
    }
    /// <p>The duration after which memory events expire. Specified as an ISO 8601 duration.</p>
    pub fn get_event_expiry_duration(&self) -> &::std::option::Option<i32> {
        self.inner.get_event_expiry_duration()
    }
    ///
    /// Appends an item to `memoryStrategies`.
    ///
    /// To override the contents of this collection use [`set_memory_strategies`](Self::set_memory_strategies).
    ///
    /// <p>The memory strategies to use for this memory. Strategies define how information is extracted, processed, and consolidated.</p>
    pub fn memory_strategies(mut self, input: crate::types::MemoryStrategyInput) -> Self {
        self.inner = self.inner.memory_strategies(input);
        self
    }
    /// <p>The memory strategies to use for this memory. Strategies define how information is extracted, processed, and consolidated.</p>
    pub fn set_memory_strategies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MemoryStrategyInput>>) -> Self {
        self.inner = self.inner.set_memory_strategies(input);
        self
    }
    /// <p>The memory strategies to use for this memory. Strategies define how information is extracted, processed, and consolidated.</p>
    pub fn get_memory_strategies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MemoryStrategyInput>> {
        self.inner.get_memory_strategies()
    }
}