aws-sdk-bedrockagent 1.112.0

AWS SDK for Agents for Amazon Bedrock
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDataSourceInput {
    /// <p>The unique identifier of the knowledge base to which to add the data source.</p>
    pub knowledge_base_id: ::std::option::Option<::std::string::String>,
    /// <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, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The name of the data source.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the data source.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The connection configuration for the data source.</p>
    pub data_source_configuration: ::std::option::Option<crate::types::DataSourceConfiguration>,
    /// <p>The data deletion policy for the data source.</p>
    /// <p>You can set the data deletion policy to:</p>
    /// <ul>
    /// <li>
    /// <p>DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b>, only the data. This flag is ignored if an Amazon Web Services account is deleted.</p></li>
    /// <li>
    /// <p>RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b> if you delete a knowledge base or data source resource.</p></li>
    /// </ul>
    pub data_deletion_policy: ::std::option::Option<crate::types::DataDeletionPolicy>,
    /// <p>Contains details about the server-side encryption for the data source.</p>
    pub server_side_encryption_configuration: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>,
    /// <p>Contains details about how to ingest the documents in the data source.</p>
    pub vector_ingestion_configuration: ::std::option::Option<crate::types::VectorIngestionConfiguration>,
}
impl CreateDataSourceInput {
    /// <p>The unique identifier of the knowledge base to which to add the data source.</p>
    pub fn knowledge_base_id(&self) -> ::std::option::Option<&str> {
        self.knowledge_base_id.as_deref()
    }
    /// <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, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The name of the data source.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the data source.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The connection configuration for the data source.</p>
    pub fn data_source_configuration(&self) -> ::std::option::Option<&crate::types::DataSourceConfiguration> {
        self.data_source_configuration.as_ref()
    }
    /// <p>The data deletion policy for the data source.</p>
    /// <p>You can set the data deletion policy to:</p>
    /// <ul>
    /// <li>
    /// <p>DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b>, only the data. This flag is ignored if an Amazon Web Services account is deleted.</p></li>
    /// <li>
    /// <p>RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b> if you delete a knowledge base or data source resource.</p></li>
    /// </ul>
    pub fn data_deletion_policy(&self) -> ::std::option::Option<&crate::types::DataDeletionPolicy> {
        self.data_deletion_policy.as_ref()
    }
    /// <p>Contains details about the server-side encryption for the data source.</p>
    pub fn server_side_encryption_configuration(&self) -> ::std::option::Option<&crate::types::ServerSideEncryptionConfiguration> {
        self.server_side_encryption_configuration.as_ref()
    }
    /// <p>Contains details about how to ingest the documents in the data source.</p>
    pub fn vector_ingestion_configuration(&self) -> ::std::option::Option<&crate::types::VectorIngestionConfiguration> {
        self.vector_ingestion_configuration.as_ref()
    }
}
impl CreateDataSourceInput {
    /// Creates a new builder-style object to manufacture [`CreateDataSourceInput`](crate::operation::create_data_source::CreateDataSourceInput).
    pub fn builder() -> crate::operation::create_data_source::builders::CreateDataSourceInputBuilder {
        crate::operation::create_data_source::builders::CreateDataSourceInputBuilder::default()
    }
}

