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 _request_id: Option<String>,
24}
25impl GetClusterOutput {
26 pub fn identifier(&self) -> &str {
28 use std::ops::Deref;
29 self.identifier.deref()
30 }
31 pub fn arn(&self) -> &str {
33 use std::ops::Deref;
34 self.arn.deref()
35 }
36 pub fn status(&self) -> &crate::types::ClusterStatus {
38 &self.status
39 }
40 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
42 &self.creation_time
43 }
44 pub fn deletion_protection_enabled(&self) -> bool {
46 self.deletion_protection_enabled
47 }
48 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
50 self.multi_region_properties.as_ref()
51 }
52 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
54 self.tags.as_ref()
55 }
56 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 pub fn builder() -> crate::operation::get_cluster::builders::GetClusterOutputBuilder {
69 crate::operation::get_cluster::builders::GetClusterOutputBuilder::default()
70 }
71}
72
73#[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 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 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.identifier = input;
97 self
98 }
99 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
101 &self.identifier
102 }
103 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.arn = input;
112 self
113 }
114 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
116 &self.arn
117 }
118 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
121 self.status = ::std::option::Option::Some(input);
122 self
123 }
124 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
126 self.status = input;
127 self
128 }
129 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
131 &self.status
132 }
133 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 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 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
146 &self.creation_time
147 }
148 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
151 self.deletion_protection_enabled = ::std::option::Option::Some(input);
152 self
153 }
154 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
156 self.deletion_protection_enabled = input;
157 self
158 }
159 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
161 &self.deletion_protection_enabled
162 }
163 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 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 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
175 &self.multi_region_properties
176 }
177 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
195 &self.tags
196 }
197 pub fn encryption_details(mut self, input: crate::types::EncryptionDetails) -> Self {
199 self.encryption_details = ::std::option::Option::Some(input);
200 self
201 }
202 pub fn set_encryption_details(mut self, input: ::std::option::Option<crate::types::EncryptionDetails>) -> Self {
204 self.encryption_details = input;
205 self
206 }
207 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 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}