aws_sdk_dsql/operation/get_cluster/
_get_cluster_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output of a cluster.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetClusterOutput {
7    /// <p>The ID of the retrieved cluster.</p>
8    pub identifier: ::std::string::String,
9    /// <p>The ARN of the retrieved cluster.</p>
10    pub arn: ::std::string::String,
11    /// <p>The status of the retrieved 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>Whether deletion protection is enabled in this cluster.</p>
16    pub deletion_protection_enabled: bool,
17    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
18    pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
19    /// <p>Map of tags.</p>
20    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21    /// <p>The current encryption configuration details for the cluster.</p>
22    pub encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
23    _request_id: Option<String>,
24}
25impl GetClusterOutput {
26    /// <p>The ID of the retrieved cluster.</p>
27    pub fn identifier(&self) -> &str {
28        use std::ops::Deref;
29        self.identifier.deref()
30    }
31    /// <p>The ARN of the retrieved cluster.</p>
32    pub fn arn(&self) -> &str {
33        use std::ops::Deref;
34        self.arn.deref()
35    }
36    /// <p>The status of the retrieved cluster.</p>
37    pub fn status(&self) -> &crate::types::ClusterStatus {
38        &self.status
39    }
40    /// <p>The time of when the cluster was created.</p>
41    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
42        &self.creation_time
43    }
44    /// <p>Whether deletion protection is enabled in this cluster.</p>
45    pub fn deletion_protection_enabled(&self) -> bool {
46        self.deletion_protection_enabled
47    }
48    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
49    pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
50        self.multi_region_properties.as_ref()
51    }
52    /// <p>Map of tags.</p>
53    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
54        self.tags.as_ref()
55    }
56    /// <p>The current encryption configuration details for the cluster.</p>
57    pub fn encryption_details(&self) -> ::std::option::Option<&crate::types::EncryptionDetails> {
58        self.encryption_details.as_ref()
59    }
60}
61impl ::aws_types::request_id::RequestId for GetClusterOutput {
62    fn request_id(&self) -> Option<&str> {
63        self._request_id.as_deref()
64    }
65}
66impl GetClusterOutput {
67    /// Creates a new builder-style object to manufacture [`GetClusterOutput`](crate::operation::get_cluster::GetClusterOutput).
68    pub fn builder() -> crate::operation::get_cluster::builders::GetClusterOutputBuilder {
69        crate::operation::get_cluster::builders::GetClusterOutputBuilder::default()
70    }
71}
72
73/// A builder for [`GetClusterOutput`](crate::operation::get_cluster::GetClusterOutput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct GetClusterOutputBuilder {
77    pub(crate) identifier: ::std::option::Option<::std::string::String>,
78    pub(crate) arn: ::std::option::Option<::std::string::String>,
79    pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
80    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
81    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
82    pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
83    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
84    pub(crate) encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
85    _request_id: Option<String>,
86}
87impl GetClusterOutputBuilder {
88    /// <p>The ID of the retrieved cluster.</p>
89    /// This field is required.
90    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.identifier = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The ID of the retrieved cluster.</p>
95    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.identifier = input;
97        self
98    }
99    /// <p>The ID of the retrieved cluster.</p>
100    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
101        &self.identifier
102    }
103    /// <p>The ARN of the retrieved cluster.</p>
104    /// This field is required.
105    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.arn = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The ARN of the retrieved cluster.</p>
110    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.arn = input;
112        self
113    }
114    /// <p>The ARN of the retrieved cluster.</p>
115    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
116        &self.arn
117    }
118    /// <p>The status of the retrieved cluster.</p>
119    /// This field is required.
120    pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
121        self.status = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>The status of the retrieved cluster.</p>
125    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
126        self.status = input;
127        self
128    }
129    /// <p>The status of the retrieved cluster.</p>
130    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
131        &self.status
132    }
133    /// <p>The time of when the cluster was created.</p>
134    /// This field is required.
135    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
136        self.creation_time = ::std::option::Option::Some(input);
137        self
138    }
139    /// <p>The time of when the cluster was created.</p>
140    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
141        self.creation_time = input;
142        self
143    }
144    /// <p>The time of when the cluster was created.</p>
145    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
146        &self.creation_time
147    }
148    /// <p>Whether deletion protection is enabled in this cluster.</p>
149    /// This field is required.
150    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
151        self.deletion_protection_enabled = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>Whether deletion protection is enabled in this cluster.</p>
155    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
156        self.deletion_protection_enabled = input;
157        self
158    }
159    /// <p>Whether deletion protection is enabled in this cluster.</p>
160    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
161        &self.deletion_protection_enabled
162    }
163    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
164    pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
165        self.multi_region_properties = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
169    pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
170        self.multi_region_properties = input;
171        self
172    }
173    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
174    pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
175        &self.multi_region_properties
176    }
177    /// Adds a key-value pair to `tags`.
178    ///
179    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
180    ///
181    /// <p>Map of tags.</p>
182    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
183        let mut hash_map = self.tags.unwrap_or_default();
184        hash_map.insert(k.into(), v.into());
185        self.tags = ::std::option::Option::Some(hash_map);
186        self
187    }
188    /// <p>Map of tags.</p>
189    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
190        self.tags = input;
191        self
192    }
193    /// <p>Map of tags.</p>
194    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
195        &self.tags
196    }
197    /// <p>The current encryption configuration details for the cluster.</p>
198    pub fn encryption_details(mut self, input: crate::types::EncryptionDetails) -> Self {
199        self.encryption_details = ::std::option::Option::Some(input);
200        self
201    }
202    /// <p>The current encryption configuration details for the cluster.</p>
203    pub fn set_encryption_details(mut self, input: ::std::option::Option<crate::types::EncryptionDetails>) -> Self {
204        self.encryption_details = input;
205        self
206    }
207    /// <p>The current encryption configuration details for the cluster.</p>
208    pub fn get_encryption_details(&self) -> &::std::option::Option<crate::types::EncryptionDetails> {
209        &self.encryption_details
210    }
211    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
212        self._request_id = Some(request_id.into());
213        self
214    }
215
216    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
217        self._request_id = request_id;
218        self
219    }
220    /// Consumes the builder and constructs a [`GetClusterOutput`](crate::operation::get_cluster::GetClusterOutput).
221    /// This method will fail if any of the following fields are not set:
222    /// - [`identifier`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::identifier)
223    /// - [`arn`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::arn)
224    /// - [`status`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::status)
225    /// - [`creation_time`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::creation_time)
226    /// - [`deletion_protection_enabled`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::deletion_protection_enabled)
227    pub fn build(self) -> ::std::result::Result<crate::operation::get_cluster::GetClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
228        ::std::result::Result::Ok(crate::operation::get_cluster::GetClusterOutput {
229            identifier: self.identifier.ok_or_else(|| {
230                ::aws_smithy_types::error::operation::BuildError::missing_field(
231                    "identifier",
232                    "identifier was not specified but it is required when building GetClusterOutput",
233                )
234            })?,
235            arn: self.arn.ok_or_else(|| {
236                ::aws_smithy_types::error::operation::BuildError::missing_field(
237                    "arn",
238                    "arn was not specified but it is required when building GetClusterOutput",
239                )
240            })?,
241            status: self.status.ok_or_else(|| {
242                ::aws_smithy_types::error::operation::BuildError::missing_field(
243                    "status",
244                    "status was not specified but it is required when building GetClusterOutput",
245                )
246            })?,
247            creation_time: self.creation_time.ok_or_else(|| {
248                ::aws_smithy_types::error::operation::BuildError::missing_field(
249                    "creation_time",
250                    "creation_time was not specified but it is required when building GetClusterOutput",
251                )
252            })?,
253            deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
254                ::aws_smithy_types::error::operation::BuildError::missing_field(
255                    "deletion_protection_enabled",
256                    "deletion_protection_enabled was not specified but it is required when building GetClusterOutput",
257                )
258            })?,
259            multi_region_properties: self.multi_region_properties,
260            tags: self.tags,
261            encryption_details: self.encryption_details,
262            _request_id: self._request_id,
263        })
264    }
265}