aws_sdk_dsql/operation/create_cluster/
_create_cluster_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateClusterOutput {
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 multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
17 pub encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
19 pub deletion_protection_enabled: bool,
21 _request_id: Option<String>,
22}
23impl CreateClusterOutput {
24 pub fn identifier(&self) -> &str {
26 use std::ops::Deref;
27 self.identifier.deref()
28 }
29 pub fn arn(&self) -> &str {
31 use std::ops::Deref;
32 self.arn.deref()
33 }
34 pub fn status(&self) -> &crate::types::ClusterStatus {
36 &self.status
37 }
38 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
40 &self.creation_time
41 }
42 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
44 self.multi_region_properties.as_ref()
45 }
46 pub fn encryption_details(&self) -> ::std::option::Option<&crate::types::EncryptionDetails> {
48 self.encryption_details.as_ref()
49 }
50 pub fn deletion_protection_enabled(&self) -> bool {
52 self.deletion_protection_enabled
53 }
54}
55impl ::aws_types::request_id::RequestId for CreateClusterOutput {
56 fn request_id(&self) -> Option<&str> {
57 self._request_id.as_deref()
58 }
59}
60impl CreateClusterOutput {
61 pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterOutputBuilder {
63 crate::operation::create_cluster::builders::CreateClusterOutputBuilder::default()
64 }
65}
66
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct CreateClusterOutputBuilder {
71 pub(crate) identifier: ::std::option::Option<::std::string::String>,
72 pub(crate) arn: ::std::option::Option<::std::string::String>,
73 pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
74 pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
75 pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
76 pub(crate) encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
77 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
78 _request_id: Option<String>,
79}
80impl CreateClusterOutputBuilder {
81 pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.identifier = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.identifier = input;
90 self
91 }
92 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
94 &self.identifier
95 }
96 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99 self.arn = ::std::option::Option::Some(input.into());
100 self
101 }
102 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104 self.arn = input;
105 self
106 }
107 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
109 &self.arn
110 }
111 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
114 self.status = ::std::option::Option::Some(input);
115 self
116 }
117 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
119 self.status = input;
120 self
121 }
122 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
124 &self.status
125 }
126 pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
129 self.creation_time = ::std::option::Option::Some(input);
130 self
131 }
132 pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
134 self.creation_time = input;
135 self
136 }
137 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
139 &self.creation_time
140 }
141 pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
143 self.multi_region_properties = ::std::option::Option::Some(input);
144 self
145 }
146 pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
148 self.multi_region_properties = input;
149 self
150 }
151 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
153 &self.multi_region_properties
154 }
155 pub fn encryption_details(mut self, input: crate::types::EncryptionDetails) -> Self {
157 self.encryption_details = ::std::option::Option::Some(input);
158 self
159 }
160 pub fn set_encryption_details(mut self, input: ::std::option::Option<crate::types::EncryptionDetails>) -> Self {
162 self.encryption_details = input;
163 self
164 }
165 pub fn get_encryption_details(&self) -> &::std::option::Option<crate::types::EncryptionDetails> {
167 &self.encryption_details
168 }
169 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
172 self.deletion_protection_enabled = ::std::option::Option::Some(input);
173 self
174 }
175 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
177 self.deletion_protection_enabled = input;
178 self
179 }
180 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
182 &self.deletion_protection_enabled
183 }
184 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
185 self._request_id = Some(request_id.into());
186 self
187 }
188
189 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
190 self._request_id = request_id;
191 self
192 }
193 pub fn build(
201 self,
202 ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
203 ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterOutput {
204 identifier: self.identifier.ok_or_else(|| {
205 ::aws_smithy_types::error::operation::BuildError::missing_field(
206 "identifier",
207 "identifier was not specified but it is required when building CreateClusterOutput",
208 )
209 })?,
210 arn: self.arn.ok_or_else(|| {
211 ::aws_smithy_types::error::operation::BuildError::missing_field(
212 "arn",
213 "arn was not specified but it is required when building CreateClusterOutput",
214 )
215 })?,
216 status: self.status.ok_or_else(|| {
217 ::aws_smithy_types::error::operation::BuildError::missing_field(
218 "status",
219 "status was not specified but it is required when building CreateClusterOutput",
220 )
221 })?,
222 creation_time: self.creation_time.ok_or_else(|| {
223 ::aws_smithy_types::error::operation::BuildError::missing_field(
224 "creation_time",
225 "creation_time was not specified but it is required when building CreateClusterOutput",
226 )
227 })?,
228 multi_region_properties: self.multi_region_properties,
229 encryption_details: self.encryption_details,
230 deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
231 ::aws_smithy_types::error::operation::BuildError::missing_field(
232 "deletion_protection_enabled",
233 "deletion_protection_enabled was not specified but it is required when building CreateClusterOutput",
234 )
235 })?,
236 _request_id: self._request_id,
237 })
238 }
239}