aws_sdk_dsql/operation/get_cluster/
_get_cluster_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetClusterOutput {
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. To see the witnessRegion, use multiRegionProperties.witnessRegion 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. To see the peered cluster Arns, use multiRegionProperties.cluster instead.",
24 since = "5/13/2025"
25 )]
26 pub linked_cluster_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
27 pub deletion_protection_enabled: bool,
29 pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
31 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
33 _request_id: Option<String>,
34}
35impl GetClusterOutput {
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. To see the witnessRegion, use multiRegionProperties.witnessRegion 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. To see the peered cluster Arns, use multiRegionProperties.cluster 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 pub fn deletion_protection_enabled(&self) -> bool {
74 self.deletion_protection_enabled
75 }
76 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
78 self.multi_region_properties.as_ref()
79 }
80 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
82 self.tags.as_ref()
83 }
84}
85impl ::aws_types::request_id::RequestId for GetClusterOutput {
86 fn request_id(&self) -> Option<&str> {
87 self._request_id.as_deref()
88 }
89}
90impl GetClusterOutput {
91 pub fn builder() -> crate::operation::get_cluster::builders::GetClusterOutputBuilder {
93 crate::operation::get_cluster::builders::GetClusterOutputBuilder::default()
94 }
95}
96
97#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
99#[non_exhaustive]
100pub struct GetClusterOutputBuilder {
101 pub(crate) identifier: ::std::option::Option<::std::string::String>,
102 pub(crate) arn: ::std::option::Option<::std::string::String>,
103 pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
104 pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
105 pub(crate) witness_region: ::std::option::Option<::std::string::String>,
106 pub(crate) linked_cluster_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
107 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
108 pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
109 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
110 _request_id: Option<String>,
111}
112impl GetClusterOutputBuilder {
113 pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.identifier = ::std::option::Option::Some(input.into());
117 self
118 }
119 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.identifier = input;
122 self
123 }
124 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
126 &self.identifier
127 }
128 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.arn = ::std::option::Option::Some(input.into());
132 self
133 }
134 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.arn = input;
137 self
138 }
139 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
141 &self.arn
142 }
143 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
146 self.status = ::std::option::Option::Some(input);
147 self
148 }
149 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
151 self.status = input;
152 self
153 }
154 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
156 &self.status
157 }
158 pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
161 self.creation_time = ::std::option::Option::Some(input);
162 self
163 }
164 pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
166 self.creation_time = input;
167 self
168 }
169 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
171 &self.creation_time
172 }
173 #[deprecated(
175 note = "The witnessRegion field is deprecated. To see the witnessRegion, use multiRegionProperties.witnessRegion instead.",
176 since = "5/13/2025"
177 )]
178 pub fn witness_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179 self.witness_region = ::std::option::Option::Some(input.into());
180 self
181 }
182 #[deprecated(
184 note = "The witnessRegion field is deprecated. To see the witnessRegion, use multiRegionProperties.witnessRegion instead.",
185 since = "5/13/2025"
186 )]
187 pub fn set_witness_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.witness_region = input;
189 self
190 }
191 #[deprecated(
193 note = "The witnessRegion field is deprecated. To see the witnessRegion, use multiRegionProperties.witnessRegion instead.",
194 since = "5/13/2025"
195 )]
196 pub fn get_witness_region(&self) -> &::std::option::Option<::std::string::String> {
197 &self.witness_region
198 }
199 #[deprecated(
205 note = "The linkedClusterArns field is deprecated. To see the peered cluster Arns, use multiRegionProperties.cluster instead.",
206 since = "5/13/2025"
207 )]
208 pub fn linked_cluster_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209 let mut v = self.linked_cluster_arns.unwrap_or_default();
210 v.push(input.into());
211 self.linked_cluster_arns = ::std::option::Option::Some(v);
212 self
213 }
214 #[deprecated(
216 note = "The linkedClusterArns field is deprecated. To see the peered cluster Arns, use multiRegionProperties.cluster instead.",
217 since = "5/13/2025"
218 )]
219 pub fn set_linked_cluster_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
220 self.linked_cluster_arns = input;
221 self
222 }
223 #[deprecated(
225 note = "The linkedClusterArns field is deprecated. To see the peered cluster Arns, use multiRegionProperties.cluster instead.",
226 since = "5/13/2025"
227 )]
228 pub fn get_linked_cluster_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
229 &self.linked_cluster_arns
230 }
231 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
234 self.deletion_protection_enabled = ::std::option::Option::Some(input);
235 self
236 }
237 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
239 self.deletion_protection_enabled = input;
240 self
241 }
242 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
244 &self.deletion_protection_enabled
245 }
246 pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
248 self.multi_region_properties = ::std::option::Option::Some(input);
249 self
250 }
251 pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
253 self.multi_region_properties = input;
254 self
255 }
256 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
258 &self.multi_region_properties
259 }
260 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
266 let mut hash_map = self.tags.unwrap_or_default();
267 hash_map.insert(k.into(), v.into());
268 self.tags = ::std::option::Option::Some(hash_map);
269 self
270 }
271 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
273 self.tags = input;
274 self
275 }
276 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
278 &self.tags
279 }
280 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
281 self._request_id = Some(request_id.into());
282 self
283 }
284
285 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
286 self._request_id = request_id;
287 self
288 }
289 pub fn build(self) -> ::std::result::Result<crate::operation::get_cluster::GetClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
297 ::std::result::Result::Ok(crate::operation::get_cluster::GetClusterOutput {
298 identifier: self.identifier.ok_or_else(|| {
299 ::aws_smithy_types::error::operation::BuildError::missing_field(
300 "identifier",
301 "identifier was not specified but it is required when building GetClusterOutput",
302 )
303 })?,
304 arn: self.arn.ok_or_else(|| {
305 ::aws_smithy_types::error::operation::BuildError::missing_field(
306 "arn",
307 "arn was not specified but it is required when building GetClusterOutput",
308 )
309 })?,
310 status: self.status.ok_or_else(|| {
311 ::aws_smithy_types::error::operation::BuildError::missing_field(
312 "status",
313 "status was not specified but it is required when building GetClusterOutput",
314 )
315 })?,
316 creation_time: self.creation_time.ok_or_else(|| {
317 ::aws_smithy_types::error::operation::BuildError::missing_field(
318 "creation_time",
319 "creation_time was not specified but it is required when building GetClusterOutput",
320 )
321 })?,
322 witness_region: self.witness_region,
323 linked_cluster_arns: self.linked_cluster_arns,
324 deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
325 ::aws_smithy_types::error::operation::BuildError::missing_field(
326 "deletion_protection_enabled",
327 "deletion_protection_enabled was not specified but it is required when building GetClusterOutput",
328 )
329 })?,
330 multi_region_properties: self.multi_region_properties,
331 tags: self.tags,
332 _request_id: self._request_id,
333 })
334 }
335}