aws_sdk_dsql/operation/update_cluster/
_update_cluster_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The details of the cluster after it has been updated.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateClusterOutput {
7    /// <p>The ID of the cluster to update.</p>
8    pub identifier: ::std::string::String,
9    /// <p>The ARN of the updated cluster.</p>
10    pub arn: ::std::string::String,
11    /// <p>The status of the updated cluster.</p>
12    pub status: crate::types::ClusterStatus,
13    /// <p>The time of when the cluster was created.</p>
14    pub creation_time: ::aws_smithy_types::DateTime,
15    /// <p>The Region that receives all data you write to linked clusters.</p>
16    #[deprecated(
17        note = "The witnessRegion field is deprecated in the UpdateCluster API. To check witnessRegion, use the GetCluster API instead.",
18        since = "5/13/2025"
19    )]
20    pub witness_region: ::std::option::Option<::std::string::String>,
21    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
22    #[deprecated(
23        note = "The linkedClusterArns field is deprecated in the UpdateCluster API. To check peer cluster, use the GetCluster API instead.",
24        since = "5/13/2025"
25    )]
26    pub linked_cluster_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
27    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
28    #[deprecated(
29        note = "The deletionProtectionEnabled field is deprecated in the UpdateCluster API. To check deletion protection status, use the GetCluster API instead.",
30        since = "5/13/2025"
31    )]
32    pub deletion_protection_enabled: bool,
33    _request_id: Option<String>,
34}
35impl UpdateClusterOutput {
36    /// <p>The ID of the cluster to update.</p>
37    pub fn identifier(&self) -> &str {
38        use std::ops::Deref;
39        self.identifier.deref()
40    }
41    /// <p>The ARN of the updated cluster.</p>
42    pub fn arn(&self) -> &str {
43        use std::ops::Deref;
44        self.arn.deref()
45    }
46    /// <p>The status of the updated cluster.</p>
47    pub fn status(&self) -> &crate::types::ClusterStatus {
48        &self.status
49    }
50    /// <p>The time of when the cluster was created.</p>
51    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
52        &self.creation_time
53    }
54    /// <p>The Region that receives all data you write to linked clusters.</p>
55    #[deprecated(
56        note = "The witnessRegion field is deprecated in the UpdateCluster API. To check witnessRegion, use the GetCluster API instead.",
57        since = "5/13/2025"
58    )]
59    pub fn witness_region(&self) -> ::std::option::Option<&str> {
60        self.witness_region.as_deref()
61    }
62    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
63    ///
64    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.linked_cluster_arns.is_none()`.
65    #[deprecated(
66        note = "The linkedClusterArns field is deprecated in the UpdateCluster API. To check peer cluster, use the GetCluster API instead.",
67        since = "5/13/2025"
68    )]
69    pub fn linked_cluster_arns(&self) -> &[::std::string::String] {
70        self.linked_cluster_arns.as_deref().unwrap_or_default()
71    }
72    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
73    #[deprecated(
74        note = "The deletionProtectionEnabled field is deprecated in the UpdateCluster API. To check deletion protection status, use the GetCluster API instead.",
75        since = "5/13/2025"
76    )]
77    pub fn deletion_protection_enabled(&self) -> bool {
78        self.deletion_protection_enabled
79    }
80}
81impl ::aws_types::request_id::RequestId for UpdateClusterOutput {
82    fn request_id(&self) -> Option<&str> {
83        self._request_id.as_deref()
84    }
85}
86impl UpdateClusterOutput {
87    /// Creates a new builder-style object to manufacture [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
88    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterOutputBuilder {
89        crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::default()
90    }
91}
92
93/// A builder for [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
94#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
95#[non_exhaustive]
96pub struct UpdateClusterOutputBuilder {
97    pub(crate) identifier: ::std::option::Option<::std::string::String>,
98    pub(crate) arn: ::std::option::Option<::std::string::String>,
99    pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
100    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
101    pub(crate) witness_region: ::std::option::Option<::std::string::String>,
102    pub(crate) linked_cluster_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
103    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
104    _request_id: Option<String>,
105}
106impl UpdateClusterOutputBuilder {
107    /// <p>The ID of the cluster to update.</p>
108    /// This field is required.
109    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.identifier = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The ID of the cluster to update.</p>
114    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.identifier = input;
116        self
117    }
118    /// <p>The ID of the cluster to update.</p>
119    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
120        &self.identifier
121    }
122    /// <p>The ARN of the updated cluster.</p>
123    /// This field is required.
124    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.arn = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The ARN of the updated cluster.</p>
129    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.arn = input;
131        self
132    }
133    /// <p>The ARN of the updated cluster.</p>
134    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
135        &self.arn
136    }
137    /// <p>The status of the updated cluster.</p>
138    /// This field is required.
139    pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
140        self.status = ::std::option::Option::Some(input);
141        self
142    }
143    /// <p>The status of the updated cluster.</p>
144    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
145        self.status = input;
146        self
147    }
148    /// <p>The status of the updated cluster.</p>
149    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
150        &self.status
151    }
152    /// <p>The time of when the cluster was created.</p>
153    /// This field is required.
154    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
155        self.creation_time = ::std::option::Option::Some(input);
156        self
157    }
158    /// <p>The time of when the cluster was created.</p>
159    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
160        self.creation_time = input;
161        self
162    }
163    /// <p>The time of when the cluster was created.</p>
164    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
165        &self.creation_time
166    }
167    /// <p>The Region that receives all data you write to linked clusters.</p>
168    #[deprecated(
169        note = "The witnessRegion field is deprecated in the UpdateCluster API. To check witnessRegion, use the GetCluster API instead.",
170        since = "5/13/2025"
171    )]
172    pub fn witness_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.witness_region = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The Region that receives all data you write to linked clusters.</p>
177    #[deprecated(
178        note = "The witnessRegion field is deprecated in the UpdateCluster API. To check witnessRegion, use the GetCluster API instead.",
179        since = "5/13/2025"
180    )]
181    pub fn set_witness_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.witness_region = input;
183        self
184    }
185    /// <p>The Region that receives all data you write to linked clusters.</p>
186    #[deprecated(
187        note = "The witnessRegion field is deprecated in the UpdateCluster API. To check witnessRegion, use the GetCluster API instead.",
188        since = "5/13/2025"
189    )]
190    pub fn get_witness_region(&self) -> &::std::option::Option<::std::string::String> {
191        &self.witness_region
192    }
193    /// Appends an item to `linked_cluster_arns`.
194    ///
195    /// To override the contents of this collection use [`set_linked_cluster_arns`](Self::set_linked_cluster_arns).
196    ///
197    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
198    #[deprecated(
199        note = "The linkedClusterArns field is deprecated in the UpdateCluster API. To check peer cluster, use the GetCluster API instead.",
200        since = "5/13/2025"
201    )]
202    pub fn linked_cluster_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203        let mut v = self.linked_cluster_arns.unwrap_or_default();
204        v.push(input.into());
205        self.linked_cluster_arns = ::std::option::Option::Some(v);
206        self
207    }
208    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
209    #[deprecated(
210        note = "The linkedClusterArns field is deprecated in the UpdateCluster API. To check peer cluster, use the GetCluster API instead.",
211        since = "5/13/2025"
212    )]
213    pub fn set_linked_cluster_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
214        self.linked_cluster_arns = input;
215        self
216    }
217    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
218    #[deprecated(
219        note = "The linkedClusterArns field is deprecated in the UpdateCluster API. To check peer cluster, use the GetCluster API instead.",
220        since = "5/13/2025"
221    )]
222    pub fn get_linked_cluster_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
223        &self.linked_cluster_arns
224    }
225    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
226    /// This field is required.
227    #[deprecated(
228        note = "The deletionProtectionEnabled field is deprecated in the UpdateCluster API. To check deletion protection status, use the GetCluster API instead.",
229        since = "5/13/2025"
230    )]
231    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
232        self.deletion_protection_enabled = ::std::option::Option::Some(input);
233        self
234    }
235    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
236    #[deprecated(
237        note = "The deletionProtectionEnabled field is deprecated in the UpdateCluster API. To check deletion protection status, use the GetCluster API instead.",
238        since = "5/13/2025"
239    )]
240    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
241        self.deletion_protection_enabled = input;
242        self
243    }
244    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
245    #[deprecated(
246        note = "The deletionProtectionEnabled field is deprecated in the UpdateCluster API. To check deletion protection status, use the GetCluster API instead.",
247        since = "5/13/2025"
248    )]
249    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
250        &self.deletion_protection_enabled
251    }
252    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
253        self._request_id = Some(request_id.into());
254        self
255    }
256
257    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
258        self._request_id = request_id;
259        self
260    }
261    /// Consumes the builder and constructs a [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
262    /// This method will fail if any of the following fields are not set:
263    /// - [`identifier`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::identifier)
264    /// - [`arn`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::arn)
265    /// - [`status`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::status)
266    /// - [`creation_time`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::creation_time)
267    /// - [`deletion_protection_enabled`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::deletion_protection_enabled)
268    pub fn build(
269        self,
270    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
271        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterOutput {
272            identifier: self.identifier.ok_or_else(|| {
273                ::aws_smithy_types::error::operation::BuildError::missing_field(
274                    "identifier",
275                    "identifier was not specified but it is required when building UpdateClusterOutput",
276                )
277            })?,
278            arn: self.arn.ok_or_else(|| {
279                ::aws_smithy_types::error::operation::BuildError::missing_field(
280                    "arn",
281                    "arn was not specified but it is required when building UpdateClusterOutput",
282                )
283            })?,
284            status: self.status.ok_or_else(|| {
285                ::aws_smithy_types::error::operation::BuildError::missing_field(
286                    "status",
287                    "status was not specified but it is required when building UpdateClusterOutput",
288                )
289            })?,
290            creation_time: self.creation_time.ok_or_else(|| {
291                ::aws_smithy_types::error::operation::BuildError::missing_field(
292                    "creation_time",
293                    "creation_time was not specified but it is required when building UpdateClusterOutput",
294                )
295            })?,
296            witness_region: self.witness_region,
297            linked_cluster_arns: self.linked_cluster_arns,
298            deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
299                ::aws_smithy_types::error::operation::BuildError::missing_field(
300                    "deletion_protection_enabled",
301                    "deletion_protection_enabled was not specified but it is required when building UpdateClusterOutput",
302                )
303            })?,
304            _request_id: self._request_id,
305        })
306    }
307}