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>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>
11    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
12    pub client_token: ::std::option::Option<::std::string::String>,
13    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
14    pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
15}
16impl UpdateClusterInput {
17    /// <p>The ID of the cluster you want to update.</p>
18    pub fn identifier(&self) -> ::std::option::Option<&str> {
19        self.identifier.as_deref()
20    }
21    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
22    pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
23        self.deletion_protection_enabled
24    }
25    /// <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>
26    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
27    pub fn client_token(&self) -> ::std::option::Option<&str> {
28        self.client_token.as_deref()
29    }
30    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
31    pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
32        self.multi_region_properties.as_ref()
33    }
34}
35impl UpdateClusterInput {
36    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
37    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
38        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateClusterInputBuilder {
46    pub(crate) identifier: ::std::option::Option<::std::string::String>,
47    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
48    pub(crate) client_token: ::std::option::Option<::std::string::String>,
49    pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
50}
51impl UpdateClusterInputBuilder {
52    /// <p>The ID of the cluster you want to update.</p>
53    /// This field is required.
54    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.identifier = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The ID of the cluster you want to update.</p>
59    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.identifier = input;
61        self
62    }
63    /// <p>The ID of the cluster you want to update.</p>
64    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
65        &self.identifier
66    }
67    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
68    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
69        self.deletion_protection_enabled = ::std::option::Option::Some(input);
70        self
71    }
72    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
73    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
74        self.deletion_protection_enabled = input;
75        self
76    }
77    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
78    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
79        &self.deletion_protection_enabled
80    }
81    /// <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>
82    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
83    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.client_token = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <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>
88    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
89    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.client_token = input;
91        self
92    }
93    /// <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>
94    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
95    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
96        &self.client_token
97    }
98    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
99    pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
100        self.multi_region_properties = ::std::option::Option::Some(input);
101        self
102    }
103    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
104    pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
105        self.multi_region_properties = input;
106        self
107    }
108    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
109    pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
110        &self.multi_region_properties
111    }
112    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
113    pub fn build(
114        self,
115    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
116        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
117            identifier: self.identifier,
118            deletion_protection_enabled: self.deletion_protection_enabled,
119            client_token: self.client_token,
120            multi_region_properties: self.multi_region_properties,
121        })
122    }
123}