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 exact string that identifies the partner that holds the external secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a>.</p>
11    pub r#type: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the secret.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <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>
15    pub kms_key_id: ::std::option::Option<::std::string::String>,
16    /// <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>
17    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
18    pub rotation_enabled: ::std::option::Option<bool>,
19    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
20    pub rotation_lambda_arn: ::std::option::Option<::std::string::String>,
21    /// <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>
22    pub rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
23    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html">Managed external secrets partners</a>.</p>
24    pub external_secret_rotation_metadata: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
25    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
26    pub external_secret_rotation_role_arn: ::std::option::Option<::std::string::String>,
27    /// <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>
28    pub last_rotated_date: ::std::option::Option<::aws_smithy_types::DateTime>,
29    /// <p>The last date and time that this secret was modified in any way.</p>
30    pub last_changed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
31    /// <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>
32    pub last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
33    /// <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>
34    /// <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>
35    pub deleted_date: ::std::option::Option<::aws_smithy_types::DateTime>,
36    /// <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>
37    /// <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>
38    pub next_rotation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
39    /// <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>
40    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
41    /// <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>
42    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
43    /// <ul>
44    /// <li>
45    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
46    /// <li>
47    /// <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>
48    /// <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>
49    /// <li>
50    /// <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>
51    /// </ul>
52    /// <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>
53    pub version_ids_to_stages: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
54    /// <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>
55    pub owning_service: ::std::option::Option<::std::string::String>,
56    /// <p>The date the secret was created.</p>
57    pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
58    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
59    pub primary_region: ::std::option::Option<::std::string::String>,
60    /// <p>A list of the replicas of this secret and their status:</p>
61    /// <ul>
62    /// <li>
63    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
64    /// <li>
65    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
66    /// <li>
67    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
68    /// </ul>
69    pub replication_status: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>,
70    _request_id: Option<String>,
71}
72impl DescribeSecretOutput {
73    /// <p>The ARN of the secret.</p>
74    pub fn arn(&self) -> ::std::option::Option<&str> {
75        self.arn.as_deref()
76    }
77    /// <p>The name of the secret.</p>
78    pub fn name(&self) -> ::std::option::Option<&str> {
79        self.name.as_deref()
80    }
81    /// <p>The exact string that identifies the partner that holds the external secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a>.</p>
82    pub fn r#type(&self) -> ::std::option::Option<&str> {
83        self.r#type.as_deref()
84    }
85    /// <p>The description of the secret.</p>
86    pub fn description(&self) -> ::std::option::Option<&str> {
87        self.description.as_deref()
88    }
89    /// <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>
90    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
91        self.kms_key_id.as_deref()
92    }
93    /// <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>
94    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
95    pub fn rotation_enabled(&self) -> ::std::option::Option<bool> {
96        self.rotation_enabled
97    }
98    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
99    pub fn rotation_lambda_arn(&self) -> ::std::option::Option<&str> {
100        self.rotation_lambda_arn.as_deref()
101    }
102    /// <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>
103    pub fn rotation_rules(&self) -> ::std::option::Option<&crate::types::RotationRulesType> {
104        self.rotation_rules.as_ref()
105    }
106    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html">Managed external secrets partners</a>.</p>
107    ///
108    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.external_secret_rotation_metadata.is_none()`.
109    pub fn external_secret_rotation_metadata(&self) -> &[crate::types::ExternalSecretRotationMetadataItem] {
110        self.external_secret_rotation_metadata.as_deref().unwrap_or_default()
111    }
112    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
113    pub fn external_secret_rotation_role_arn(&self) -> ::std::option::Option<&str> {
114        self.external_secret_rotation_role_arn.as_deref()
115    }
116    /// <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>
117    pub fn last_rotated_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
118        self.last_rotated_date.as_ref()
119    }
120    /// <p>The last date and time that this secret was modified in any way.</p>
121    pub fn last_changed_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
122        self.last_changed_date.as_ref()
123    }
124    /// <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>
125    pub fn last_accessed_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
126        self.last_accessed_date.as_ref()
127    }
128    /// <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>
129    /// <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>
130    pub fn deleted_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
131        self.deleted_date.as_ref()
132    }
133    /// <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>
134    /// <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>
135    pub fn next_rotation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
136        self.next_rotation_date.as_ref()
137    }
138    /// <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>
139    ///
140    /// 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()`.
141    pub fn tags(&self) -> &[crate::types::Tag] {
142        self.tags.as_deref().unwrap_or_default()
143    }
144    /// <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>
145    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
146    /// <ul>
147    /// <li>
148    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
149    /// <li>
150    /// <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>
151    /// <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>
152    /// <li>
153    /// <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>
154    /// </ul>
155    /// <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>
156    pub fn version_ids_to_stages(
157        &self,
158    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
159        self.version_ids_to_stages.as_ref()
160    }
161    /// <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>
162    pub fn owning_service(&self) -> ::std::option::Option<&str> {
163        self.owning_service.as_deref()
164    }
165    /// <p>The date the secret was created.</p>
166    pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
167        self.created_date.as_ref()
168    }
169    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
170    pub fn primary_region(&self) -> ::std::option::Option<&str> {
171        self.primary_region.as_deref()
172    }
173    /// <p>A list of the replicas of this secret and their status:</p>
174    /// <ul>
175    /// <li>
176    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
177    /// <li>
178    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
179    /// <li>
180    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
181    /// </ul>
182    ///
183    /// 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()`.
184    pub fn replication_status(&self) -> &[crate::types::ReplicationStatusType] {
185        self.replication_status.as_deref().unwrap_or_default()
186    }
187}
188impl ::aws_types::request_id::RequestId for DescribeSecretOutput {
189    fn request_id(&self) -> Option<&str> {
190        self._request_id.as_deref()
191    }
192}
193impl DescribeSecretOutput {
194    /// Creates a new builder-style object to manufacture [`DescribeSecretOutput`](crate::operation::describe_secret::DescribeSecretOutput).
195    pub fn builder() -> crate::operation::describe_secret::builders::DescribeSecretOutputBuilder {
196        crate::operation::describe_secret::builders::DescribeSecretOutputBuilder::default()
197    }
198}
199
200/// A builder for [`DescribeSecretOutput`](crate::operation::describe_secret::DescribeSecretOutput).
201#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
202#[non_exhaustive]
203pub struct DescribeSecretOutputBuilder {
204    pub(crate) arn: ::std::option::Option<::std::string::String>,
205    pub(crate) name: ::std::option::Option<::std::string::String>,
206    pub(crate) r#type: ::std::option::Option<::std::string::String>,
207    pub(crate) description: ::std::option::Option<::std::string::String>,
208    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
209    pub(crate) rotation_enabled: ::std::option::Option<bool>,
210    pub(crate) rotation_lambda_arn: ::std::option::Option<::std::string::String>,
211    pub(crate) rotation_rules: ::std::option::Option<crate::types::RotationRulesType>,
212    pub(crate) external_secret_rotation_metadata: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
213    pub(crate) external_secret_rotation_role_arn: ::std::option::Option<::std::string::String>,
214    pub(crate) last_rotated_date: ::std::option::Option<::aws_smithy_types::DateTime>,
215    pub(crate) last_changed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
216    pub(crate) last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
217    pub(crate) deleted_date: ::std::option::Option<::aws_smithy_types::DateTime>,
218    pub(crate) next_rotation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
219    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
220    pub(crate) version_ids_to_stages:
221        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
222    pub(crate) owning_service: ::std::option::Option<::std::string::String>,
223    pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
224    pub(crate) primary_region: ::std::option::Option<::std::string::String>,
225    pub(crate) replication_status: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>,
226    _request_id: Option<String>,
227}
228impl DescribeSecretOutputBuilder {
229    /// <p>The ARN of the secret.</p>
230    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.arn = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>The ARN of the secret.</p>
235    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.arn = input;
237        self
238    }
239    /// <p>The ARN of the secret.</p>
240    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
241        &self.arn
242    }
243    /// <p>The name of the secret.</p>
244    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.name = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>The name of the secret.</p>
249    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.name = input;
251        self
252    }
253    /// <p>The name of the secret.</p>
254    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
255        &self.name
256    }
257    /// <p>The exact string that identifies the partner that holds the external secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a>.</p>
258    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259        self.r#type = ::std::option::Option::Some(input.into());
260        self
261    }
262    /// <p>The exact string that identifies the partner that holds the external secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a>.</p>
263    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264        self.r#type = input;
265        self
266    }
267    /// <p>The exact string that identifies the partner that holds the external secret. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html">Using Secrets Manager managed external secrets</a>.</p>
268    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
269        &self.r#type
270    }
271    /// <p>The description of the secret.</p>
272    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.description = ::std::option::Option::Some(input.into());
274        self
275    }
276    /// <p>The description of the secret.</p>
277    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.description = input;
279        self
280    }
281    /// <p>The description of the secret.</p>
282    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
283        &self.description
284    }
285    /// <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>
286    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
287        self.kms_key_id = ::std::option::Option::Some(input.into());
288        self
289    }
290    /// <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>
291    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
292        self.kms_key_id = input;
293        self
294    }
295    /// <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>
296    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
297        &self.kms_key_id
298    }
299    /// <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>
300    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
301    pub fn rotation_enabled(mut self, input: bool) -> Self {
302        self.rotation_enabled = ::std::option::Option::Some(input);
303        self
304    }
305    /// <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>
306    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
307    pub fn set_rotation_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
308        self.rotation_enabled = input;
309        self
310    }
311    /// <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>
312    /// <p>To turn on rotation, use <code>RotateSecret</code>. To turn off rotation, use <code>CancelRotateSecret</code>.</p>
313    pub fn get_rotation_enabled(&self) -> &::std::option::Option<bool> {
314        &self.rotation_enabled
315    }
316    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
317    pub fn rotation_lambda_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
318        self.rotation_lambda_arn = ::std::option::Option::Some(input.into());
319        self
320    }
321    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
322    pub fn set_rotation_lambda_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
323        self.rotation_lambda_arn = input;
324        self
325    }
326    /// <p>The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.</p>
327    pub fn get_rotation_lambda_arn(&self) -> &::std::option::Option<::std::string::String> {
328        &self.rotation_lambda_arn
329    }
330    /// <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>
331    pub fn rotation_rules(mut self, input: crate::types::RotationRulesType) -> Self {
332        self.rotation_rules = ::std::option::Option::Some(input);
333        self
334    }
335    /// <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>
336    pub fn set_rotation_rules(mut self, input: ::std::option::Option<crate::types::RotationRulesType>) -> Self {
337        self.rotation_rules = input;
338        self
339    }
340    /// <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>
341    pub fn get_rotation_rules(&self) -> &::std::option::Option<crate::types::RotationRulesType> {
342        &self.rotation_rules
343    }
344    /// Appends an item to `external_secret_rotation_metadata`.
345    ///
346    /// To override the contents of this collection use [`set_external_secret_rotation_metadata`](Self::set_external_secret_rotation_metadata).
347    ///
348    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html">Managed external secrets partners</a>.</p>
349    pub fn external_secret_rotation_metadata(mut self, input: crate::types::ExternalSecretRotationMetadataItem) -> Self {
350        let mut v = self.external_secret_rotation_metadata.unwrap_or_default();
351        v.push(input);
352        self.external_secret_rotation_metadata = ::std::option::Option::Some(v);
353        self
354    }
355    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html">Managed external secrets partners</a>.</p>
356    pub fn set_external_secret_rotation_metadata(
357        mut self,
358        input: ::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>>,
359    ) -> Self {
360        self.external_secret_rotation_metadata = input;
361        self
362    }
363    /// <p>The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html">Managed external secrets partners</a>.</p>
364    pub fn get_external_secret_rotation_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExternalSecretRotationMetadataItem>> {
365        &self.external_secret_rotation_metadata
366    }
367    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
368    pub fn external_secret_rotation_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
369        self.external_secret_rotation_role_arn = ::std::option::Option::Some(input.into());
370        self
371    }
372    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
373    pub fn set_external_secret_rotation_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
374        self.external_secret_rotation_role_arn = input;
375        self
376    }
377    /// <p>The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html">Security and permissions</a>.</p>
378    pub fn get_external_secret_rotation_role_arn(&self) -> &::std::option::Option<::std::string::String> {
379        &self.external_secret_rotation_role_arn
380    }
381    /// <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>
382    pub fn last_rotated_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
383        self.last_rotated_date = ::std::option::Option::Some(input);
384        self
385    }
386    /// <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>
387    pub fn set_last_rotated_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
388        self.last_rotated_date = input;
389        self
390    }
391    /// <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>
392    pub fn get_last_rotated_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
393        &self.last_rotated_date
394    }
395    /// <p>The last date and time that this secret was modified in any way.</p>
396    pub fn last_changed_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
397        self.last_changed_date = ::std::option::Option::Some(input);
398        self
399    }
400    /// <p>The last date and time that this secret was modified in any way.</p>
401    pub fn set_last_changed_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
402        self.last_changed_date = input;
403        self
404    }
405    /// <p>The last date and time that this secret was modified in any way.</p>
406    pub fn get_last_changed_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
407        &self.last_changed_date
408    }
409    /// <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>
410    pub fn last_accessed_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
411        self.last_accessed_date = ::std::option::Option::Some(input);
412        self
413    }
414    /// <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>
415    pub fn set_last_accessed_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
416        self.last_accessed_date = input;
417        self
418    }
419    /// <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>
420    pub fn get_last_accessed_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
421        &self.last_accessed_date
422    }
423    /// <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>
424    /// <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>
425    pub fn deleted_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
426        self.deleted_date = ::std::option::Option::Some(input);
427        self
428    }
429    /// <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>
430    /// <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>
431    pub fn set_deleted_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
432        self.deleted_date = input;
433        self
434    }
435    /// <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>
436    /// <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>
437    pub fn get_deleted_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
438        &self.deleted_date
439    }
440    /// <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>
441    /// <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>
442    pub fn next_rotation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
443        self.next_rotation_date = ::std::option::Option::Some(input);
444        self
445    }
446    /// <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>
447    /// <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>
448    pub fn set_next_rotation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
449        self.next_rotation_date = input;
450        self
451    }
452    /// <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>
453    /// <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>
454    pub fn get_next_rotation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
455        &self.next_rotation_date
456    }
457    /// Appends an item to `tags`.
458    ///
459    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
460    ///
461    /// <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>
462    pub fn tags(mut self, input: crate::types::Tag) -> Self {
463        let mut v = self.tags.unwrap_or_default();
464        v.push(input);
465        self.tags = ::std::option::Option::Some(v);
466        self
467    }
468    /// <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>
469    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
470        self.tags = input;
471        self
472    }
473    /// <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>
474    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
475        &self.tags
476    }
477    /// Adds a key-value pair to `version_ids_to_stages`.
478    ///
479    /// To override the contents of this collection use [`set_version_ids_to_stages`](Self::set_version_ids_to_stages).
480    ///
481    /// <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>
482    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
483    /// <ul>
484    /// <li>
485    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
486    /// <li>
487    /// <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>
488    /// <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>
489    /// <li>
490    /// <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>
491    /// </ul>
492    /// <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>
493    pub fn version_ids_to_stages(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
494        let mut hash_map = self.version_ids_to_stages.unwrap_or_default();
495        hash_map.insert(k.into(), v);
496        self.version_ids_to_stages = ::std::option::Option::Some(hash_map);
497        self
498    }
499    /// <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>
500    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
501    /// <ul>
502    /// <li>
503    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
504    /// <li>
505    /// <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>
506    /// <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>
507    /// <li>
508    /// <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>
509    /// </ul>
510    /// <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>
511    pub fn set_version_ids_to_stages(
512        mut self,
513        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
514    ) -> Self {
515        self.version_ids_to_stages = input;
516        self
517    }
518    /// <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>
519    /// <p>Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:</p>
520    /// <ul>
521    /// <li>
522    /// <p><code>AWSCURRENT</code>, which indicates the current version of the secret.</p></li>
523    /// <li>
524    /// <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>
525    /// <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>
526    /// <li>
527    /// <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>
528    /// </ul>
529    /// <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>
530    pub fn get_version_ids_to_stages(
531        &self,
532    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
533        &self.version_ids_to_stages
534    }
535    /// <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>
536    pub fn owning_service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
537        self.owning_service = ::std::option::Option::Some(input.into());
538        self
539    }
540    /// <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>
541    pub fn set_owning_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
542        self.owning_service = input;
543        self
544    }
545    /// <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>
546    pub fn get_owning_service(&self) -> &::std::option::Option<::std::string::String> {
547        &self.owning_service
548    }
549    /// <p>The date the secret was created.</p>
550    pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
551        self.created_date = ::std::option::Option::Some(input);
552        self
553    }
554    /// <p>The date the secret was created.</p>
555    pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
556        self.created_date = input;
557        self
558    }
559    /// <p>The date the secret was created.</p>
560    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
561        &self.created_date
562    }
563    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
564    pub fn primary_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
565        self.primary_region = ::std::option::Option::Some(input.into());
566        self
567    }
568    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
569    pub fn set_primary_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
570        self.primary_region = input;
571        self
572    }
573    /// <p>The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in <code>ReplicationStatus</code>.</p>
574    pub fn get_primary_region(&self) -> &::std::option::Option<::std::string::String> {
575        &self.primary_region
576    }
577    /// Appends an item to `replication_status`.
578    ///
579    /// To override the contents of this collection use [`set_replication_status`](Self::set_replication_status).
580    ///
581    /// <p>A list of the replicas of this secret and their status:</p>
582    /// <ul>
583    /// <li>
584    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
585    /// <li>
586    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
587    /// <li>
588    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
589    /// </ul>
590    pub fn replication_status(mut self, input: crate::types::ReplicationStatusType) -> Self {
591        let mut v = self.replication_status.unwrap_or_default();
592        v.push(input);
593        self.replication_status = ::std::option::Option::Some(v);
594        self
595    }
596    /// <p>A list of the replicas of this secret and their status:</p>
597    /// <ul>
598    /// <li>
599    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
600    /// <li>
601    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
602    /// <li>
603    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
604    /// </ul>
605    pub fn set_replication_status(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>) -> Self {
606        self.replication_status = input;
607        self
608    }
609    /// <p>A list of the replicas of this secret and their status:</p>
610    /// <ul>
611    /// <li>
612    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
613    /// <li>
614    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
615    /// <li>
616    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
617    /// </ul>
618    pub fn get_replication_status(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>> {
619        &self.replication_status
620    }
621    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
622        self._request_id = Some(request_id.into());
623        self
624    }
625
626    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
627        self._request_id = request_id;
628        self
629    }
630    /// Consumes the builder and constructs a [`DescribeSecretOutput`](crate::operation::describe_secret::DescribeSecretOutput).
631    pub fn build(self) -> crate::operation::describe_secret::DescribeSecretOutput {
632        crate::operation::describe_secret::DescribeSecretOutput {
633            arn: self.arn,
634            name: self.name,
635            r#type: self.r#type,
636            description: self.description,
637            kms_key_id: self.kms_key_id,
638            rotation_enabled: self.rotation_enabled,
639            rotation_lambda_arn: self.rotation_lambda_arn,
640            rotation_rules: self.rotation_rules,
641            external_secret_rotation_metadata: self.external_secret_rotation_metadata,
642            external_secret_rotation_role_arn: self.external_secret_rotation_role_arn,
643            last_rotated_date: self.last_rotated_date,
644            last_changed_date: self.last_changed_date,
645            last_accessed_date: self.last_accessed_date,
646            deleted_date: self.deleted_date,
647            next_rotation_date: self.next_rotation_date,
648            tags: self.tags,
649            version_ids_to_stages: self.version_ids_to_stages,
650            owning_service: self.owning_service,
651            created_date: self.created_date,
652            primary_region: self.primary_region,
653            replication_status: self.replication_status,
654            _request_id: self._request_id,
655        }
656    }
657}