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 pub deletion_protection_enabled: bool,
17 pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
19 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21 pub encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
23 pub endpoint: ::std::option::Option<::std::string::String>,
25 _request_id: Option<String>,
26}
27impl GetClusterOutput {
28 pub fn identifier(&self) -> &str {
30 use std::ops::Deref;
31 self.identifier.deref()
32 }
33 pub fn arn(&self) -> &str {
35 use std::ops::Deref;
36 self.arn.deref()
37 }
38 pub fn status(&self) -> &crate::types::ClusterStatus {
40 &self.status
41 }
42 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
44 &self.creation_time
45 }
46 pub fn deletion_protection_enabled(&self) -> bool {
48 self.deletion_protection_enabled
49 }
50 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
52 self.multi_region_properties.as_ref()
53 }
54 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
56 self.tags.as_ref()
57 }
58 pub fn encryption_details(&self) -> ::std::option::Option<&crate::types::EncryptionDetails> {
60 self.encryption_details.as_ref()
61 }
62 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 pub fn builder() -> crate::operation::get_cluster::builders::GetClusterOutputBuilder {
75 crate::operation::get_cluster::builders::GetClusterOutputBuilder::default()
76 }
77}
78
79#[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 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 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.identifier = input;
104 self
105 }
106 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
108 &self.identifier
109 }
110 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.arn = input;
119 self
120 }
121 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
123 &self.arn
124 }
125 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
128 self.status = ::std::option::Option::Some(input);
129 self
130 }
131 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
133 self.status = input;
134 self
135 }
136 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
138 &self.status
139 }
140 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 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 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
153 &self.creation_time
154 }
155 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
158 self.deletion_protection_enabled = ::std::option::Option::Some(input);
159 self
160 }
161 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
163 self.deletion_protection_enabled = input;
164 self
165 }
166 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
168 &self.deletion_protection_enabled
169 }
170 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 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 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
182 &self.multi_region_properties
183 }
184 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
202 &self.tags
203 }
204 pub fn encryption_details(mut self, input: crate::types::EncryptionDetails) -> Self {
206 self.encryption_details = ::std::option::Option::Some(input);
207 self
208 }
209 pub fn set_encryption_details(mut self, input: ::std::option::Option<crate::types::EncryptionDetails>) -> Self {
211 self.encryption_details = input;
212 self
213 }
214 pub fn get_encryption_details(&self) -> &::std::option::Option<crate::types::EncryptionDetails> {
216 &self.encryption_details
217 }
218 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 pub fn set_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.endpoint = input;
226 self
227 }
228 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 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}