aws-sdk-kendra 1.97.0

AWS SDK for AWSKendraFrontendService
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::batch_delete_document::_batch_delete_document_input::BatchDeleteDocumentInputBuilder;

pub use crate::operation::batch_delete_document::_batch_delete_document_output::BatchDeleteDocumentOutputBuilder;

impl crate::operation::batch_delete_document::builders::BatchDeleteDocumentInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::batch_delete_document::BatchDeleteDocumentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::batch_delete_document::BatchDeleteDocumentError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.batch_delete_document();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `BatchDeleteDocument`.
///
/// <p>Removes one or more documents from an index. The documents must have been added with the <code>BatchPutDocument</code> API.</p>
/// <p>The documents are deleted asynchronously. You can see the progress of the deletion by using Amazon Web Services CloudWatch. Any error messages related to the processing of the batch are sent to your Amazon Web Services CloudWatch log. You can also use the <code>BatchGetDocumentStatus</code> API to monitor the progress of deleting your documents.</p>
/// <p>Deleting documents from an index using <code>BatchDeleteDocument</code> could take up to an hour or more, depending on the number of documents you want to delete.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct BatchDeleteDocumentFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::batch_delete_document::builders::BatchDeleteDocumentInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::batch_delete_document::BatchDeleteDocumentOutput,
        crate::operation::batch_delete_document::BatchDeleteDocumentError,
    > for BatchDeleteDocumentFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::batch_delete_document::BatchDeleteDocumentOutput,
            crate::operation::batch_delete_document::BatchDeleteDocumentError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl BatchDeleteDocumentFluentBuilder {
    /// Creates a new `BatchDeleteDocumentFluentBuilder`.
    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 BatchDeleteDocument as a reference.
    pub fn as_input(&self) -> &crate::operation::batch_delete_document::builders::BatchDeleteDocumentInputBuilder {
        &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::batch_delete_document::BatchDeleteDocumentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::batch_delete_document::BatchDeleteDocumentError,
            ::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::batch_delete_document::BatchDeleteDocument::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::batch_delete_document::BatchDeleteDocument::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::batch_delete_document::BatchDeleteDocumentOutput,
        crate::operation::batch_delete_document::BatchDeleteDocumentError,
        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 index that contains the documents to delete.</p>
    pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.index_id(input.into());
        self
    }
    /// <p>The identifier of the index that contains the documents to delete.</p>
    pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_index_id(input);
        self
    }
    /// <p>The identifier of the index that contains the documents to delete.</p>
    pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_index_id()
    }
    ///
    /// Appends an item to `DocumentIdList`.
    ///
    /// To override the contents of this collection use [`set_document_id_list`](Self::set_document_id_list).
    ///
    /// <p>One or more identifiers for documents to delete from the index.</p>
    pub fn document_id_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.document_id_list(input.into());
        self
    }
    /// <p>One or more identifiers for documents to delete from the index.</p>
    pub fn set_document_id_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_document_id_list(input);
        self
    }
    /// <p>One or more identifiers for documents to delete from the index.</p>
    pub fn get_document_id_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_document_id_list()
    }
    /// <p>Maps a particular data source sync job to a particular data source.</p>
    pub fn data_source_sync_job_metric_target(mut self, input: crate::types::DataSourceSyncJobMetricTarget) -> Self {
        self.inner = self.inner.data_source_sync_job_metric_target(input);
        self
    }
    /// <p>Maps a particular data source sync job to a particular data source.</p>
    pub fn set_data_source_sync_job_metric_target(mut self, input: ::std::option::Option<crate::types::DataSourceSyncJobMetricTarget>) -> Self {
        self.inner = self.inner.set_data_source_sync_job_metric_target(input);
        self
    }
    /// <p>Maps a particular data source sync job to a particular data source.</p>
    pub fn get_data_source_sync_job_metric_target(&self) -> &::std::option::Option<crate::types::DataSourceSyncJobMetricTarget> {
        self.inner.get_data_source_sync_job_metric_target()
    }
}