aws_sdk_dsql/operation/update_cluster/
_update_cluster_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 UpdateClusterInput {
6    /// <p>The ID of the cluster you want to update.</p>
7    pub identifier: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
9    pub deletion_protection_enabled: ::std::option::Option<bool>,
10    /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
11    pub kms_encryption_key: ::std::option::Option<::std::string::String>,
12    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
13    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
14    pub client_token: ::std::option::Option<::std::string::String>,
15    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
16    pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
17}
18impl UpdateClusterInput {
19    /// <p>The ID of the cluster you want to update.</p>
20    pub fn identifier(&self) -> ::std::option::Option<&str> {
21        self.identifier.as_deref()
22    }
23    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
24    pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
25        self.deletion_protection_enabled
26    }
27    /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
28    pub fn kms_encryption_key(&self) -> ::std::option::Option<&str> {
29        self.kms_encryption_key.as_deref()
30    }
31    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
32    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
33    pub fn client_token(&self) -> ::std::option::Option<&str> {
34        self.client_token.as_deref()
35    }
36    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
37    pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
38        self.multi_region_properties.as_ref()
39    }
40}
41impl UpdateClusterInput {
42    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
43    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
44        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateClusterInputBuilder {
52    pub(crate) identifier: ::std::option::Option<::std::string::String>,
53    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
54    pub(crate) kms_encryption_key: ::std::option::Option<::std::string::String>,
55    pub(crate) client_token: ::std::option::Option<::std::string::String>,
56    pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
57}
58impl UpdateClusterInputBuilder {
59    /// <p>The ID of the cluster you want to update.</p>
60    /// This field is required.
61    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.identifier = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The ID of the cluster you want to update.</p>
66    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.identifier = input;
68        self
69    }
70    /// <p>The ID of the cluster you want to update.</p>
71    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
72        &self.identifier
73    }
74    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
75    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
76        self.deletion_protection_enabled = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
80    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
81        self.deletion_protection_enabled = input;
82        self
83    }
84    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
85    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
86        &self.deletion_protection_enabled
87    }
88    /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
89    pub fn kms_encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.kms_encryption_key = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
94    pub fn set_kms_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.kms_encryption_key = input;
96        self
97    }
98    /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
99    pub fn get_kms_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
100        &self.kms_encryption_key
101    }
102    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
103    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
104    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.client_token = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
109    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
110    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.client_token = input;
112        self
113    }
114    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
115    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
116    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
117        &self.client_token
118    }
119    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
120    pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
121        self.multi_region_properties = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
125    pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
126        self.multi_region_properties = input;
127        self
128    }
129    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
130    pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
131        &self.multi_region_properties
132    }
133    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
134    pub fn build(
135        self,
136    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
137        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
138            identifier: self.identifier,
139            deletion_protection_enabled: self.deletion_protection_enabled,
140            kms_encryption_key: self.kms_encryption_key,
141            client_token: self.client_token,
142            multi_region_properties: self.multi_region_properties,
143        })
144    }
145}