aws_sdk_mailmanager/operation/get_archive/
_get_archive_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The response containing details of the requested archive.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetArchiveOutput {
7    /// <p>The unique identifier of the archive.</p>
8    pub archive_id: ::std::string::String,
9    /// <p>The unique name assigned to the archive.</p>
10    pub archive_name: ::std::string::String,
11    /// <p>The Amazon Resource Name (ARN) of the archive.</p>
12    pub archive_arn: ::std::string::String,
13    /// <p>The current state of the archive:</p>
14    /// <ul>
15    /// <li>
16    /// <p><code>ACTIVE</code> – The archive is ready and available for use.</p></li>
17    /// <li>
18    /// <p><code>PENDING_DELETION</code> – The archive has been marked for deletion and will be permanently deleted in 30 days. No further modifications can be made in this state.</p></li>
19    /// </ul>
20    pub archive_state: crate::types::ArchiveState,
21    /// <p>The retention period for emails in this archive.</p>
22    pub retention: ::std::option::Option<crate::types::ArchiveRetention>,
23    /// <p>The timestamp of when the archive was created.</p>
24    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
25    /// <p>The timestamp of when the archive was modified.</p>
26    pub last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
27    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the archive.</p>
28    pub kms_key_arn: ::std::option::Option<::std::string::String>,
29    _request_id: Option<String>,
30}
31impl GetArchiveOutput {
32    /// <p>The unique identifier of the archive.</p>
33    pub fn archive_id(&self) -> &str {
34        use std::ops::Deref;
35        self.archive_id.deref()
36    }
37    /// <p>The unique name assigned to the archive.</p>
38    pub fn archive_name(&self) -> &str {
39        use std::ops::Deref;
40        self.archive_name.deref()
41    }
42    /// <p>The Amazon Resource Name (ARN) of the archive.</p>
43    pub fn archive_arn(&self) -> &str {
44        use std::ops::Deref;
45        self.archive_arn.deref()
46    }
47    /// <p>The current state of the archive:</p>
48    /// <ul>
49    /// <li>
50    /// <p><code>ACTIVE</code> – The archive is ready and available for use.</p></li>
51    /// <li>
52    /// <p><code>PENDING_DELETION</code> – The archive has been marked for deletion and will be permanently deleted in 30 days. No further modifications can be made in this state.</p></li>
53    /// </ul>
54    pub fn archive_state(&self) -> &crate::types::ArchiveState {
55        &self.archive_state
56    }
57    /// <p>The retention period for emails in this archive.</p>
58    pub fn retention(&self) -> ::std::option::Option<&crate::types::ArchiveRetention> {
59        self.retention.as_ref()
60    }
61    /// <p>The timestamp of when the archive was created.</p>
62    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
63        self.created_timestamp.as_ref()
64    }
65    /// <p>The timestamp of when the archive was modified.</p>
66    pub fn last_updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67        self.last_updated_timestamp.as_ref()
68    }
69    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the archive.</p>
70    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    /// Creates a new builder-style object to manufacture [`GetArchiveOutput`](crate::operation::get_archive::GetArchiveOutput).
81    pub fn builder() -> crate::operation::get_archive::builders::GetArchiveOutputBuilder {
82        crate::operation::get_archive::builders::GetArchiveOutputBuilder::default()
83    }
84}
85
86/// A builder for [`GetArchiveOutput`](crate::operation::get_archive::GetArchiveOutput).
87#[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    /// <p>The unique identifier of the archive.</p>
102    /// This field is required.
103    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    /// <p>The unique identifier of the archive.</p>
108    pub fn set_archive_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.archive_id = input;
110        self
111    }
112    /// <p>The unique identifier of the archive.</p>
113    pub fn get_archive_id(&self) -> &::std::option::Option<::std::string::String> {
114        &self.archive_id
115    }
116    /// <p>The unique name assigned to the archive.</p>
117    /// This field is required.
118    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    /// <p>The unique name assigned to the archive.</p>
123    pub fn set_archive_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.archive_name = input;
125        self
126    }
127    /// <p>The unique name assigned to the archive.</p>
128    pub fn get_archive_name(&self) -> &::std::option::Option<::std::string::String> {
129        &self.archive_name
130    }
131    /// <p>The Amazon Resource Name (ARN) of the archive.</p>
132    /// This field is required.
133    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    /// <p>The Amazon Resource Name (ARN) of the archive.</p>
138    pub fn set_archive_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.archive_arn = input;
140        self
141    }
142    /// <p>The Amazon Resource Name (ARN) of the archive.</p>
143    pub fn get_archive_arn(&self) -> &::std::option::Option<::std::string::String> {
144        &self.archive_arn
145    }
146    /// <p>The current state of the archive:</p>
147    /// <ul>
148    /// <li>
149    /// <p><code>ACTIVE</code> – The archive is ready and available for use.</p></li>
150    /// <li>
151    /// <p><code>PENDING_DELETION</code> – The archive has been marked for deletion and will be permanently deleted in 30 days. No further modifications can be made in this state.</p></li>
152    /// </ul>
153    /// This field is required.
154    pub fn archive_state(mut self, input: crate::types::ArchiveState) -> Self {
155        self.archive_state = ::std::option::Option::Some(input);
156        self
157    }
158    /// <p>The current state of the archive:</p>
159    /// <ul>
160    /// <li>
161    /// <p><code>ACTIVE</code> – The archive is ready and available for use.</p></li>
162    /// <li>
163    /// <p><code>PENDING_DELETION</code> – The archive has been marked for deletion and will be permanently deleted in 30 days. No further modifications can be made in this state.</p></li>
164    /// </ul>
165    pub fn set_archive_state(mut self, input: ::std::option::Option<crate::types::ArchiveState>) -> Self {
166        self.archive_state = input;
167        self
168    }
169    /// <p>The current state of the archive:</p>
170    /// <ul>
171    /// <li>
172    /// <p><code>ACTIVE</code> – The archive is ready and available for use.</p></li>
173    /// <li>
174    /// <p><code>PENDING_DELETION</code> – The archive has been marked for deletion and will be permanently deleted in 30 days. No further modifications can be made in this state.</p></li>
175    /// </ul>
176    pub fn get_archive_state(&self) -> &::std::option::Option<crate::types::ArchiveState> {
177        &self.archive_state
178    }
179    /// <p>The retention period for emails in this archive.</p>
180    /// This field is required.
181    pub fn retention(mut self, input: crate::types::ArchiveRetention) -> Self {
182        self.retention = ::std::option::Option::Some(input);
183        self
184    }
185    /// <p>The retention period for emails in this archive.</p>
186    pub fn set_retention(mut self, input: ::std::option::Option<crate::types::ArchiveRetention>) -> Self {
187        self.retention = input;
188        self
189    }
190    /// <p>The retention period for emails in this archive.</p>
191    pub fn get_retention(&self) -> &::std::option::Option<crate::types::ArchiveRetention> {
192        &self.retention
193    }
194    /// <p>The timestamp of when the archive was created.</p>
195    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    /// <p>The timestamp of when the archive was created.</p>
200    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    /// <p>The timestamp of when the archive was created.</p>
205    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
206        &self.created_timestamp
207    }
208    /// <p>The timestamp of when the archive was modified.</p>
209    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    /// <p>The timestamp of when the archive was modified.</p>
214    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    /// <p>The timestamp of when the archive was modified.</p>
219    pub fn get_last_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
220        &self.last_updated_timestamp
221    }
222    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the archive.</p>
223    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    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the archive.</p>
228    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    /// <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the archive.</p>
233    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    /// Consumes the builder and constructs a [`GetArchiveOutput`](crate::operation::get_archive::GetArchiveOutput).
246    /// This method will fail if any of the following fields are not set:
247    /// - [`archive_id`](crate::operation::get_archive::builders::GetArchiveOutputBuilder::archive_id)
248    /// - [`archive_name`](crate::operation::get_archive::builders::GetArchiveOutputBuilder::archive_name)
249    /// - [`archive_arn`](crate::operation::get_archive::builders::GetArchiveOutputBuilder::archive_arn)
250    /// - [`archive_state`](crate::operation::get_archive::builders::GetArchiveOutputBuilder::archive_state)
251    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}