aws-sdk-bedrockagentcore 1.65.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::ingest_data::_ingest_data_input::IngestDataInputBuilder;

pub use crate::operation::ingest_data::_ingest_data_output::IngestDataOutputBuilder;

impl crate::operation::ingest_data::builders::IngestDataInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::ingest_data::IngestDataOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::ingest_data::IngestDataError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.ingest_data();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `IngestData`.
///
/// <p>Submits content directly for ingestion to generate long-term memory records in a AgentCore Memory resource.</p>
/// <p>To use this operation, you must have the <code>bedrock-agentcore:IngestData</code> permission.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct IngestDataFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::ingest_data::builders::IngestDataInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::ingest_data::IngestDataOutput,
        crate::operation::ingest_data::IngestDataError,
    > for IngestDataFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::ingest_data::IngestDataOutput,
            crate::operation::ingest_data::IngestDataError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl IngestDataFluentBuilder {
    /// Creates a new `IngestDataFluentBuilder`.
    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 IngestData as a reference.
    pub fn as_input(&self) -> &crate::operation::ingest_data::builders::IngestDataInputBuilder {
        &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::ingest_data::IngestDataOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::ingest_data::IngestDataError,
            ::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::ingest_data::IngestData::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::ingest_data::IngestData::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::ingest_data::IngestDataOutput,
        crate::operation::ingest_data::IngestDataError,
        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 identifier of the AgentCore Memory resource to ingest content into.</p>
    pub fn memory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.memory_id(input.into());
        self
    }
    /// <p>The identifier of the AgentCore Memory resource to ingest content into.</p>
    pub fn set_memory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_memory_id(input);
        self
    }
    /// <p>The identifier of the AgentCore Memory resource to ingest content into.</p>
    pub fn get_memory_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_memory_id()
    }
    /// <p>The content to ingest. Only inline content is supported.</p>
    pub fn source(mut self, input: crate::types::ContentSource) -> Self {
        self.inner = self.inner.source(input);
        self
    }
    /// <p>The content to ingest. Only inline content is supported.</p>
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::ContentSource>) -> Self {
        self.inner = self.inner.set_source(input);
        self
    }
    /// <p>The content to ingest. Only inline content is supported.</p>
    pub fn get_source(&self) -> &::std::option::Option<crate::types::ContentSource> {
        self.inner.get_source()
    }
    /// <p>The timestamp of when the content occurred.</p>
    pub fn content_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.content_timestamp(input);
        self
    }
    /// <p>The timestamp of when the content occurred.</p>
    pub fn set_content_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_content_timestamp(input);
        self
    }
    /// <p>The timestamp of when the content occurred.</p>
    pub fn get_content_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_content_timestamp()
    }
    /// <p>The identifier of the actor associated with this content. An actor represents an entity that participates in sessions and generates content.</p>
    pub fn actor_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.actor_id(input.into());
        self
    }
    /// <p>The identifier of the actor associated with this content. An actor represents an entity that participates in sessions and generates content.</p>
    pub fn set_actor_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_actor_id(input);
        self
    }
    /// <p>The identifier of the actor associated with this content. An actor represents an entity that participates in sessions and generates content.</p>
    pub fn get_actor_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_actor_id()
    }
    /// <p>The identifier of the session that the content belongs to. If not provided, a session identifier is generated and returned in the response.</p>
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.session_id(input.into());
        self
    }
    /// <p>The identifier of the session that the content belongs to. If not provided, a session identifier is generated and returned in the response.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_session_id(input);
        self
    }
    /// <p>The identifier of the session that the content belongs to. If not provided, a session identifier is generated and returned in the response.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_session_id()
    }
    /// <p>The extraction configuration for long-term memory records. Use this parameter to specify namespace variable keys and their values for namespace substitution during extraction.</p>
    pub fn extraction_config(mut self, input: crate::types::ExtractionConfig) -> Self {
        self.inner = self.inner.extraction_config(input);
        self
    }
    /// <p>The extraction configuration for long-term memory records. Use this parameter to specify namespace variable keys and their values for namespace substitution during extraction.</p>
    pub fn set_extraction_config(mut self, input: ::std::option::Option<crate::types::ExtractionConfig>) -> Self {
        self.inner = self.inner.set_extraction_config(input);
        self
    }
    /// <p>The extraction configuration for long-term memory records. Use this parameter to specify namespace variable keys and their values for namespace substitution during extraction.</p>
    pub fn get_extraction_config(&self) -> &::std::option::Option<crate::types::ExtractionConfig> {
        self.inner.get_extraction_config()
    }
    ///
    /// Adds a key-value pair to `metadata`.
    ///
    /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
    ///
    /// <p>The key-value metadata to attach to the content.</p>
    pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::MetadataValue) -> Self {
        self.inner = self.inner.metadata(k.into(), v);
        self
    }
    /// <p>The key-value metadata to attach to the content.</p>
    pub fn set_metadata(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>>,
    ) -> Self {
        self.inner = self.inner.set_metadata(input);
        self
    }
    /// <p>The key-value metadata to attach to the content.</p>
    pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>> {
        self.inner.get_metadata()
    }
    /// <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore 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, AgentCore 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, AgentCore 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()
    }
}