/// A builder for [`CreateDataSourceInput`](crate::operation::create_data_source::CreateDataSourceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDataSourceInputBuilder {
    pub(crate) knowledge_base_id: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) data_source_configuration: ::std::option::Option<crate::types::DataSourceConfiguration>,
    pub(crate) data_deletion_policy: ::std::option::Option<crate::types::DataDeletionPolicy>,
    pub(crate) server_side_encryption_configuration: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>,
    pub(crate) vector_ingestion_configuration: ::std::option::Option<crate::types::VectorIngestionConfiguration>,
}
impl CreateDataSourceInputBuilder {
    /// <p>The unique identifier of the knowledge base to which to add the data source.</p>
    /// This field is required.
    pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.knowledge_base_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the knowledge base to which to add the data source.</p>
    pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.knowledge_base_id = input;
        self
    }
    /// <p>The unique identifier of the knowledge base to which to add the data source.</p>
    pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.knowledge_base_id
    }
    /// <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, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(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, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.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, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The name of the data source.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the data source.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the data source.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the data source.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the data source.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the data source.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The connection configuration for the data source.</p>
    /// This field is required.
    pub fn data_source_configuration(mut self, input: crate::types::DataSourceConfiguration) -> Self {
        self.data_source_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The connection configuration for the data source.</p>
    pub fn set_data_source_configuration(mut self, input: ::std::option::Option<crate::types::DataSourceConfiguration>) -> Self {
        self.data_source_configuration = input;
        self
    }
    /// <p>The connection configuration for the data source.</p>
    pub fn get_data_source_configuration(&self) -> &::std::option::Option<crate::types::DataSourceConfiguration> {
        &self.data_source_configuration
    }
    /// <p>The data deletion policy for the data source.</p>
    /// <p>You can set the data deletion policy to:</p>
    /// <ul>
    /// <li>
    /// <p>DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b>, only the data. This flag is ignored if an Amazon Web Services account is deleted.</p></li>
    /// <li>
    /// <p>RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b> if you delete a knowledge base or data source resource.</p></li>
    /// </ul>
    pub fn data_deletion_policy(mut self, input: crate::types::DataDeletionPolicy) -> Self {
        self.data_deletion_policy = ::std::option::Option::Some(input);
        self
    }
    /// <p>The data deletion policy for the data source.</p>
    /// <p>You can set the data deletion policy to:</p>
    /// <ul>
    /// <li>
    /// <p>DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b>, only the data. This flag is ignored if an Amazon Web Services account is deleted.</p></li>
    /// <li>
    /// <p>RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b> if you delete a knowledge base or data source resource.</p></li>
    /// </ul>
    pub fn set_data_deletion_policy(mut self, input: ::std::option::Option<crate::types::DataDeletionPolicy>) -> Self {
        self.data_deletion_policy = input;
        self
    }
    /// <p>The data deletion policy for the data source.</p>
    /// <p>You can set the data deletion policy to:</p>
    /// <ul>
    /// <li>
    /// <p>DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b>, only the data. This flag is ignored if an Amazon Web Services account is deleted.</p></li>
    /// <li>
    /// <p>RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the <b>vector store itself is not deleted</b> if you delete a knowledge base or data source resource.</p></li>
    /// </ul>
    pub fn get_data_deletion_policy(&self) -> &::std::option::Option<crate::types::DataDeletionPolicy> {
        &self.data_deletion_policy
    }
    /// <p>Contains details about the server-side encryption for the data source.</p>
    pub fn server_side_encryption_configuration(mut self, input: crate::types::ServerSideEncryptionConfiguration) -> Self {
        self.server_side_encryption_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains details about the server-side encryption for the data source.</p>
    pub fn set_server_side_encryption_configuration(mut self, input: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>) -> Self {
        self.server_side_encryption_configuration = input;
        self
    }
    /// <p>Contains details about the server-side encryption for the data source.</p>
    pub fn get_server_side_encryption_configuration(&self) -> &::std::option::Option<crate::types::ServerSideEncryptionConfiguration> {
        &self.server_side_encryption_configuration
    }
    /// <p>Contains details about how to ingest the documents in the data source.</p>
    pub fn vector_ingestion_configuration(mut self, input: crate::types::VectorIngestionConfiguration) -> Self {
        self.vector_ingestion_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains details about how to ingest the documents in the data source.</p>
    pub fn set_vector_ingestion_configuration(mut self, input: ::std::option::Option<crate::types::VectorIngestionConfiguration>) -> Self {
        self.vector_ingestion_configuration = input;
        self
    }
    /// <p>Contains details about how to ingest the documents in the data source.</p>
    pub fn get_vector_ingestion_configuration(&self) -> &::std::option::Option<crate::types::VectorIngestionConfiguration> {
        &self.vector_ingestion_configuration
    }
    /// Consumes the builder and constructs a [`CreateDataSourceInput`](crate::operation::create_data_source::CreateDataSourceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_data_source::CreateDataSourceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_data_source::CreateDataSourceInput {
            knowledge_base_id: self.knowledge_base_id,
            client_token: self.client_token,
            name: self.name,
            description: self.description,
            data_source_configuration: self.data_source_configuration,
            data_deletion_policy: self.data_deletion_policy,
            server_side_encryption_configuration: self.server_side_encryption_configuration,
            vector_ingestion_configuration: self.vector_ingestion_configuration,
        })
    }
}