aws_sdk_dsql/operation/update_cluster/
_update_cluster_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateClusterOutput {
7 pub identifier: ::std::string::String,
9 pub arn: ::std::string::String,
11 pub status: crate::types::ClusterStatus,
13 pub creation_time: ::aws_smithy_types::DateTime,
15 #[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 #[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 #[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 pub fn identifier(&self) -> &str {
38 use std::ops::Deref;
39 self.identifier.deref()
40 }
41 pub fn arn(&self) -> &str {
43 use std::ops::Deref;
44 self.arn.deref()
45 }
46 pub fn status(&self) -> &crate::types::ClusterStatus {
48 &self.status
49 }
50 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
52 &self.creation_time
53 }
54 #[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 #[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 #[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 pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterOutputBuilder {
89 crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::default()
90 }
91}
92
93#[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 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 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115 self.identifier = input;
116 self
117 }
118 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
120 &self.identifier
121 }
122 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.arn = input;
131 self
132 }
133 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
135 &self.arn
136 }
137 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
140 self.status = ::std::option::Option::Some(input);
141 self
142 }
143 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
145 self.status = input;
146 self
147 }
148 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
150 &self.status
151 }
152 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 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 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
165 &self.creation_time
166 }
167 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 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}