aws_sdk_secretsmanager/operation/describe_secret/
_describe_secret_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 DescribeSecretOutput {
6    /// <p>The ARN of the secret.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the secret.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the secret.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The key ID or alias ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted. Secrets created using the console use an KMS key ID.</p>
13    pub kms_key_id: ::std::option::Option<::std::string::String>,
14    /// <p>Specifies whether automatic rotation is turned on for this secret. If the secret has never been configured for rotation, Secrets Manager returns null.</p>
15    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
16    pub rotation_enabled: ::std::option::Option<bool>,
17    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
18    pub rotation_lambda_arn: ::std::option::Option<::std::string::String>,
19    /// <p>The rotation schedule and Lambda function for this secret. If the secret previously had rotation turned on, but it is now turned off, this field shows the previous rotation schedule and rotation function. If the secret never had rotation turned on, this field is omitted.</p>
20    pub rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
21    /// <p>The last date and time that Secrets Manager rotated the secret. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null.</p>
22    pub last_rotated_date: ::std::option::Option<::aws_smithy_types::DateTime>,
23    /// <p>The last date and time that this secret was modified in any way.</p>
24    pub last_changed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
25    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
26    pub last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
27    /// <p>The date the secret is scheduled for deletion. If it is not scheduled for deletion, this field is omitted. When you delete a secret, Secrets Manager requires a recovery window of at least 7 days before deleting the secret. Some time after the deleted date, Secrets Manager deletes the secret, including all of its versions.</p>
28    /// <p>If a secret is scheduled for deletion, then its details, including the encrypted secret value, is not accessible. To cancel a scheduled deletion and restore access to the secret, use <code>RestoreSecret</code>.</p>
29    pub deleted_date: ::std::option::Option<::aws_smithy_types::DateTime>,
30    /// <p>The next rotation is scheduled to occur on or before this date. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null. If rotation fails, Secrets Manager retries the entire rotation process multiple times. If rotation is unsuccessful, this date may be in the past.</p>
31    /// <p>This date represents the latest date that rotation will occur, but it is not an approximate rotation date. In some cases, for example if you turn off automatic rotation and then turn it back on, the next rotation may occur much sooner than this date.</p>
32    pub next_rotation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
33    /// <p>The list of tags attached to the secret. To add tags to a secret, use <code>TagResource</code>. To remove tags, use <code>UntagResource</code>.</p>
34    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
35    /// <p>A list of the versions of the secret that have staging labels attached. Versions that don't have staging labels are considered deprecated and Secrets Manager can delete them.</p>
36    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
37    /// <ul>
38    /// <li>
39    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
40    /// <li>
41    /// <p><code>AWSPENDING</code>, which indicates the version of the secret that contains new secret information that will become the next current version when rotation finishes.</p>
42    /// <p>During rotation, Secrets Manager creates an <code>AWSPENDING</code> version ID before creating the new secret version. To check if a secret version exists, call <code>GetSecretValue</code>.</p></li>
43    /// <li>
44    /// <p><code>AWSPREVIOUS</code>, which indicates the previous current version of the secret. You can use this as the <i>last known good</i> version.</p></li>
45    /// </ul>
46    /// <p>For more information about rotation and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
47    pub version_ids_to_stages: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
48    /// <p>The ID of the service that created this secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html">Secrets managed by other Amazon Web Services services</a>.</p>
49    pub owning_service: ::std::option::Option<::std::string::String>,
50    /// <p>The date the secret was created.</p>
51    pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
52    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
53    pub primary_region: ::std::option::Option<::std::string::String>,
54    /// <p>A list of the replicas of this secret and their status:</p>
55    /// <ul>
56    /// <li>
57    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
58    /// <li>
59    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
60    /// <li>
61    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
62    /// </ul>
63    pub replication_status: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>,
64    _request_id: Option<String>,
65}
66impl DescribeSecretOutput {
67    /// <p>The ARN of the secret.</p>
68    pub fn arn(&self) -> ::std::option::Option<&str> {
69        self.arn.as_deref()
70    }
71    /// <p>The name of the secret.</p>
72    pub fn name(&self) -> ::std::option::Option<&str> {
73        self.name.as_deref()
74    }
75    /// <p>The description of the secret.</p>
76    pub fn description(&self) -> ::std::option::Option<&str> {
77        self.description.as_deref()
78    }
79    /// <p>The key ID or alias ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted. Secrets created using the console use an KMS key ID.</p>
80    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
81        self.kms_key_id.as_deref()
82    }
83    /// <p>Specifies whether automatic rotation is turned on for this secret. If the secret has never been configured for rotation, Secrets Manager returns null.</p>
84    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
85    pub fn rotation_enabled(&self) -> ::std::option::Option<bool> {
86        self.rotation_enabled
87    }
88    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
89    pub fn rotation_lambda_arn(&self) -> ::std::option::Option<&str> {
90        self.rotation_lambda_arn.as_deref()
91    }
92    /// <p>The rotation schedule and Lambda function for this secret. If the secret previously had rotation turned on, but it is now turned off, this field shows the previous rotation schedule and rotation function. If the secret never had rotation turned on, this field is omitted.</p>
93    pub fn rotation_rules(&self) -> ::std::option::Option<&crate::types::RotationRulesType> {
94        self.rotation_rules.as_ref()
95    }
96    /// <p>The last date and time that Secrets Manager rotated the secret. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null.</p>
97    pub fn last_rotated_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
98        self.last_rotated_date.as_ref()
99    }
100    /// <p>The last date and time that this secret was modified in any way.</p>
101    pub fn last_changed_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
102        self.last_changed_date.as_ref()
103    }
104    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
105    pub fn last_accessed_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
106        self.last_accessed_date.as_ref()
107    }
108    /// <p>The date the secret is scheduled for deletion. If it is not scheduled for deletion, this field is omitted. When you delete a secret, Secrets Manager requires a recovery window of at least 7 days before deleting the secret. Some time after the deleted date, Secrets Manager deletes the secret, including all of its versions.</p>
109    /// <p>If a secret is scheduled for deletion, then its details, including the encrypted secret value, is not accessible. To cancel a scheduled deletion and restore access to the secret, use <code>RestoreSecret</code>.</p>
110    pub fn deleted_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
111        self.deleted_date.as_ref()
112    }
113    /// <p>The next rotation is scheduled to occur on or before this date. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null. If rotation fails, Secrets Manager retries the entire rotation process multiple times. If rotation is unsuccessful, this date may be in the past.</p>
114    /// <p>This date represents the latest date that rotation will occur, but it is not an approximate rotation date. In some cases, for example if you turn off automatic rotation and then turn it back on, the next rotation may occur much sooner than this date.</p>
115    pub fn next_rotation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
116        self.next_rotation_date.as_ref()
117    }
118    /// <p>The list of tags attached to the secret. To add tags to a secret, use <code>TagResource</code>. To remove tags, use <code>UntagResource</code>.</p>
119    ///
120    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
121    pub fn tags(&self) -> &[crate::types::Tag] {
122        self.tags.as_deref().unwrap_or_default()
123    }
124    /// <p>A list of the versions of the secret that have staging labels attached. Versions that don't have staging labels are considered deprecated and Secrets Manager can delete them.</p>
125    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
126    /// <ul>
127    /// <li>
128    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
129    /// <li>
130    /// <p><code>AWSPENDING</code>, which indicates the version of the secret that contains new secret information that will become the next current version when rotation finishes.</p>
131    /// <p>During rotation, Secrets Manager creates an <code>AWSPENDING</code> version ID before creating the new secret version. To check if a secret version exists, call <code>GetSecretValue</code>.</p></li>
132    /// <li>
133    /// <p><code>AWSPREVIOUS</code>, which indicates the previous current version of the secret. You can use this as the <i>last known good</i> version.</p></li>
134    /// </ul>
135    /// <p>For more information about rotation and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
136    pub fn version_ids_to_stages(
137        &self,
138    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
139        self.version_ids_to_stages.as_ref()
140    }
141    /// <p>The ID of the service that created this secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html">Secrets managed by other Amazon Web Services services</a>.</p>
142    pub fn owning_service(&self) -> ::std::option::Option<&str> {
143        self.owning_service.as_deref()
144    }
145    /// <p>The date the secret was created.</p>
146    pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
147        self.created_date.as_ref()
148    }
149    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
150    pub fn primary_region(&self) -> ::std::option::Option<&str> {
151        self.primary_region.as_deref()
152    }
153    /// <p>A list of the replicas of this secret and their status:</p>
154    /// <ul>
155    /// <li>
156    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
157    /// <li>
158    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
159    /// <li>
160    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
161    /// </ul>
162    ///
163    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.replication_status.is_none()`.
164    pub fn replication_status(&self) -> &[crate::types::ReplicationStatusType] {
165        self.replication_status.as_deref().unwrap_or_default()
166    }
167}
168impl ::aws_types::request_id::RequestId for DescribeSecretOutput {
169    fn request_id(&self) -> Option<&str> {
170        self._request_id.as_deref()
171    }
172}
173impl DescribeSecretOutput {
174    /// Creates a new builder-style object to manufacture [`DescribeSecretOutput`](crate::operation::describe_secret::DescribeSecretOutput).
175    pub fn builder() -> crate::operation::describe_secret::builders::DescribeSecretOutputBuilder {
176        crate::operation::describe_secret::builders::DescribeSecretOutputBuilder::default()
177    }
178}
179
180/// A builder for [`DescribeSecretOutput`](crate::operation::describe_secret::DescribeSecretOutput).
181#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
182#[non_exhaustive]
183pub struct DescribeSecretOutputBuilder {
184    pub(crate) arn: ::std::option::Option<::std::string::String>,
185    pub(crate) name: ::std::option::Option<::std::string::String>,
186    pub(crate) description: ::std::option::Option<::std::string::String>,
187    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
188    pub(crate) rotation_enabled: ::std::option::Option<bool>,
189    pub(crate) rotation_lambda_arn: ::std::option::Option<::std::string::String>,
190    pub(crate) rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
191    pub(crate) last_rotated_date: ::std::option::Option<::aws_smithy_types::DateTime>,
192    pub(crate) last_changed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
193    pub(crate) last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
194    pub(crate) deleted_date: ::std::option::Option<::aws_smithy_types::DateTime>,
195    pub(crate) next_rotation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
196    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
197    pub(crate) version_ids_to_stages:
198        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
199    pub(crate) owning_service: ::std::option::Option<::std::string::String>,
200    pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
201    pub(crate) primary_region: ::std::option::Option<::std::string::String>,
202    pub(crate) replication_status: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>,
203    _request_id: Option<String>,
204}
205impl DescribeSecretOutputBuilder {
206    /// <p>The ARN of the secret.</p>
207    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.arn = ::std::option::Option::Some(input.into());
209        self
210    }
211    /// <p>The ARN of the secret.</p>
212    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.arn = input;
214        self
215    }
216    /// <p>The ARN of the secret.</p>
217    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
218        &self.arn
219    }
220    /// <p>The name of the secret.</p>
221    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222        self.name = ::std::option::Option::Some(input.into());
223        self
224    }
225    /// <p>The name of the secret.</p>
226    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227        self.name = input;
228        self
229    }
230    /// <p>The name of the secret.</p>
231    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
232        &self.name
233    }
234    /// <p>The description of the secret.</p>
235    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236        self.description = ::std::option::Option::Some(input.into());
237        self
238    }
239    /// <p>The description of the secret.</p>
240    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241        self.description = input;
242        self
243    }
244    /// <p>The description of the secret.</p>
245    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
246        &self.description
247    }
248    /// <p>The key ID or alias ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted. Secrets created using the console use an KMS key ID.</p>
249    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
250        self.kms_key_id = ::std::option::Option::Some(input.into());
251        self
252    }
253    /// <p>The key ID or alias ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted. Secrets created using the console use an KMS key ID.</p>
254    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255        self.kms_key_id = input;
256        self
257    }
258    /// <p>The key ID or alias ARN of the KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the Amazon Web Services managed key <code>aws/secretsmanager</code>, this field is omitted. Secrets created using the console use an KMS key ID.</p>
259    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
260        &self.kms_key_id
261    }
262    /// <p>Specifies whether automatic rotation is turned on for this secret. If the secret has never been configured for rotation, Secrets Manager returns null.</p>
263    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
264    pub fn rotation_enabled(mut self, input: bool) -> Self {
265        self.rotation_enabled = ::std::option::Option::Some(input);
266        self
267    }
268    /// <p>Specifies whether automatic rotation is turned on for this secret. If the secret has never been configured for rotation, Secrets Manager returns null.</p>
269    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
270    pub fn set_rotation_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
271        self.rotation_enabled = input;
272        self
273    }
274    /// <p>Specifies whether automatic rotation is turned on for this secret. If the secret has never been configured for rotation, Secrets Manager returns null.</p>
275    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
276    pub fn get_rotation_enabled(&self) -> &::std::option::Option<bool> {
277        &self.rotation_enabled
278    }
279    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
280    pub fn rotation_lambda_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281        self.rotation_lambda_arn = ::std::option::Option::Some(input.into());
282        self
283    }
284    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
285    pub fn set_rotation_lambda_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
286        self.rotation_lambda_arn = input;
287        self
288    }
289    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
290    pub fn get_rotation_lambda_arn(&self) -> &::std::option::Option<::std::string::String> {
291        &self.rotation_lambda_arn
292    }
293    /// <p>The rotation schedule and Lambda function for this secret. If the secret previously had rotation turned on, but it is now turned off, this field shows the previous rotation schedule and rotation function. If the secret never had rotation turned on, this field is omitted.</p>
294    pub fn rotation_rules(mut self, input: crate::types::RotationRulesType) -> Self {
295        self.rotation_rules = ::std::option::Option::Some(input);
296        self
297    }
298    /// <p>The rotation schedule and Lambda function for this secret. If the secret previously had rotation turned on, but it is now turned off, this field shows the previous rotation schedule and rotation function. If the secret never had rotation turned on, this field is omitted.</p>
299    pub fn set_rotation_rules(mut self, input: ::std::option::Option<crate::types::RotationRulesType>) -> Self {
300        self.rotation_rules = input;
301        self
302    }
303    /// <p>The rotation schedule and Lambda function for this secret. If the secret previously had rotation turned on, but it is now turned off, this field shows the previous rotation schedule and rotation function. If the secret never had rotation turned on, this field is omitted.</p>
304    pub fn get_rotation_rules(&self) -> &::std::option::Option<crate::types::RotationRulesType> {
305        &self.rotation_rules
306    }
307    /// <p>The last date and time that Secrets Manager rotated the secret. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null.</p>
308    pub fn last_rotated_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
309        self.last_rotated_date = ::std::option::Option::Some(input);
310        self
311    }
312    /// <p>The last date and time that Secrets Manager rotated the secret. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null.</p>
313    pub fn set_last_rotated_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
314        self.last_rotated_date = input;
315        self
316    }
317    /// <p>The last date and time that Secrets Manager rotated the secret. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null.</p>
318    pub fn get_last_rotated_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
319        &self.last_rotated_date
320    }
321    /// <p>The last date and time that this secret was modified in any way.</p>
322    pub fn last_changed_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
323        self.last_changed_date = ::std::option::Option::Some(input);
324        self
325    }
326    /// <p>The last date and time that this secret was modified in any way.</p>
327    pub fn set_last_changed_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
328        self.last_changed_date = input;
329        self
330    }
331    /// <p>The last date and time that this secret was modified in any way.</p>
332    pub fn get_last_changed_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
333        &self.last_changed_date
334    }
335    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
336    pub fn last_accessed_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
337        self.last_accessed_date = ::std::option::Option::Some(input);
338        self
339    }
340    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
341    pub fn set_last_accessed_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
342        self.last_accessed_date = input;
343        self
344    }
345    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
346    pub fn get_last_accessed_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
347        &self.last_accessed_date
348    }
349    /// <p>The date the secret is scheduled for deletion. If it is not scheduled for deletion, this field is omitted. When you delete a secret, Secrets Manager requires a recovery window of at least 7 days before deleting the secret. Some time after the deleted date, Secrets Manager deletes the secret, including all of its versions.</p>
350    /// <p>If a secret is scheduled for deletion, then its details, including the encrypted secret value, is not accessible. To cancel a scheduled deletion and restore access to the secret, use <code>RestoreSecret</code>.</p>
351    pub fn deleted_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
352        self.deleted_date = ::std::option::Option::Some(input);
353        self
354    }
355    /// <p>The date the secret is scheduled for deletion. If it is not scheduled for deletion, this field is omitted. When you delete a secret, Secrets Manager requires a recovery window of at least 7 days before deleting the secret. Some time after the deleted date, Secrets Manager deletes the secret, including all of its versions.</p>
356    /// <p>If a secret is scheduled for deletion, then its details, including the encrypted secret value, is not accessible. To cancel a scheduled deletion and restore access to the secret, use <code>RestoreSecret</code>.</p>
357    pub fn set_deleted_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
358        self.deleted_date = input;
359        self
360    }
361    /// <p>The date the secret is scheduled for deletion. If it is not scheduled for deletion, this field is omitted. When you delete a secret, Secrets Manager requires a recovery window of at least 7 days before deleting the secret. Some time after the deleted date, Secrets Manager deletes the secret, including all of its versions.</p>
362    /// <p>If a secret is scheduled for deletion, then its details, including the encrypted secret value, is not accessible. To cancel a scheduled deletion and restore access to the secret, use <code>RestoreSecret</code>.</p>
363    pub fn get_deleted_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
364        &self.deleted_date
365    }
366    /// <p>The next rotation is scheduled to occur on or before this date. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null. If rotation fails, Secrets Manager retries the entire rotation process multiple times. If rotation is unsuccessful, this date may be in the past.</p>
367    /// <p>This date represents the latest date that rotation will occur, but it is not an approximate rotation date. In some cases, for example if you turn off automatic rotation and then turn it back on, the next rotation may occur much sooner than this date.</p>
368    pub fn next_rotation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
369        self.next_rotation_date = ::std::option::Option::Some(input);
370        self
371    }
372    /// <p>The next rotation is scheduled to occur on or before this date. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null. If rotation fails, Secrets Manager retries the entire rotation process multiple times. If rotation is unsuccessful, this date may be in the past.</p>
373    /// <p>This date represents the latest date that rotation will occur, but it is not an approximate rotation date. In some cases, for example if you turn off automatic rotation and then turn it back on, the next rotation may occur much sooner than this date.</p>
374    pub fn set_next_rotation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
375        self.next_rotation_date = input;
376        self
377    }
378    /// <p>The next rotation is scheduled to occur on or before this date. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null. If rotation fails, Secrets Manager retries the entire rotation process multiple times. If rotation is unsuccessful, this date may be in the past.</p>
379    /// <p>This date represents the latest date that rotation will occur, but it is not an approximate rotation date. In some cases, for example if you turn off automatic rotation and then turn it back on, the next rotation may occur much sooner than this date.</p>
380    pub fn get_next_rotation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
381        &self.next_rotation_date
382    }
383    /// Appends an item to `tags`.
384    ///
385    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
386    ///
387    /// <p>The list of tags attached to the secret. To add tags to a secret, use <code>TagResource</code>. To remove tags, use <code>UntagResource</code>.</p>
388    pub fn tags(mut self, input: crate::types::Tag) -> Self {
389        let mut v = self.tags.unwrap_or_default();
390        v.push(input);
391        self.tags = ::std::option::Option::Some(v);
392        self
393    }
394    /// <p>The list of tags attached to the secret. To add tags to a secret, use <code>TagResource</code>. To remove tags, use <code>UntagResource</code>.</p>
395    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
396        self.tags = input;
397        self
398    }
399    /// <p>The list of tags attached to the secret. To add tags to a secret, use <code>TagResource</code>. To remove tags, use <code>UntagResource</code>.</p>
400    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
401        &self.tags
402    }
403    /// Adds a key-value pair to `version_ids_to_stages`.
404    ///
405    /// To override the contents of this collection use [`set_version_ids_to_stages`](Self::set_version_ids_to_stages).
406    ///
407    /// <p>A list of the versions of the secret that have staging labels attached. Versions that don't have staging labels are considered deprecated and Secrets Manager can delete them.</p>
408    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
409    /// <ul>
410    /// <li>
411    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
412    /// <li>
413    /// <p><code>AWSPENDING</code>, which indicates the version of the secret that contains new secret information that will become the next current version when rotation finishes.</p>
414    /// <p>During rotation, Secrets Manager creates an <code>AWSPENDING</code> version ID before creating the new secret version. To check if a secret version exists, call <code>GetSecretValue</code>.</p></li>
415    /// <li>
416    /// <p><code>AWSPREVIOUS</code>, which indicates the previous current version of the secret. You can use this as the <i>last known good</i> version.</p></li>
417    /// </ul>
418    /// <p>For more information about rotation and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
419    pub fn version_ids_to_stages(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
420        let mut hash_map = self.version_ids_to_stages.unwrap_or_default();
421        hash_map.insert(k.into(), v);
422        self.version_ids_to_stages = ::std::option::Option::Some(hash_map);
423        self
424    }
425    /// <p>A list of the versions of the secret that have staging labels attached. Versions that don't have staging labels are considered deprecated and Secrets Manager can delete them.</p>
426    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
427    /// <ul>
428    /// <li>
429    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
430    /// <li>
431    /// <p><code>AWSPENDING</code>, which indicates the version of the secret that contains new secret information that will become the next current version when rotation finishes.</p>
432    /// <p>During rotation, Secrets Manager creates an <code>AWSPENDING</code> version ID before creating the new secret version. To check if a secret version exists, call <code>GetSecretValue</code>.</p></li>
433    /// <li>
434    /// <p><code>AWSPREVIOUS</code>, which indicates the previous current version of the secret. You can use this as the <i>last known good</i> version.</p></li>
435    /// </ul>
436    /// <p>For more information about rotation and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
437    pub fn set_version_ids_to_stages(
438        mut self,
439        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
440    ) -> Self {
441        self.version_ids_to_stages = input;
442        self
443    }
444    /// <p>A list of the versions of the secret that have staging labels attached. Versions that don't have staging labels are considered deprecated and Secrets Manager can delete them.</p>
445    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
446    /// <ul>
447    /// <li>
448    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
449    /// <li>
450    /// <p><code>AWSPENDING</code>, which indicates the version of the secret that contains new secret information that will become the next current version when rotation finishes.</p>
451    /// <p>During rotation, Secrets Manager creates an <code>AWSPENDING</code> version ID before creating the new secret version. To check if a secret version exists, call <code>GetSecretValue</code>.</p></li>
452    /// <li>
453    /// <p><code>AWSPREVIOUS</code>, which indicates the previous current version of the secret. You can use this as the <i>last known good</i> version.</p></li>
454    /// </ul>
455    /// <p>For more information about rotation and staging labels, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html">How rotation works</a>.</p>
456    pub fn get_version_ids_to_stages(
457        &self,
458    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
459        &self.version_ids_to_stages
460    }
461    /// <p>The ID of the service that created this secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html">Secrets managed by other Amazon Web Services services</a>.</p>
462    pub fn owning_service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
463        self.owning_service = ::std::option::Option::Some(input.into());
464        self
465    }
466    /// <p>The ID of the service that created this secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html">Secrets managed by other Amazon Web Services services</a>.</p>
467    pub fn set_owning_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
468        self.owning_service = input;
469        self
470    }
471    /// <p>The ID of the service that created this secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html">Secrets managed by other Amazon Web Services services</a>.</p>
472    pub fn get_owning_service(&self) -> &::std::option::Option<::std::string::String> {
473        &self.owning_service
474    }
475    /// <p>The date the secret was created.</p>
476    pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
477        self.created_date = ::std::option::Option::Some(input);
478        self
479    }
480    /// <p>The date the secret was created.</p>
481    pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
482        self.created_date = input;
483        self
484    }
485    /// <p>The date the secret was created.</p>
486    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
487        &self.created_date
488    }
489    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
490    pub fn primary_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
491        self.primary_region = ::std::option::Option::Some(input.into());
492        self
493    }
494    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
495    pub fn set_primary_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
496        self.primary_region = input;
497        self
498    }
499    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
500    pub fn get_primary_region(&self) -> &::std::option::Option<::std::string::String> {
501        &self.primary_region
502    }
503    /// Appends an item to `replication_status`.
504    ///
505    /// To override the contents of this collection use [`set_replication_status`](Self::set_replication_status).
506    ///
507    /// <p>A list of the replicas of this secret and their status:</p>
508    /// <ul>
509    /// <li>
510    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
511    /// <li>
512    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
513    /// <li>
514    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
515    /// </ul>
516    pub fn replication_status(mut self, input: crate::types::ReplicationStatusType) -> Self {
517        let mut v = self.replication_status.unwrap_or_default();
518        v.push(input);
519        self.replication_status = ::std::option::Option::Some(v);
520        self
521    }
522    /// <p>A list of the replicas of this secret and their status:</p>
523    /// <ul>
524    /// <li>
525    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
526    /// <li>
527    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
528    /// <li>
529    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
530    /// </ul>
531    pub fn set_replication_status(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>) -> Self {
532        self.replication_status = input;
533        self
534    }
535    /// <p>A list of the replicas of this secret and their status:</p>
536    /// <ul>
537    /// <li>
538    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
539    /// <li>
540    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
541    /// <li>
542    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
543    /// </ul>
544    pub fn get_replication_status(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>> {
545        &self.replication_status
546    }
547    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
548        self._request_id = Some(request_id.into());
549        self
550    }
551
552    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
553        self._request_id = request_id;
554        self
555    }
556    /// Consumes the builder and constructs a [`DescribeSecretOutput`](crate::operation::describe_secret::DescribeSecretOutput).
557    pub fn build(self) -> crate::operation::describe_secret::DescribeSecretOutput {
558        crate::operation::describe_secret::DescribeSecretOutput {
559            arn: self.arn,
560            name: self.name,
561            description: self.description,
562            kms_key_id: self.kms_key_id,
563            rotation_enabled: self.rotation_enabled,
564            rotation_lambda_arn: self.rotation_lambda_arn,
565            rotation_rules: self.rotation_rules,
566            last_rotated_date: self.last_rotated_date,
567            last_changed_date: self.last_changed_date,
568            last_accessed_date: self.last_accessed_date,
569            deleted_date: self.deleted_date,
570            next_rotation_date: self.next_rotation_date,
571            tags: self.tags,
572            version_ids_to_stages: self.version_ids_to_stages,
573            owning_service: self.owning_service,
574            created_date: self.created_date,
575            primary_region: self.primary_region,
576            replication_status: self.replication_status,
577            _request_id: self._request_id,
578        }
579    }
580}