aws_sdk_textract/operation/analyze_document/
_analyze_document_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct AnalyzeDocumentOutput {
6    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
7    pub document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
8    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
9    pub blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
10    /// <p>Shows the results of the human in the loop evaluation.</p>
11    pub human_loop_activation_output: ::std::option::Option<crate::types::HumanLoopActivationOutput>,
12    /// <p>The version of the model used to analyze the document.</p>
13    pub analyze_document_model_version: ::std::option::Option<::std::string::String>,
14    _request_id: Option<String>,
15}
16impl AnalyzeDocumentOutput {
17    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
18    pub fn document_metadata(&self) -> ::std::option::Option<&crate::types::DocumentMetadata> {
19        self.document_metadata.as_ref()
20    }
21    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
22    ///
23    /// 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()`.
24    pub fn blocks(&self) -> &[crate::types::Block] {
25        self.blocks.as_deref().unwrap_or_default()
26    }
27    /// <p>Shows the results of the human in the loop evaluation.</p>
28    pub fn human_loop_activation_output(&self) -> ::std::option::Option<&crate::types::HumanLoopActivationOutput> {
29        self.human_loop_activation_output.as_ref()
30    }
31    /// <p>The version of the model used to analyze the document.</p>
32    pub fn analyze_document_model_version(&self) -> ::std::option::Option<&str> {
33        self.analyze_document_model_version.as_deref()
34    }
35}
36impl ::aws_types::request_id::RequestId for AnalyzeDocumentOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl AnalyzeDocumentOutput {
42    /// Creates a new builder-style object to manufacture [`AnalyzeDocumentOutput`](crate::operation::analyze_document::AnalyzeDocumentOutput).
43    pub fn builder() -> crate::operation::analyze_document::builders::AnalyzeDocumentOutputBuilder {
44        crate::operation::analyze_document::builders::AnalyzeDocumentOutputBuilder::default()
45    }
46}
47
48/// A builder for [`AnalyzeDocumentOutput`](crate::operation::analyze_document::AnalyzeDocumentOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct AnalyzeDocumentOutputBuilder {
52    pub(crate) document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
53    pub(crate) blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
54    pub(crate) human_loop_activation_output: ::std::option::Option<crate::types::HumanLoopActivationOutput>,
55    pub(crate) analyze_document_model_version: ::std::option::Option<::std::string::String>,
56    _request_id: Option<String>,
57}
58impl AnalyzeDocumentOutputBuilder {
59    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
60    pub fn document_metadata(mut self, input: crate::types::DocumentMetadata) -> Self {
61        self.document_metadata = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
65    pub fn set_document_metadata(mut self, input: ::std::option::Option<crate::types::DocumentMetadata>) -> Self {
66        self.document_metadata = input;
67        self
68    }
69    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
70    pub fn get_document_metadata(&self) -> &::std::option::Option<crate::types::DocumentMetadata> {
71        &self.document_metadata
72    }
73    /// Appends an item to `blocks`.
74    ///
75    /// To override the contents of this collection use [`set_blocks`](Self::set_blocks).
76    ///
77    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
78    pub fn blocks(mut self, input: crate::types::Block) -> Self {
79        let mut v = self.blocks.unwrap_or_default();
80        v.push(input);
81        self.blocks = ::std::option::Option::Some(v);
82        self
83    }
84    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
85    pub fn set_blocks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Block>>) -> Self {
86        self.blocks = input;
87        self
88    }
89    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
90    pub fn get_blocks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Block>> {
91        &self.blocks
92    }
93    /// <p>Shows the results of the human in the loop evaluation.</p>
94    pub fn human_loop_activation_output(mut self, input: crate::types::HumanLoopActivationOutput) -> Self {
95        self.human_loop_activation_output = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>Shows the results of the human in the loop evaluation.</p>
99    pub fn set_human_loop_activation_output(mut self, input: ::std::option::Option<crate::types::HumanLoopActivationOutput>) -> Self {
100        self.human_loop_activation_output = input;
101        self
102    }
103    /// <p>Shows the results of the human in the loop evaluation.</p>
104    pub fn get_human_loop_activation_output(&self) -> &::std::option::Option<crate::types::HumanLoopActivationOutput> {
105        &self.human_loop_activation_output
106    }
107    /// <p>The version of the model used to analyze the document.</p>
108    pub fn analyze_document_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.analyze_document_model_version = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The version of the model used to analyze the document.</p>
113    pub fn set_analyze_document_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.analyze_document_model_version = input;
115        self
116    }
117    /// <p>The version of the model used to analyze the document.</p>
118    pub fn get_analyze_document_model_version(&self) -> &::std::option::Option<::std::string::String> {
119        &self.analyze_document_model_version
120    }
121    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
122        self._request_id = Some(request_id.into());
123        self
124    }
125
126    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
127        self._request_id = request_id;
128        self
129    }
130    /// Consumes the builder and constructs a [`AnalyzeDocumentOutput`](crate::operation::analyze_document::AnalyzeDocumentOutput).
131    pub fn build(self) -> crate::operation::analyze_document::AnalyzeDocumentOutput {
132        crate::operation::analyze_document::AnalyzeDocumentOutput {
133            document_metadata: self.document_metadata,
134            blocks: self.blocks,
135            human_loop_activation_output: self.human_loop_activation_output,
136            analyze_document_model_version: self.analyze_document_model_version,
137            _request_id: self._request_id,
138        }
139    }
140}