aws_sdk_mailmanager/operation/get_archive/
_get_archive_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetArchiveOutput {
7 pub archive_id: ::std::string::String,
9 pub archive_name: ::std::string::String,
11 pub archive_arn: ::std::string::String,
13 pub archive_state: crate::types::ArchiveState,
21 pub retention: ::std::option::Option<crate::types::ArchiveRetention>,
23 pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
25 pub last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
27 pub kms_key_arn: ::std::option::Option<::std::string::String>,
29 _request_id: Option<String>,
30}
31impl GetArchiveOutput {
32 pub fn archive_id(&self) -> &str {
34 use std::ops::Deref;
35 self.archive_id.deref()
36 }
37 pub fn archive_name(&self) -> &str {
39 use std::ops::Deref;
40 self.archive_name.deref()
41 }
42 pub fn archive_arn(&self) -> &str {
44 use std::ops::Deref;
45 self.archive_arn.deref()
46 }
47 pub fn archive_state(&self) -> &crate::types::ArchiveState {
55 &self.archive_state
56 }
57 pub fn retention(&self) -> ::std::option::Option<&crate::types::ArchiveRetention> {
59 self.retention.as_ref()
60 }
61 pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
63 self.created_timestamp.as_ref()
64 }
65 pub fn last_updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67 self.last_updated_timestamp.as_ref()
68 }
69 pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
71 self.kms_key_arn.as_deref()
72 }
73}
74impl ::aws_types::request_id::RequestId for GetArchiveOutput {
75 fn request_id(&self) -> Option<&str> {
76 self._request_id.as_deref()
77 }
78}
79impl GetArchiveOutput {
80 pub fn builder() -> crate::operation::get_archive::builders::GetArchiveOutputBuilder {
82 crate::operation::get_archive::builders::GetArchiveOutputBuilder::default()
83 }
84}
85
86#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
88#[non_exhaustive]
89pub struct GetArchiveOutputBuilder {
90 pub(crate) archive_id: ::std::option::Option<::std::string::String>,
91 pub(crate) archive_name: ::std::option::Option<::std::string::String>,
92 pub(crate) archive_arn: ::std::option::Option<::std::string::String>,
93 pub(crate) archive_state: ::std::option::Option<crate::types::ArchiveState>,
94 pub(crate) retention: ::std::option::Option<crate::types::ArchiveRetention>,
95 pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
96 pub(crate) last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
97 pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
98 _request_id: Option<String>,
99}
100impl GetArchiveOutputBuilder {
101 pub fn archive_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.archive_id = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_archive_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.archive_id = input;
110 self
111 }
112 pub fn get_archive_id(&self) -> &::std::option::Option<::std::string::String> {
114 &self.archive_id
115 }
116 pub fn archive_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.archive_name = ::std::option::Option::Some(input.into());
120 self
121 }
122 pub fn set_archive_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.archive_name = input;
125 self
126 }
127 pub fn get_archive_name(&self) -> &::std::option::Option<::std::string::String> {
129 &self.archive_name
130 }
131 pub fn archive_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.archive_arn = ::std::option::Option::Some(input.into());
135 self
136 }
137 pub fn set_archive_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.archive_arn = input;
140 self
141 }
142 pub fn get_archive_arn(&self) -> &::std::option::Option<::std::string::String> {
144 &self.archive_arn
145 }
146 pub fn archive_state(mut self, input: crate::types::ArchiveState) -> Self {
155 self.archive_state = ::std::option::Option::Some(input);
156 self
157 }
158 pub fn set_archive_state(mut self, input: ::std::option::Option<crate::types::ArchiveState>) -> Self {
166 self.archive_state = input;
167 self
168 }
169 pub fn get_archive_state(&self) -> &::std::option::Option<crate::types::ArchiveState> {
177 &self.archive_state
178 }
179 pub fn retention(mut self, input: crate::types::ArchiveRetention) -> Self {
182 self.retention = ::std::option::Option::Some(input);
183 self
184 }
185 pub fn set_retention(mut self, input: ::std::option::Option<crate::types::ArchiveRetention>) -> Self {
187 self.retention = input;
188 self
189 }
190 pub fn get_retention(&self) -> &::std::option::Option<crate::types::ArchiveRetention> {
192 &self.retention
193 }
194 pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
196 self.created_timestamp = ::std::option::Option::Some(input);
197 self
198 }
199 pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
201 self.created_timestamp = input;
202 self
203 }
204 pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
206 &self.created_timestamp
207 }
208 pub fn last_updated_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
210 self.last_updated_timestamp = ::std::option::Option::Some(input);
211 self
212 }
213 pub fn set_last_updated_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
215 self.last_updated_timestamp = input;
216 self
217 }
218 pub fn get_last_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
220 &self.last_updated_timestamp
221 }
222 pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224 self.kms_key_arn = ::std::option::Option::Some(input.into());
225 self
226 }
227 pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229 self.kms_key_arn = input;
230 self
231 }
232 pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
234 &self.kms_key_arn
235 }
236 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
237 self._request_id = Some(request_id.into());
238 self
239 }
240
241 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
242 self._request_id = request_id;
243 self
244 }
245 pub fn build(self) -> ::std::result::Result<crate::operation::get_archive::GetArchiveOutput, ::aws_smithy_types::error::operation::BuildError> {
252 ::std::result::Result::Ok(crate::operation::get_archive::GetArchiveOutput {
253 archive_id: self.archive_id.ok_or_else(|| {
254 ::aws_smithy_types::error::operation::BuildError::missing_field(
255 "archive_id",
256 "archive_id was not specified but it is required when building GetArchiveOutput",
257 )
258 })?,
259 archive_name: self.archive_name.ok_or_else(|| {
260 ::aws_smithy_types::error::operation::BuildError::missing_field(
261 "archive_name",
262 "archive_name was not specified but it is required when building GetArchiveOutput",
263 )
264 })?,
265 archive_arn: self.archive_arn.ok_or_else(|| {
266 ::aws_smithy_types::error::operation::BuildError::missing_field(
267 "archive_arn",
268 "archive_arn was not specified but it is required when building GetArchiveOutput",
269 )
270 })?,
271 archive_state: self.archive_state.ok_or_else(|| {
272 ::aws_smithy_types::error::operation::BuildError::missing_field(
273 "archive_state",
274 "archive_state was not specified but it is required when building GetArchiveOutput",
275 )
276 })?,
277 retention: self.retention,
278 created_timestamp: self.created_timestamp,
279 last_updated_timestamp: self.last_updated_timestamp,
280 kms_key_arn: self.kms_key_arn,
281 _request_id: self._request_id,
282 })
283 }
284}