aws_sdk_qldb/operation/update_ledger/
_update_ledger_input.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 UpdateLedgerInput {
6    /// <p>The name of the ledger.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
9    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
10    pub deletion_protection: ::std::option::Option<bool>,
11    /// <p>The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html">Encryption at rest</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
12    /// <p>Use one of the following options to specify this parameter:</p>
13    /// <ul>
14    /// <li>
15    /// <p><code>AWS_OWNED_KMS_KEY</code>: Use an KMS key that is owned and managed by Amazon Web Services on your behalf.</p></li>
16    /// <li>
17    /// <p><b>Undefined</b>: Make no changes to the KMS key of the ledger.</p></li>
18    /// <li>
19    /// <p><b>A valid symmetric customer managed KMS key</b>: Use the specified symmetric encryption KMS key in your account that you create, own, and manage.</p>
20    /// <p>Amazon QLDB does not support asymmetric keys. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p></li>
21    /// </ul>
22    /// <p>To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
23    /// <p>For example:</p>
24    /// <ul>
25    /// <li>
26    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
27    /// <li>
28    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
29    /// <li>
30    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
31    /// <li>
32    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
33    /// </ul>
34    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
35    pub kms_key: ::std::option::Option<::std::string::String>,
36}
37impl UpdateLedgerInput {
38    /// <p>The name of the ledger.</p>
39    pub fn name(&self) -> ::std::option::Option<&str> {
40        self.name.as_deref()
41    }
42    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
43    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
44    pub fn deletion_protection(&self) -> ::std::option::Option<bool> {
45        self.deletion_protection
46    }
47    /// <p>The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html">Encryption at rest</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
48    /// <p>Use one of the following options to specify this parameter:</p>
49    /// <ul>
50    /// <li>
51    /// <p><code>AWS_OWNED_KMS_KEY</code>: Use an KMS key that is owned and managed by Amazon Web Services on your behalf.</p></li>
52    /// <li>
53    /// <p><b>Undefined</b>: Make no changes to the KMS key of the ledger.</p></li>
54    /// <li>
55    /// <p><b>A valid symmetric customer managed KMS key</b>: Use the specified symmetric encryption KMS key in your account that you create, own, and manage.</p>
56    /// <p>Amazon QLDB does not support asymmetric keys. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p></li>
57    /// </ul>
58    /// <p>To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
59    /// <p>For example:</p>
60    /// <ul>
61    /// <li>
62    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
63    /// <li>
64    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
65    /// <li>
66    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
67    /// <li>
68    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
69    /// </ul>
70    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
71    pub fn kms_key(&self) -> ::std::option::Option<&str> {
72        self.kms_key.as_deref()
73    }
74}
75impl UpdateLedgerInput {
76    /// Creates a new builder-style object to manufacture [`UpdateLedgerInput`](crate::operation::update_ledger::UpdateLedgerInput).
77    pub fn builder() -> crate::operation::update_ledger::builders::UpdateLedgerInputBuilder {
78        crate::operation::update_ledger::builders::UpdateLedgerInputBuilder::default()
79    }
80}
81
82/// A builder for [`UpdateLedgerInput`](crate::operation::update_ledger::UpdateLedgerInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct UpdateLedgerInputBuilder {
86    pub(crate) name: ::std::option::Option<::std::string::String>,
87    pub(crate) deletion_protection: ::std::option::Option<bool>,
88    pub(crate) kms_key: ::std::option::Option<::std::string::String>,
89}
90impl UpdateLedgerInputBuilder {
91    /// <p>The name of the ledger.</p>
92    /// This field is required.
93    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.name = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The name of the ledger.</p>
98    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.name = input;
100        self
101    }
102    /// <p>The name of the ledger.</p>
103    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
104        &self.name
105    }
106    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
107    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
108    pub fn deletion_protection(mut self, input: bool) -> Self {
109        self.deletion_protection = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
113    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
114    pub fn set_deletion_protection(mut self, input: ::std::option::Option<bool>) -> Self {
115        self.deletion_protection = input;
116        self
117    }
118    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
119    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
120    pub fn get_deletion_protection(&self) -> &::std::option::Option<bool> {
121        &self.deletion_protection
122    }
123    /// <p>The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html">Encryption at rest</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
124    /// <p>Use one of the following options to specify this parameter:</p>
125    /// <ul>
126    /// <li>
127    /// <p><code>AWS_OWNED_KMS_KEY</code>: Use an KMS key that is owned and managed by Amazon Web Services on your behalf.</p></li>
128    /// <li>
129    /// <p><b>Undefined</b>: Make no changes to the KMS key of the ledger.</p></li>
130    /// <li>
131    /// <p><b>A valid symmetric customer managed KMS key</b>: Use the specified symmetric encryption KMS key in your account that you create, own, and manage.</p>
132    /// <p>Amazon QLDB does not support asymmetric keys. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p></li>
133    /// </ul>
134    /// <p>To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
135    /// <p>For example:</p>
136    /// <ul>
137    /// <li>
138    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
139    /// <li>
140    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
141    /// <li>
142    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
143    /// <li>
144    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
145    /// </ul>
146    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
147    pub fn kms_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.kms_key = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html">Encryption at rest</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
152    /// <p>Use one of the following options to specify this parameter:</p>
153    /// <ul>
154    /// <li>
155    /// <p><code>AWS_OWNED_KMS_KEY</code>: Use an KMS key that is owned and managed by Amazon Web Services on your behalf.</p></li>
156    /// <li>
157    /// <p><b>Undefined</b>: Make no changes to the KMS key of the ledger.</p></li>
158    /// <li>
159    /// <p><b>A valid symmetric customer managed KMS key</b>: Use the specified symmetric encryption KMS key in your account that you create, own, and manage.</p>
160    /// <p>Amazon QLDB does not support asymmetric keys. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p></li>
161    /// </ul>
162    /// <p>To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
163    /// <p>For example:</p>
164    /// <ul>
165    /// <li>
166    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
167    /// <li>
168    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
169    /// <li>
170    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
171    /// <li>
172    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
173    /// </ul>
174    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
175    pub fn set_kms_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.kms_key = input;
177        self
178    }
179    /// <p>The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html">Encryption at rest</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
180    /// <p>Use one of the following options to specify this parameter:</p>
181    /// <ul>
182    /// <li>
183    /// <p><code>AWS_OWNED_KMS_KEY</code>: Use an KMS key that is owned and managed by Amazon Web Services on your behalf.</p></li>
184    /// <li>
185    /// <p><b>Undefined</b>: Make no changes to the KMS key of the ledger.</p></li>
186    /// <li>
187    /// <p><b>A valid symmetric customer managed KMS key</b>: Use the specified symmetric encryption KMS key in your account that you create, own, and manage.</p>
188    /// <p>Amazon QLDB does not support asymmetric keys. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p></li>
189    /// </ul>
190    /// <p>To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
191    /// <p>For example:</p>
192    /// <ul>
193    /// <li>
194    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
195    /// <li>
196    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
197    /// <li>
198    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
199    /// <li>
200    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
201    /// </ul>
202    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
203    pub fn get_kms_key(&self) -> &::std::option::Option<::std::string::String> {
204        &self.kms_key
205    }
206    /// Consumes the builder and constructs a [`UpdateLedgerInput`](crate::operation::update_ledger::UpdateLedgerInput).
207    pub fn build(
208        self,
209    ) -> ::std::result::Result<crate::operation::update_ledger::UpdateLedgerInput, ::aws_smithy_types::error::operation::BuildError> {
210        ::std::result::Result::Ok(crate::operation::update_ledger::UpdateLedgerInput {
211            name: self.name,
212            deletion_protection: self.deletion_protection,
213            kms_key: self.kms_key,
214        })
215    }
216}