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 deletion_protection_enabled: bool,
19 _request_id: Option<String>,
20}
21impl CreateClusterOutput {
22 pub fn identifier(&self) -> &str {
24 use std::ops::Deref;
25 self.identifier.deref()
26 }
27 pub fn arn(&self) -> &str {
29 use std::ops::Deref;
30 self.arn.deref()
31 }
32 pub fn status(&self) -> &crate::types::ClusterStatus {
34 &self.status
35 }
36 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
38 &self.creation_time
39 }
40 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
42 self.multi_region_properties.as_ref()
43 }
44 pub fn deletion_protection_enabled(&self) -> bool {
46 self.deletion_protection_enabled
47 }
48}
49impl ::aws_types::request_id::RequestId for CreateClusterOutput {
50 fn request_id(&self) -> Option<&str> {
51 self._request_id.as_deref()
52 }
53}
54impl CreateClusterOutput {
55 pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterOutputBuilder {
57 crate::operation::create_cluster::builders::CreateClusterOutputBuilder::default()
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct CreateClusterOutputBuilder {
65 pub(crate) identifier: ::std::option::Option<::std::string::String>,
66 pub(crate) arn: ::std::option::Option<::std::string::String>,
67 pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
68 pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
69 pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
70 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
71 _request_id: Option<String>,
72}
73impl CreateClusterOutputBuilder {
74 pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.identifier = ::std::option::Option::Some(input.into());
78 self
79 }
80 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.identifier = input;
83 self
84 }
85 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
87 &self.identifier
88 }
89 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92 self.arn = ::std::option::Option::Some(input.into());
93 self
94 }
95 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97 self.arn = input;
98 self
99 }
100 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
102 &self.arn
103 }
104 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
107 self.status = ::std::option::Option::Some(input);
108 self
109 }
110 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
112 self.status = input;
113 self
114 }
115 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
117 &self.status
118 }
119 pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
122 self.creation_time = ::std::option::Option::Some(input);
123 self
124 }
125 pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
127 self.creation_time = input;
128 self
129 }
130 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
132 &self.creation_time
133 }
134 pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
136 self.multi_region_properties = ::std::option::Option::Some(input);
137 self
138 }
139 pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
141 self.multi_region_properties = input;
142 self
143 }
144 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
146 &self.multi_region_properties
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(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
164 self._request_id = Some(request_id.into());
165 self
166 }
167
168 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
169 self._request_id = request_id;
170 self
171 }
172 pub fn build(
180 self,
181 ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
182 ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterOutput {
183 identifier: self.identifier.ok_or_else(|| {
184 ::aws_smithy_types::error::operation::BuildError::missing_field(
185 "identifier",
186 "identifier was not specified but it is required when building CreateClusterOutput",
187 )
188 })?,
189 arn: self.arn.ok_or_else(|| {
190 ::aws_smithy_types::error::operation::BuildError::missing_field(
191 "arn",
192 "arn was not specified but it is required when building CreateClusterOutput",
193 )
194 })?,
195 status: self.status.ok_or_else(|| {
196 ::aws_smithy_types::error::operation::BuildError::missing_field(
197 "status",
198 "status was not specified but it is required when building CreateClusterOutput",
199 )
200 })?,
201 creation_time: self.creation_time.ok_or_else(|| {
202 ::aws_smithy_types::error::operation::BuildError::missing_field(
203 "creation_time",
204 "creation_time was not specified but it is required when building CreateClusterOutput",
205 )
206 })?,
207 multi_region_properties: self.multi_region_properties,
208 deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
209 ::aws_smithy_types::error::operation::BuildError::missing_field(
210 "deletion_protection_enabled",
211 "deletion_protection_enabled was not specified but it is required when building CreateClusterOutput",
212 )
213 })?,
214 _request_id: self._request_id,
215 })
216 }
217}