1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// 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 AnalyzeDocumentOutput {
    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
    pub document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
    pub blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
    /// <p>Shows the results of the human in the loop evaluation.</p>
    pub human_loop_activation_output: ::std::option::Option<crate::types::HumanLoopActivationOutput>,
    /// <p>The version of the model used to analyze the document.</p>
    pub analyze_document_model_version: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl AnalyzeDocumentOutput {
    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
    pub fn document_metadata(&self) -> ::std::option::Option<&crate::types::DocumentMetadata> {
        self.document_metadata.as_ref()
    }
    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</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>Shows the results of the human in the loop evaluation.</p>
    pub fn human_loop_activation_output(&self) -> ::std::option::Option<&crate::types::HumanLoopActivationOutput> {
        self.human_loop_activation_output.as_ref()
    }
    /// <p>The version of the model used to analyze the document.</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 AnalyzeDocumentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl AnalyzeDocumentOutput {
    /// Creates a new builder-style object to manufacture [`AnalyzeDocumentOutput`](crate::operation::analyze_document::AnalyzeDocumentOutput).
    pub fn builder() -> crate::operation::analyze_document::builders::AnalyzeDocumentOutputBuilder {
        crate::operation::analyze_document::builders::AnalyzeDocumentOutputBuilder::default()
    }
}

/// A builder for [`AnalyzeDocumentOutput`](crate::operation::analyze_document::AnalyzeDocumentOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AnalyzeDocumentOutputBuilder {
    pub(crate) document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
    pub(crate) blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
    pub(crate) human_loop_activation_output: ::std::option::Option<crate::types::HumanLoopActivationOutput>,
    pub(crate) analyze_document_model_version: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl AnalyzeDocumentOutputBuilder {
    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
    pub fn document_metadata(mut self, input: crate::types::DocumentMetadata) -> Self {
        self.document_metadata = ::std::option::Option::Some(input);
        self
    }
    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
    pub fn set_document_metadata(mut self, input: ::std::option::Option<crate::types::DocumentMetadata>) -> Self {
        self.document_metadata = input;
        self
    }
    /// <p>Metadata about the analyzed document. An example is the number of pages.</p>
    pub fn get_document_metadata(&self) -> &::std::option::Option<crate::types::DocumentMetadata> {
        &self.document_metadata
    }
    /// Appends an item to `blocks`.
    ///
    /// To override the contents of this collection use [`set_blocks`](Self::set_blocks).
    ///
    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</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 items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
    pub fn set_blocks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Block>>) -> Self {
        self.blocks = input;
        self
    }
    /// <p>The items that are detected and analyzed by <code>AnalyzeDocument</code>.</p>
    pub fn get_blocks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Block>> {
        &self.blocks
    }
    /// <p>Shows the results of the human in the loop evaluation.</p>
    pub fn human_loop_activation_output(mut self, input: crate::types::HumanLoopActivationOutput) -> Self {
        self.human_loop_activation_output = ::std::option::Option::Some(input);
        self
    }
    /// <p>Shows the results of the human in the loop evaluation.</p>
    pub fn set_human_loop_activation_output(mut self, input: ::std::option::Option<crate::types::HumanLoopActivationOutput>) -> Self {
        self.human_loop_activation_output = input;
        self
    }
    /// <p>Shows the results of the human in the loop evaluation.</p>
    pub fn get_human_loop_activation_output(&self) -> &::std::option::Option<crate::types::HumanLoopActivationOutput> {
        &self.human_loop_activation_output
    }
    /// <p>The version of the model used to analyze the document.</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>The version of the model used to analyze the document.</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>The version of the model used to analyze the document.</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 [`AnalyzeDocumentOutput`](crate::operation::analyze_document::AnalyzeDocumentOutput).
    pub fn build(self) -> crate::operation::analyze_document::AnalyzeDocumentOutput {
        crate::operation::analyze_document::AnalyzeDocumentOutput {
            document_metadata: self.document_metadata,
            blocks: self.blocks,
            human_loop_activation_output: self.human_loop_activation_output,
            analyze_document_model_version: self.analyze_document_model_version,
            _request_id: self._request_id,
        }
    }
}