aws-sdk-kendra 1.95.0

AWS SDK for AWSKendraFrontendService
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Provides information about the status of documents submitted for indexing.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Status {
    /// <p>The identifier of the document.</p>
    pub document_id: ::std::option::Option<::std::string::String>,
    /// <p>The current status of a document.</p>
    /// <p>If the document was submitted for deletion, the status is <code>NOT_FOUND</code> after the document is deleted.</p>
    pub document_status: ::std::option::Option<crate::types::DocumentStatus>,
    /// <p>Indicates the source of the error.</p>
    pub failure_code: ::std::option::Option<::std::string::String>,
    /// <p>Provides detailed information about why the document couldn't be indexed. Use this information to correct the error before you resubmit the document for indexing.</p>
    pub failure_reason: ::std::option::Option<::std::string::String>,
}
impl Status {
    /// <p>The identifier of the document.</p>
    pub fn document_id(&self) -> ::std::option::Option<&str> {
        self.document_id.as_deref()
    }
    /// <p>The current status of a document.</p>
    /// <p>If the document was submitted for deletion, the status is <code>NOT_FOUND</code> after the document is deleted.</p>
    pub fn document_status(&self) -> ::std::option::Option<&crate::types::DocumentStatus> {
        self.document_status.as_ref()
    }
    /// <p>Indicates the source of the error.</p>
    pub fn failure_code(&self) -> ::std::option::Option<&str> {
        self.failure_code.as_deref()
    }
    /// <p>Provides detailed information about why the document couldn't be indexed. Use this information to correct the error before you resubmit the document for indexing.</p>
    pub fn failure_reason(&self) -> ::std::option::Option<&str> {
        self.failure_reason.as_deref()
    }
}
impl Status {
    /// Creates a new builder-style object to manufacture [`Status`](crate::types::Status).
    pub fn builder() -> crate::types::builders::StatusBuilder {
        crate::types::builders::StatusBuilder::default()
    }
}

/// A builder for [`Status`](crate::types::Status).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StatusBuilder {
    pub(crate) document_id: ::std::option::Option<::std::string::String>,
    pub(crate) document_status: ::std::option::Option<crate::types::DocumentStatus>,
    pub(crate) failure_code: ::std::option::Option<::std::string::String>,
    pub(crate) failure_reason: ::std::option::Option<::std::string::String>,
}
impl StatusBuilder {
    /// <p>The identifier of the document.</p>
    pub fn document_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.document_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the document.</p>
    pub fn set_document_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.document_id = input;
        self
    }
    /// <p>The identifier of the document.</p>
    pub fn get_document_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.document_id
    }
    /// <p>The current status of a document.</p>
    /// <p>If the document was submitted for deletion, the status is <code>NOT_FOUND</code> after the document is deleted.</p>
    pub fn document_status(mut self, input: crate::types::DocumentStatus) -> Self {
        self.document_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of a document.</p>
    /// <p>If the document was submitted for deletion, the status is <code>NOT_FOUND</code> after the document is deleted.</p>
    pub fn set_document_status(mut self, input: ::std::option::Option<crate::types::DocumentStatus>) -> Self {
        self.document_status = input;
        self
    }
    /// <p>The current status of a document.</p>
    /// <p>If the document was submitted for deletion, the status is <code>NOT_FOUND</code> after the document is deleted.</p>
    pub fn get_document_status(&self) -> &::std::option::Option<crate::types::DocumentStatus> {
        &self.document_status
    }
    /// <p>Indicates the source of the error.</p>
    pub fn failure_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.failure_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Indicates the source of the error.</p>
    pub fn set_failure_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.failure_code = input;
        self
    }
    /// <p>Indicates the source of the error.</p>
    pub fn get_failure_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.failure_code
    }
    /// <p>Provides detailed information about why the document couldn't be indexed. Use this information to correct the error before you resubmit the document for indexing.</p>
    pub fn failure_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.failure_reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Provides detailed information about why the document couldn't be indexed. Use this information to correct the error before you resubmit the document for indexing.</p>
    pub fn set_failure_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.failure_reason = input;
        self
    }
    /// <p>Provides detailed information about why the document couldn't be indexed. Use this information to correct the error before you resubmit the document for indexing.</p>
    pub fn get_failure_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.failure_reason
    }
    /// Consumes the builder and constructs a [`Status`](crate::types::Status).
    pub fn build(self) -> crate::types::Status {
        crate::types::Status {
            document_id: self.document_id,
            document_status: self.document_status,
            failure_code: self.failure_code,
            failure_reason: self.failure_reason,
        }
    }
}