aws_sdk_s3/operation/get_object_tagging/
_get_object_tagging_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetObjectTaggingOutput {
6 pub version_id: ::std::option::Option<::std::string::String>,
8 pub tag_set: ::std::vec::Vec<crate::types::Tag>,
10 _extended_request_id: Option<String>,
11 _request_id: Option<String>,
12}
13impl GetObjectTaggingOutput {
14 pub fn version_id(&self) -> ::std::option::Option<&str> {
16 self.version_id.as_deref()
17 }
18 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 pub fn builder() -> crate::operation::get_object_tagging::builders::GetObjectTaggingOutputBuilder {
37 crate::operation::get_object_tagging::builders::GetObjectTaggingOutputBuilder::default()
38 }
39}
40
41#[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 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 pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.version_id = input;
59 self
60 }
61 pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
63 &self.version_id
64 }
65 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 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 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 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}