aws_sdk_s3/operation/get_object_tagging/
_get_object_tagging_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 GetObjectTaggingOutput {
6    /// <p>The versionId of the object for which you got the tagging information.</p>
7    pub version_id: ::std::option::Option<::std::string::String>,
8    /// <p>Contains the tag set.</p>
9    pub tag_set: ::std::vec::Vec<crate::types::Tag>,
10    _extended_request_id: Option<String>,
11    _request_id: Option<String>,
12}
13impl GetObjectTaggingOutput {
14    /// <p>The versionId of the object for which you got the tagging information.</p>
15    pub fn version_id(&self) -> ::std::option::Option<&str> {
16        self.version_id.as_deref()
17    }
18    /// <p>Contains the tag set.</p>
19    pub fn tag_set(&self) -> &[crate::types::Tag] {
20        use std::ops::Deref;
21        self.tag_set.deref()
22    }
23}
24impl crate::s3_request_id::RequestIdExt for GetObjectTaggingOutput {
25    fn extended_request_id(&self) -> Option<&str> {
26        self._extended_request_id.as_deref()
27    }
28}
29impl ::aws_types::request_id::RequestId for GetObjectTaggingOutput {
30    fn request_id(&self) -> Option<&str> {
31        self._request_id.as_deref()
32    }
33}
34impl GetObjectTaggingOutput {
35    /// Creates a new builder-style object to manufacture [`GetObjectTaggingOutput`](crate::operation::get_object_tagging::GetObjectTaggingOutput).
36    pub fn builder() -> crate::operation::get_object_tagging::builders::GetObjectTaggingOutputBuilder {
37        crate::operation::get_object_tagging::builders::GetObjectTaggingOutputBuilder::default()
38    }
39}
40
41/// A builder for [`GetObjectTaggingOutput`](crate::operation::get_object_tagging::GetObjectTaggingOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct GetObjectTaggingOutputBuilder {
45    pub(crate) version_id: ::std::option::Option<::std::string::String>,
46    pub(crate) tag_set: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
47    _extended_request_id: Option<String>,
48    _request_id: Option<String>,
49}
50impl GetObjectTaggingOutputBuilder {
51    /// <p>The versionId of the object for which you got the tagging information.</p>
52    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.version_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The versionId of the object for which you got the tagging information.</p>
57    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.version_id = input;
59        self
60    }
61    /// <p>The versionId of the object for which you got the tagging information.</p>
62    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.version_id
64    }
65    /// Appends an item to `tag_set`.
66    ///
67    /// To override the contents of this collection use [`set_tag_set`](Self::set_tag_set).
68    ///
69    /// <p>Contains the tag set.</p>
70    pub fn tag_set(mut self, input: crate::types::Tag) -> Self {
71        let mut v = self.tag_set.unwrap_or_default();
72        v.push(input);
73        self.tag_set = ::std::option::Option::Some(v);
74        self
75    }
76    /// <p>Contains the tag set.</p>
77    pub fn set_tag_set(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
78        self.tag_set = input;
79        self
80    }
81    /// <p>Contains the tag set.</p>
82    pub fn get_tag_set(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
83        &self.tag_set
84    }
85    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
86        self._extended_request_id = Some(extended_request_id.into());
87        self
88    }
89
90    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
91        self._extended_request_id = extended_request_id;
92        self
93    }
94    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
95        self._request_id = Some(request_id.into());
96        self
97    }
98
99    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
100        self._request_id = request_id;
101        self
102    }
103    /// Consumes the builder and constructs a [`GetObjectTaggingOutput`](crate::operation::get_object_tagging::GetObjectTaggingOutput).
104    /// This method will fail if any of the following fields are not set:
105    /// - [`tag_set`](crate::operation::get_object_tagging::builders::GetObjectTaggingOutputBuilder::tag_set)
106    pub fn build(
107        self,
108    ) -> ::std::result::Result<crate::operation::get_object_tagging::GetObjectTaggingOutput, ::aws_smithy_types::error::operation::BuildError> {
109        ::std::result::Result::Ok(crate::operation::get_object_tagging::GetObjectTaggingOutput {
110            version_id: self.version_id,
111            tag_set: self.tag_set.ok_or_else(|| {
112                ::aws_smithy_types::error::operation::BuildError::missing_field(
113                    "tag_set",
114                    "tag_set was not specified but it is required when building GetObjectTaggingOutput",
115                )
116            })?,
117            _extended_request_id: self._extended_request_id,
118            _request_id: self._request_id,
119        })
120    }
121}