aws_sdk_textract/operation/analyze_id/
_analyze_id_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 AnalyzeIdOutput {
6    /// <p>The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.</p>
7    pub identity_documents: ::std::option::Option<::std::vec::Vec<crate::types::IdentityDocument>>,
8    /// <p>Information about the input document.</p>
9    pub document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
10    /// <p>The version of the AnalyzeIdentity API being used to process documents.</p>
11    pub analyze_id_model_version: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl AnalyzeIdOutput {
15    /// <p>The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.identity_documents.is_none()`.
18    pub fn identity_documents(&self) -> &[crate::types::IdentityDocument] {
19        self.identity_documents.as_deref().unwrap_or_default()
20    }
21    /// <p>Information about the input document.</p>
22    pub fn document_metadata(&self) -> ::std::option::Option<&crate::types::DocumentMetadata> {
23        self.document_metadata.as_ref()
24    }
25    /// <p>The version of the AnalyzeIdentity API being used to process documents.</p>
26    pub fn analyze_id_model_version(&self) -> ::std::option::Option<&str> {
27        self.analyze_id_model_version.as_deref()
28    }
29}
30impl ::aws_types::request_id::RequestId for AnalyzeIdOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl AnalyzeIdOutput {
36    /// Creates a new builder-style object to manufacture [`AnalyzeIdOutput`](crate::operation::analyze_id::AnalyzeIdOutput).
37    pub fn builder() -> crate::operation::analyze_id::builders::AnalyzeIdOutputBuilder {
38        crate::operation::analyze_id::builders::AnalyzeIdOutputBuilder::default()
39    }
40}
41
42/// A builder for [`AnalyzeIdOutput`](crate::operation::analyze_id::AnalyzeIdOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct AnalyzeIdOutputBuilder {
46    pub(crate) identity_documents: ::std::option::Option<::std::vec::Vec<crate::types::IdentityDocument>>,
47    pub(crate) document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
48    pub(crate) analyze_id_model_version: ::std::option::Option<::std::string::String>,
49    _request_id: Option<String>,
50}
51impl AnalyzeIdOutputBuilder {
52    /// Appends an item to `identity_documents`.
53    ///
54    /// To override the contents of this collection use [`set_identity_documents`](Self::set_identity_documents).
55    ///
56    /// <p>The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.</p>
57    pub fn identity_documents(mut self, input: crate::types::IdentityDocument) -> Self {
58        let mut v = self.identity_documents.unwrap_or_default();
59        v.push(input);
60        self.identity_documents = ::std::option::Option::Some(v);
61        self
62    }
63    /// <p>The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.</p>
64    pub fn set_identity_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IdentityDocument>>) -> Self {
65        self.identity_documents = input;
66        self
67    }
68    /// <p>The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.</p>
69    pub fn get_identity_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IdentityDocument>> {
70        &self.identity_documents
71    }
72    /// <p>Information about the input document.</p>
73    pub fn document_metadata(mut self, input: crate::types::DocumentMetadata) -> Self {
74        self.document_metadata = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>Information about the input document.</p>
78    pub fn set_document_metadata(mut self, input: ::std::option::Option<crate::types::DocumentMetadata>) -> Self {
79        self.document_metadata = input;
80        self
81    }
82    /// <p>Information about the input document.</p>
83    pub fn get_document_metadata(&self) -> &::std::option::Option<crate::types::DocumentMetadata> {
84        &self.document_metadata
85    }
86    /// <p>The version of the AnalyzeIdentity API being used to process documents.</p>
87    pub fn analyze_id_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.analyze_id_model_version = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The version of the AnalyzeIdentity API being used to process documents.</p>
92    pub fn set_analyze_id_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.analyze_id_model_version = input;
94        self
95    }
96    /// <p>The version of the AnalyzeIdentity API being used to process documents.</p>
97    pub fn get_analyze_id_model_version(&self) -> &::std::option::Option<::std::string::String> {
98        &self.analyze_id_model_version
99    }
100    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
101        self._request_id = Some(request_id.into());
102        self
103    }
104
105    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
106        self._request_id = request_id;
107        self
108    }
109    /// Consumes the builder and constructs a [`AnalyzeIdOutput`](crate::operation::analyze_id::AnalyzeIdOutput).
110    pub fn build(self) -> crate::operation::analyze_id::AnalyzeIdOutput {
111        crate::operation::analyze_id::AnalyzeIdOutput {
112            identity_documents: self.identity_documents,
113            document_metadata: self.document_metadata,
114            analyze_id_model_version: self.analyze_id_model_version,
115            _request_id: self._request_id,
116        }
117    }
118}