Skip to main content

aws_sdk_workdocs/operation/get_document/
_get_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 GetDocumentOutput {
6    /// <p>The metadata details of the document.</p>
7    pub metadata: ::std::option::Option<crate::types::DocumentMetadata>,
8    /// <p>The custom metadata on the document.</p>
9    pub custom_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10    _request_id: Option<String>,
11}
12impl GetDocumentOutput {
13    /// <p>The metadata details of the document.</p>
14    pub fn metadata(&self) -> ::std::option::Option<&crate::types::DocumentMetadata> {
15        self.metadata.as_ref()
16    }
17    /// <p>The custom metadata on the document.</p>
18    pub fn custom_metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
19        self.custom_metadata.as_ref()
20    }
21}
22impl ::aws_types::request_id::RequestId for GetDocumentOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl GetDocumentOutput {
28    /// Creates a new builder-style object to manufacture [`GetDocumentOutput`](crate::operation::get_document::GetDocumentOutput).
29    pub fn builder() -> crate::operation::get_document::builders::GetDocumentOutputBuilder {
30        crate::operation::get_document::builders::GetDocumentOutputBuilder::default()
31    }
32}
33
34/// A builder for [`GetDocumentOutput`](crate::operation::get_document::GetDocumentOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GetDocumentOutputBuilder {
38    pub(crate) metadata: ::std::option::Option<crate::types::DocumentMetadata>,
39    pub(crate) custom_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
40    _request_id: Option<String>,
41}
42impl GetDocumentOutputBuilder {
43    /// <p>The metadata details of the document.</p>
44    pub fn metadata(mut self, input: crate::types::DocumentMetadata) -> Self {
45        self.metadata = ::std::option::Option::Some(input);
46        self
47    }
48    /// <p>The metadata details of the document.</p>
49    pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::DocumentMetadata>) -> Self {
50        self.metadata = input;
51        self
52    }
53    /// <p>The metadata details of the document.</p>
54    pub fn get_metadata(&self) -> &::std::option::Option<crate::types::DocumentMetadata> {
55        &self.metadata
56    }
57    /// Adds a key-value pair to `custom_metadata`.
58    ///
59    /// To override the contents of this collection use [`set_custom_metadata`](Self::set_custom_metadata).
60    ///
61    /// <p>The custom metadata on the document.</p>
62    pub fn custom_metadata(
63        mut self,
64        k: impl ::std::convert::Into<::std::string::String>,
65        v: impl ::std::convert::Into<::std::string::String>,
66    ) -> Self {
67        let mut hash_map = self.custom_metadata.unwrap_or_default();
68        hash_map.insert(k.into(), v.into());
69        self.custom_metadata = ::std::option::Option::Some(hash_map);
70        self
71    }
72    /// <p>The custom metadata on the document.</p>
73    pub fn set_custom_metadata(
74        mut self,
75        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
76    ) -> Self {
77        self.custom_metadata = input;
78        self
79    }
80    /// <p>The custom metadata on the document.</p>
81    pub fn get_custom_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
82        &self.custom_metadata
83    }
84    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
85        self._request_id = Some(request_id.into());
86        self
87    }
88
89    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
90        self._request_id = request_id;
91        self
92    }
93    /// Consumes the builder and constructs a [`GetDocumentOutput`](crate::operation::get_document::GetDocumentOutput).
94    pub fn build(self) -> crate::operation::get_document::GetDocumentOutput {
95        crate::operation::get_document::GetDocumentOutput {
96            metadata: self.metadata,
97            custom_metadata: self.custom_metadata,
98            _request_id: self._request_id,
99        }
100    }
101}