aws_sdk_timestreamwrite/operation/update_database/
_update_database_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 UpdateDatabaseInput {
6    /// <p>The name of the database.</p>
7    pub database_name: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the new KMS key (<code>KmsKeyId</code>) to be used to encrypt the data stored in the database. If the <code>KmsKeyId</code> currently registered with the database is the same as the <code>KmsKeyId</code> in the request, there will not be any update.</p>
9    /// <p>You can specify the <code>KmsKeyId</code> using any of the following:</p>
10    /// <ul>
11    /// <li>
12    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
13    /// <li>
14    /// <p>Key ARN: <code>arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
15    /// <li>
16    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
17    /// <li>
18    /// <p>Alias ARN: <code>arn:aws:kms:us-east-1:111122223333:alias/ExampleAlias</code></p></li>
19    /// </ul>
20    pub kms_key_id: ::std::option::Option<::std::string::String>,
21}
22impl UpdateDatabaseInput {
23    /// <p>The name of the database.</p>
24    pub fn database_name(&self) -> ::std::option::Option<&str> {
25        self.database_name.as_deref()
26    }
27    /// <p>The identifier of the new KMS key (<code>KmsKeyId</code>) to be used to encrypt the data stored in the database. If the <code>KmsKeyId</code> currently registered with the database is the same as the <code>KmsKeyId</code> in the request, there will not be any update.</p>
28    /// <p>You can specify the <code>KmsKeyId</code> using any of the following:</p>
29    /// <ul>
30    /// <li>
31    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
32    /// <li>
33    /// <p>Key ARN: <code>arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
34    /// <li>
35    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
36    /// <li>
37    /// <p>Alias ARN: <code>arn:aws:kms:us-east-1:111122223333:alias/ExampleAlias</code></p></li>
38    /// </ul>
39    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
40        self.kms_key_id.as_deref()
41    }
42}
43impl UpdateDatabaseInput {
44    /// Creates a new builder-style object to manufacture [`UpdateDatabaseInput`](crate::operation::update_database::UpdateDatabaseInput).
45    pub fn builder() -> crate::operation::update_database::builders::UpdateDatabaseInputBuilder {
46        crate::operation::update_database::builders::UpdateDatabaseInputBuilder::default()
47    }
48}
49
50/// A builder for [`UpdateDatabaseInput`](crate::operation::update_database::UpdateDatabaseInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct UpdateDatabaseInputBuilder {
54    pub(crate) database_name: ::std::option::Option<::std::string::String>,
55    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
56}
57impl UpdateDatabaseInputBuilder {
58    /// <p>The name of the database.</p>
59    /// This field is required.
60    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.database_name = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The name of the database.</p>
65    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.database_name = input;
67        self
68    }
69    /// <p>The name of the database.</p>
70    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.database_name
72    }
73    /// <p>The identifier of the new KMS key (<code>KmsKeyId</code>) to be used to encrypt the data stored in the database. If the <code>KmsKeyId</code> currently registered with the database is the same as the <code>KmsKeyId</code> in the request, there will not be any update.</p>
74    /// <p>You can specify the <code>KmsKeyId</code> using any of the following:</p>
75    /// <ul>
76    /// <li>
77    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
78    /// <li>
79    /// <p>Key ARN: <code>arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
80    /// <li>
81    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
82    /// <li>
83    /// <p>Alias ARN: <code>arn:aws:kms:us-east-1:111122223333:alias/ExampleAlias</code></p></li>
84    /// </ul>
85    /// This field is required.
86    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.kms_key_id = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The identifier of the new KMS key (<code>KmsKeyId</code>) to be used to encrypt the data stored in the database. If the <code>KmsKeyId</code> currently registered with the database is the same as the <code>KmsKeyId</code> in the request, there will not be any update.</p>
91    /// <p>You can specify the <code>KmsKeyId</code> using any of the following:</p>
92    /// <ul>
93    /// <li>
94    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
95    /// <li>
96    /// <p>Key ARN: <code>arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
97    /// <li>
98    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
99    /// <li>
100    /// <p>Alias ARN: <code>arn:aws:kms:us-east-1:111122223333:alias/ExampleAlias</code></p></li>
101    /// </ul>
102    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.kms_key_id = input;
104        self
105    }
106    /// <p>The identifier of the new KMS key (<code>KmsKeyId</code>) to be used to encrypt the data stored in the database. If the <code>KmsKeyId</code> currently registered with the database is the same as the <code>KmsKeyId</code> in the request, there will not be any update.</p>
107    /// <p>You can specify the <code>KmsKeyId</code> using any of the following:</p>
108    /// <ul>
109    /// <li>
110    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
111    /// <li>
112    /// <p>Key ARN: <code>arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
113    /// <li>
114    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
115    /// <li>
116    /// <p>Alias ARN: <code>arn:aws:kms:us-east-1:111122223333:alias/ExampleAlias</code></p></li>
117    /// </ul>
118    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
119        &self.kms_key_id
120    }
121    /// Consumes the builder and constructs a [`UpdateDatabaseInput`](crate::operation::update_database::UpdateDatabaseInput).
122    pub fn build(
123        self,
124    ) -> ::std::result::Result<crate::operation::update_database::UpdateDatabaseInput, ::aws_smithy_types::error::operation::BuildError> {
125        ::std::result::Result::Ok(crate::operation::update_database::UpdateDatabaseInput {
126            database_name: self.database_name,
127            kms_key_id: self.kms_key_id,
128        })
129    }
130}