aws_sdk_dsql/operation/update_cluster/
_update_cluster_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateClusterOutput {
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 witness_region: ::std::option::Option<::std::string::String>,
19 pub linked_cluster_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21 _request_id: Option<String>,
22}
23impl UpdateClusterOutput {
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 deletion_protection_enabled(&self) -> bool {
44 self.deletion_protection_enabled
45 }
46 pub fn witness_region(&self) -> ::std::option::Option<&str> {
48 self.witness_region.as_deref()
49 }
50 pub fn linked_cluster_arns(&self) -> &[::std::string::String] {
54 self.linked_cluster_arns.as_deref().unwrap_or_default()
55 }
56}
57impl ::aws_types::request_id::RequestId for UpdateClusterOutput {
58 fn request_id(&self) -> Option<&str> {
59 self._request_id.as_deref()
60 }
61}
62impl UpdateClusterOutput {
63 pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterOutputBuilder {
65 crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::default()
66 }
67}
68
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
71#[non_exhaustive]
72pub struct UpdateClusterOutputBuilder {
73 pub(crate) identifier: ::std::option::Option<::std::string::String>,
74 pub(crate) arn: ::std::option::Option<::std::string::String>,
75 pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
76 pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
77 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
78 pub(crate) witness_region: ::std::option::Option<::std::string::String>,
79 pub(crate) linked_cluster_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
80 _request_id: Option<String>,
81}
82impl UpdateClusterOutputBuilder {
83 pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.identifier = ::std::option::Option::Some(input.into());
87 self
88 }
89 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.identifier = input;
92 self
93 }
94 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
96 &self.identifier
97 }
98 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.arn = ::std::option::Option::Some(input.into());
102 self
103 }
104 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.arn = input;
107 self
108 }
109 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
111 &self.arn
112 }
113 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
116 self.status = ::std::option::Option::Some(input);
117 self
118 }
119 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
121 self.status = input;
122 self
123 }
124 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
126 &self.status
127 }
128 pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
131 self.creation_time = ::std::option::Option::Some(input);
132 self
133 }
134 pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
136 self.creation_time = input;
137 self
138 }
139 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
141 &self.creation_time
142 }
143 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
146 self.deletion_protection_enabled = ::std::option::Option::Some(input);
147 self
148 }
149 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
151 self.deletion_protection_enabled = input;
152 self
153 }
154 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
156 &self.deletion_protection_enabled
157 }
158 pub fn witness_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.witness_region = ::std::option::Option::Some(input.into());
161 self
162 }
163 pub fn set_witness_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.witness_region = input;
166 self
167 }
168 pub fn get_witness_region(&self) -> &::std::option::Option<::std::string::String> {
170 &self.witness_region
171 }
172 pub fn linked_cluster_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178 let mut v = self.linked_cluster_arns.unwrap_or_default();
179 v.push(input.into());
180 self.linked_cluster_arns = ::std::option::Option::Some(v);
181 self
182 }
183 pub fn set_linked_cluster_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
185 self.linked_cluster_arns = input;
186 self
187 }
188 pub fn get_linked_cluster_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
190 &self.linked_cluster_arns
191 }
192 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
193 self._request_id = Some(request_id.into());
194 self
195 }
196
197 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
198 self._request_id = request_id;
199 self
200 }
201 pub fn build(
209 self,
210 ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
211 ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterOutput {
212 identifier: self.identifier.ok_or_else(|| {
213 ::aws_smithy_types::error::operation::BuildError::missing_field(
214 "identifier",
215 "identifier was not specified but it is required when building UpdateClusterOutput",
216 )
217 })?,
218 arn: self.arn.ok_or_else(|| {
219 ::aws_smithy_types::error::operation::BuildError::missing_field(
220 "arn",
221 "arn was not specified but it is required when building UpdateClusterOutput",
222 )
223 })?,
224 status: self.status.ok_or_else(|| {
225 ::aws_smithy_types::error::operation::BuildError::missing_field(
226 "status",
227 "status was not specified but it is required when building UpdateClusterOutput",
228 )
229 })?,
230 creation_time: self.creation_time.ok_or_else(|| {
231 ::aws_smithy_types::error::operation::BuildError::missing_field(
232 "creation_time",
233 "creation_time was not specified but it is required when building UpdateClusterOutput",
234 )
235 })?,
236 deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
237 ::aws_smithy_types::error::operation::BuildError::missing_field(
238 "deletion_protection_enabled",
239 "deletion_protection_enabled was not specified but it is required when building UpdateClusterOutput",
240 )
241 })?,
242 witness_region: self.witness_region,
243 linked_cluster_arns: self.linked_cluster_arns,
244 _request_id: self._request_id,
245 })
246 }
247}