aws_sdk_secretsmanager/operation/create_secret/
_create_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 CreateSecretOutput {
6    /// <p>The ARN of the new secret. The ARN includes the name of the secret followed by six random characters. This ensures that if you create a new secret with the same name as a deleted secret, then users with access to the old secret don't get access to the new secret because the ARNs are different.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the new secret.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The unique identifier associated with the version of the new secret.</p>
11    pub version_id: ::std::option::Option<::std::string::String>,
12    /// <p>A list of the replicas of this secret and their status:</p>
13    /// <ul>
14    /// <li>
15    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
16    /// <li>
17    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
18    /// <li>
19    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
20    /// </ul>
21    pub replication_status: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>,
22    _request_id: Option<String>,
23}
24impl CreateSecretOutput {
25    /// <p>The ARN of the new secret. The ARN includes the name of the secret followed by six random characters. This ensures that if you create a new secret with the same name as a deleted secret, then users with access to the old secret don't get access to the new secret because the ARNs are different.</p>
26    pub fn arn(&self) -> ::std::option::Option<&str> {
27        self.arn.as_deref()
28    }
29    /// <p>The name of the new secret.</p>
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.as_deref()
32    }
33    /// <p>The unique identifier associated with the version of the new secret.</p>
34    pub fn version_id(&self) -> ::std::option::Option<&str> {
35        self.version_id.as_deref()
36    }
37    /// <p>A list of the replicas of this secret and their status:</p>
38    /// <ul>
39    /// <li>
40    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
41    /// <li>
42    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
43    /// <li>
44    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
45    /// </ul>
46    ///
47    /// 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()`.
48    pub fn replication_status(&self) -> &[crate::types::ReplicationStatusType] {
49        self.replication_status.as_deref().unwrap_or_default()
50    }
51}
52impl ::aws_types::request_id::RequestId for CreateSecretOutput {
53    fn request_id(&self) -> Option<&str> {
54        self._request_id.as_deref()
55    }
56}
57impl CreateSecretOutput {
58    /// Creates a new builder-style object to manufacture [`CreateSecretOutput`](crate::operation::create_secret::CreateSecretOutput).
59    pub fn builder() -> crate::operation::create_secret::builders::CreateSecretOutputBuilder {
60        crate::operation::create_secret::builders::CreateSecretOutputBuilder::default()
61    }
62}
63
64/// A builder for [`CreateSecretOutput`](crate::operation::create_secret::CreateSecretOutput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CreateSecretOutputBuilder {
68    pub(crate) arn: ::std::option::Option<::std::string::String>,
69    pub(crate) name: ::std::option::Option<::std::string::String>,
70    pub(crate) version_id: ::std::option::Option<::std::string::String>,
71    pub(crate) replication_status: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>,
72    _request_id: Option<String>,
73}
74impl CreateSecretOutputBuilder {
75    /// <p>The ARN of the new secret. The ARN includes the name of the secret followed by six random characters. This ensures that if you create a new secret with the same name as a deleted secret, then users with access to the old secret don't get access to the new secret because the ARNs are different.</p>
76    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.arn = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The ARN of the new secret. The ARN includes the name of the secret followed by six random characters. This ensures that if you create a new secret with the same name as a deleted secret, then users with access to the old secret don't get access to the new secret because the ARNs are different.</p>
81    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.arn = input;
83        self
84    }
85    /// <p>The ARN of the new secret. The ARN includes the name of the secret followed by six random characters. This ensures that if you create a new secret with the same name as a deleted secret, then users with access to the old secret don't get access to the new secret because the ARNs are different.</p>
86    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
87        &self.arn
88    }
89    /// <p>The name of the new secret.</p>
90    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the new secret.</p>
95    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.name = input;
97        self
98    }
99    /// <p>The name of the new secret.</p>
100    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.name
102    }
103    /// <p>The unique identifier associated with the version of the new secret.</p>
104    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.version_id = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The unique identifier associated with the version of the new secret.</p>
109    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.version_id = input;
111        self
112    }
113    /// <p>The unique identifier associated with the version of the new secret.</p>
114    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
115        &self.version_id
116    }
117    /// Appends an item to `replication_status`.
118    ///
119    /// To override the contents of this collection use [`set_replication_status`](Self::set_replication_status).
120    ///
121    /// <p>A list of the replicas of this secret and their status:</p>
122    /// <ul>
123    /// <li>
124    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
125    /// <li>
126    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
127    /// <li>
128    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
129    /// </ul>
130    pub fn replication_status(mut self, input: crate::types::ReplicationStatusType) -> Self {
131        let mut v = self.replication_status.unwrap_or_default();
132        v.push(input);
133        self.replication_status = ::std::option::Option::Some(v);
134        self
135    }
136    /// <p>A list of the replicas of this secret and their status:</p>
137    /// <ul>
138    /// <li>
139    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
140    /// <li>
141    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
142    /// <li>
143    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
144    /// </ul>
145    pub fn set_replication_status(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>>) -> Self {
146        self.replication_status = input;
147        self
148    }
149    /// <p>A list of the replicas of this secret and their status:</p>
150    /// <ul>
151    /// <li>
152    /// <p><code>Failed</code>, which indicates that the replica was not created.</p></li>
153    /// <li>
154    /// <p><code>InProgress</code>, which indicates that Secrets Manager is in the process of creating the replica.</p></li>
155    /// <li>
156    /// <p><code>InSync</code>, which indicates that the replica was created.</p></li>
157    /// </ul>
158    pub fn get_replication_status(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicationStatusType>> {
159        &self.replication_status
160    }
161    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
162        self._request_id = Some(request_id.into());
163        self
164    }
165
166    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
167        self._request_id = request_id;
168        self
169    }
170    /// Consumes the builder and constructs a [`CreateSecretOutput`](crate::operation::create_secret::CreateSecretOutput).
171    pub fn build(self) -> crate::operation::create_secret::CreateSecretOutput {
172        crate::operation::create_secret::CreateSecretOutput {
173            arn: self.arn,
174            name: self.name,
175            version_id: self.version_id,
176            replication_status: self.replication_status,
177            _request_id: self._request_id,
178        }
179    }
180}