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