aws-sdk-textract 1.101.0

AWS SDK for Amazon Textract
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 GetDocumentAnalysisOutput {
    /// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video operation.</p>
    pub document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
    /// <p>The current status of the text detection job.</p>
    pub job_status: ::std::option::Option<crate::types::JobStatus>,
    /// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The results of the text-analysis operation.</p>
    pub blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
    /// <p>A list of warnings that occurred during the document-analysis operation.</p>
    pub warnings: ::std::option::Option<::std::vec::Vec<crate::types::Warning>>,
    /// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
    pub status_message: ::std::option::Option<::std::string::String>,
    /// <p></p>
    pub analyze_document_model_version: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetDocumentAnalysisOutput {
    /// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video operation.</p>
    pub fn document_metadata(&self) -> ::std::option::Option<&crate::types::DocumentMetadata> {
        self.document_metadata.as_ref()
    }
    /// <p>The current status of the text detection job.</p>
    pub fn job_status(&self) -> ::std::option::Option<&crate::types::JobStatus> {
        self.job_status.as_ref()
    }
    /// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The results of the text-analysis operation.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.blocks.is_none()`.
    pub fn blocks(&self) -> &[crate::types::Block] {
        self.blocks.as_deref().unwrap_or_default()
    }
    /// <p>A list of warnings that occurred during the document-analysis operation.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.warnings.is_none()`.
    pub fn warnings(&self) -> &[crate::types::Warning] {
        self.warnings.as_deref().unwrap_or_default()
    }
    /// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// <p></p>
    pub fn analyze_document_model_version(&self) -> ::std::option::Option<&str> {
        self.analyze_document_model_version.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetDocumentAnalysisOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetDocumentAnalysisOutput {
    /// Creates a new builder-style object to manufacture [`GetDocumentAnalysisOutput`](crate::operation::get_document_analysis::GetDocumentAnalysisOutput).
    pub fn builder() -> crate::operation::get_document_analysis::builders::GetDocumentAnalysisOutputBuilder {
        crate::operation::get_document_analysis::builders::GetDocumentAnalysisOutputBuilder::default()
    }
}

/// A builder for [`GetDocumentAnalysisOutput`](crate::operation::get_document_analysis::GetDocumentAnalysisOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetDocumentAnalysisOutputBuilder {
    pub(crate) document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
    pub(crate) job_status: ::std::option::Option<crate::types::JobStatus>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
    pub(crate) warnings: ::std::option::Option<::std::vec::Vec<crate::types::Warning>>,
    pub(crate) status_message: ::std::option::Option<::std::string::String>,
    pub(crate) analyze_document_model_version: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetDocumentAnalysisOutputBuilder {
    /// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video operation.</p>
    pub fn document_metadata(mut self, input: crate::types::DocumentMetadata) -> Self {
        self.document_metadata = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video operation.</p>
    pub fn set_document_metadata(mut self, input: ::std::option::Option<crate::types::DocumentMetadata>) -> Self {
        self.document_metadata = input;
        self
    }
    /// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video operation.</p>
    pub fn get_document_metadata(&self) -> &::std::option::Option<crate::types::DocumentMetadata> {
        &self.document_metadata
    }
    /// <p>The current status of the text detection job.</p>
    pub fn job_status(mut self, input: crate::types::JobStatus) -> Self {
        self.job_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the text detection job.</p>
    pub fn set_job_status(mut self, input: ::std::option::Option<crate::types::JobStatus>) -> Self {
        self.job_status = input;
        self
    }
    /// <p>The current status of the text detection job.</p>
    pub fn get_job_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
        &self.job_status
    }
    /// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Appends an item to `blocks`.
    ///
    /// To override the contents of this collection use [`set_blocks`](Self::set_blocks).
    ///
    /// <p>The results of the text-analysis operation.</p>
    pub fn blocks(mut self, input: crate::types::Block) -> Self {
        let mut v = self.blocks.unwrap_or_default();
        v.push(input);
        self.blocks = ::std::option::Option::Some(v);
        self
    }
    /// <p>The results of the text-analysis operation.</p>
    pub fn set_blocks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Block>>) -> Self {
        self.blocks = input;
        self
    }
    /// <p>The results of the text-analysis operation.</p>
    pub fn get_blocks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Block>> {
        &self.blocks
    }
    /// Appends an item to `warnings`.
    ///
    /// To override the contents of this collection use [`set_warnings`](Self::set_warnings).
    ///
    /// <p>A list of warnings that occurred during the document-analysis operation.</p>
    pub fn warnings(mut self, input: crate::types::Warning) -> Self {
        let mut v = self.warnings.unwrap_or_default();
        v.push(input);
        self.warnings = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of warnings that occurred during the document-analysis operation.</p>
    pub fn set_warnings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Warning>>) -> Self {
        self.warnings = input;
        self
    }
    /// <p>A list of warnings that occurred during the document-analysis operation.</p>
    pub fn get_warnings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Warning>> {
        &self.warnings
    }
    /// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_message = input;
        self
    }
    /// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// <p></p>
    pub fn analyze_document_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.analyze_document_model_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p></p>
    pub fn set_analyze_document_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.analyze_document_model_version = input;
        self
    }
    /// <p></p>
    pub fn get_analyze_document_model_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.analyze_document_model_version
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetDocumentAnalysisOutput`](crate::operation::get_document_analysis::GetDocumentAnalysisOutput).
    pub fn build(self) -> crate::operation::get_document_analysis::GetDocumentAnalysisOutput {
        crate::operation::get_document_analysis::GetDocumentAnalysisOutput {
            document_metadata: self.document_metadata,
            job_status: self.job_status,
            next_token: self.next_token,
            blocks: self.blocks,
            warnings: self.warnings,
            status_message: self.status_message,
            analyze_document_model_version: self.analyze_document_model_version,
            _request_id: self._request_id,
        }
    }
}