aws_sdk_dsql/operation/update_cluster/
_update_cluster_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Output Mixin
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateClusterOutput {
7    /// <p>The ID of the cluster to update.</p>
8    pub identifier: ::std::string::String,
9    /// <p>The ARN of the updated cluster.</p>
10    pub arn: ::std::string::String,
11    /// <p>The status of the updated cluster.</p>
12    pub status: crate::types::ClusterStatus,
13    /// <p>The time of when the cluster was created.</p>
14    pub creation_time: ::aws_smithy_types::DateTime,
15    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
16    pub deletion_protection_enabled: bool,
17    /// <p>The Region that receives all data you write to linked clusters.</p>
18    pub witness_region: ::std::option::Option<::std::string::String>,
19    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
20    pub linked_cluster_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21    _request_id: Option<String>,
22}
23impl UpdateClusterOutput {
24    /// <p>The ID of the cluster to update.</p>
25    pub fn identifier(&self) -> &str {
26        use std::ops::Deref;
27        self.identifier.deref()
28    }
29    /// <p>The ARN of the updated cluster.</p>
30    pub fn arn(&self) -> &str {
31        use std::ops::Deref;
32        self.arn.deref()
33    }
34    /// <p>The status of the updated cluster.</p>
35    pub fn status(&self) -> &crate::types::ClusterStatus {
36        &self.status
37    }
38    /// <p>The time of when the cluster was created.</p>
39    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
40        &self.creation_time
41    }
42    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
43    pub fn deletion_protection_enabled(&self) -> bool {
44        self.deletion_protection_enabled
45    }
46    /// <p>The Region that receives all data you write to linked clusters.</p>
47    pub fn witness_region(&self) -> ::std::option::Option<&str> {
48        self.witness_region.as_deref()
49    }
50    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
51    ///
52    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.linked_cluster_arns.is_none()`.
53    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    /// Creates a new builder-style object to manufacture [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
64    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterOutputBuilder {
65        crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::default()
66    }
67}
68
69/// A builder for [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
70#[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    /// <p>The ID of the cluster to update.</p>
84    /// This field is required.
85    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    /// <p>The ID of the cluster to update.</p>
90    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.identifier = input;
92        self
93    }
94    /// <p>The ID of the cluster to update.</p>
95    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
96        &self.identifier
97    }
98    /// <p>The ARN of the updated cluster.</p>
99    /// This field is required.
100    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    /// <p>The ARN of the updated cluster.</p>
105    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.arn = input;
107        self
108    }
109    /// <p>The ARN of the updated cluster.</p>
110    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
111        &self.arn
112    }
113    /// <p>The status of the updated cluster.</p>
114    /// This field is required.
115    pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
116        self.status = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>The status of the updated cluster.</p>
120    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
121        self.status = input;
122        self
123    }
124    /// <p>The status of the updated cluster.</p>
125    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
126        &self.status
127    }
128    /// <p>The time of when the cluster was created.</p>
129    /// This field is required.
130    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    /// <p>The time of when the cluster was created.</p>
135    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    /// <p>The time of when the cluster was created.</p>
140    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
141        &self.creation_time
142    }
143    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
144    /// This field is required.
145    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
146        self.deletion_protection_enabled = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
150    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
151        self.deletion_protection_enabled = input;
152        self
153    }
154    /// <p>Whether deletion protection is enabled for the updated cluster.</p>
155    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
156        &self.deletion_protection_enabled
157    }
158    /// <p>The Region that receives all data you write to linked clusters.</p>
159    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    /// <p>The Region that receives all data you write to linked clusters.</p>
164    pub fn set_witness_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.witness_region = input;
166        self
167    }
168    /// <p>The Region that receives all data you write to linked clusters.</p>
169    pub fn get_witness_region(&self) -> &::std::option::Option<::std::string::String> {
170        &self.witness_region
171    }
172    /// Appends an item to `linked_cluster_arns`.
173    ///
174    /// To override the contents of this collection use [`set_linked_cluster_arns`](Self::set_linked_cluster_arns).
175    ///
176    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
177    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    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
184    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    /// <p>The ARNs of the clusters linked to the updated cluster. Applicable only for multi-Region clusters.</p>
189    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    /// Consumes the builder and constructs a [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
202    /// This method will fail if any of the following fields are not set:
203    /// - [`identifier`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::identifier)
204    /// - [`arn`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::arn)
205    /// - [`status`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::status)
206    /// - [`creation_time`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::creation_time)
207    /// - [`deletion_protection_enabled`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::deletion_protection_enabled)
208    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}