aws_sdk_dsql/operation/delete_cluster/
_delete_cluster_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output from a deleted cluster.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteClusterOutput {
7    /// <p>The ID of the deleted cluster.</p>
8    pub identifier: ::std::string::String,
9    /// <p>The ARN of the deleted cluster.</p>
10    pub arn: ::std::string::String,
11    /// <p>The status of the 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>Specifies whether deletion protection was enabled on the cluster.</p>
16    #[deprecated(
17        note = "The deletionProtectionEnabled field is deprecated in the DeleteCluster API. To check deletion protection status, use the GetCluster API instead.",
18        since = "5/13/2025"
19    )]
20    pub deletion_protection_enabled: bool,
21    _request_id: Option<String>,
22}
23impl DeleteClusterOutput {
24    /// <p>The ID of the deleted cluster.</p>
25    pub fn identifier(&self) -> &str {
26        use std::ops::Deref;
27        self.identifier.deref()
28    }
29    /// <p>The ARN of the deleted cluster.</p>
30    pub fn arn(&self) -> &str {
31        use std::ops::Deref;
32        self.arn.deref()
33    }
34    /// <p>The status of the 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>Specifies whether deletion protection was enabled on the cluster.</p>
43    #[deprecated(
44        note = "The deletionProtectionEnabled field is deprecated in the DeleteCluster API. To check deletion protection status, use the GetCluster API instead.",
45        since = "5/13/2025"
46    )]
47    pub fn deletion_protection_enabled(&self) -> bool {
48        self.deletion_protection_enabled
49    }
50}
51impl ::aws_types::request_id::RequestId for DeleteClusterOutput {
52    fn request_id(&self) -> Option<&str> {
53        self._request_id.as_deref()
54    }
55}
56impl DeleteClusterOutput {
57    /// Creates a new builder-style object to manufacture [`DeleteClusterOutput`](crate::operation::delete_cluster::DeleteClusterOutput).
58    pub fn builder() -> crate::operation::delete_cluster::builders::DeleteClusterOutputBuilder {
59        crate::operation::delete_cluster::builders::DeleteClusterOutputBuilder::default()
60    }
61}
62
63/// A builder for [`DeleteClusterOutput`](crate::operation::delete_cluster::DeleteClusterOutput).
64#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct DeleteClusterOutputBuilder {
67    pub(crate) identifier: ::std::option::Option<::std::string::String>,
68    pub(crate) arn: ::std::option::Option<::std::string::String>,
69    pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
70    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
71    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
72    _request_id: Option<String>,
73}
74impl DeleteClusterOutputBuilder {
75    /// <p>The ID of the deleted cluster.</p>
76    /// This field is required.
77    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.identifier = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The ID of the deleted cluster.</p>
82    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.identifier = input;
84        self
85    }
86    /// <p>The ID of the deleted cluster.</p>
87    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
88        &self.identifier
89    }
90    /// <p>The ARN of the deleted cluster.</p>
91    /// This field is required.
92    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.arn = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The ARN of the deleted cluster.</p>
97    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.arn = input;
99        self
100    }
101    /// <p>The ARN of the deleted cluster.</p>
102    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
103        &self.arn
104    }
105    /// <p>The status of the cluster.</p>
106    /// This field is required.
107    pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
108        self.status = ::std::option::Option::Some(input);
109        self
110    }
111    /// <p>The status of the cluster.</p>
112    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
113        self.status = input;
114        self
115    }
116    /// <p>The status of the cluster.</p>
117    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
118        &self.status
119    }
120    /// <p>The time of when the cluster was created.</p>
121    /// This field is required.
122    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
123        self.creation_time = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The time of when the cluster was created.</p>
127    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
128        self.creation_time = input;
129        self
130    }
131    /// <p>The time of when the cluster was created.</p>
132    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
133        &self.creation_time
134    }
135    /// <p>Specifies whether deletion protection was enabled on the cluster.</p>
136    /// This field is required.
137    #[deprecated(
138        note = "The deletionProtectionEnabled field is deprecated in the DeleteCluster API. To check deletion protection status, use the GetCluster API instead.",
139        since = "5/13/2025"
140    )]
141    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
142        self.deletion_protection_enabled = ::std::option::Option::Some(input);
143        self
144    }
145    /// <p>Specifies whether deletion protection was enabled on the cluster.</p>
146    #[deprecated(
147        note = "The deletionProtectionEnabled field is deprecated in the DeleteCluster API. To check deletion protection status, use the GetCluster API instead.",
148        since = "5/13/2025"
149    )]
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>Specifies whether deletion protection was enabled on the cluster.</p>
155    #[deprecated(
156        note = "The deletionProtectionEnabled field is deprecated in the DeleteCluster API. To check deletion protection status, use the GetCluster API instead.",
157        since = "5/13/2025"
158    )]
159    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
160        &self.deletion_protection_enabled
161    }
162    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
163        self._request_id = Some(request_id.into());
164        self
165    }
166
167    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
168        self._request_id = request_id;
169        self
170    }
171    /// Consumes the builder and constructs a [`DeleteClusterOutput`](crate::operation::delete_cluster::DeleteClusterOutput).
172    /// This method will fail if any of the following fields are not set:
173    /// - [`identifier`](crate::operation::delete_cluster::builders::DeleteClusterOutputBuilder::identifier)
174    /// - [`arn`](crate::operation::delete_cluster::builders::DeleteClusterOutputBuilder::arn)
175    /// - [`status`](crate::operation::delete_cluster::builders::DeleteClusterOutputBuilder::status)
176    /// - [`creation_time`](crate::operation::delete_cluster::builders::DeleteClusterOutputBuilder::creation_time)
177    /// - [`deletion_protection_enabled`](crate::operation::delete_cluster::builders::DeleteClusterOutputBuilder::deletion_protection_enabled)
178    pub fn build(
179        self,
180    ) -> ::std::result::Result<crate::operation::delete_cluster::DeleteClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
181        ::std::result::Result::Ok(crate::operation::delete_cluster::DeleteClusterOutput {
182            identifier: self.identifier.ok_or_else(|| {
183                ::aws_smithy_types::error::operation::BuildError::missing_field(
184                    "identifier",
185                    "identifier was not specified but it is required when building DeleteClusterOutput",
186                )
187            })?,
188            arn: self.arn.ok_or_else(|| {
189                ::aws_smithy_types::error::operation::BuildError::missing_field(
190                    "arn",
191                    "arn was not specified but it is required when building DeleteClusterOutput",
192                )
193            })?,
194            status: self.status.ok_or_else(|| {
195                ::aws_smithy_types::error::operation::BuildError::missing_field(
196                    "status",
197                    "status was not specified but it is required when building DeleteClusterOutput",
198                )
199            })?,
200            creation_time: self.creation_time.ok_or_else(|| {
201                ::aws_smithy_types::error::operation::BuildError::missing_field(
202                    "creation_time",
203                    "creation_time was not specified but it is required when building DeleteClusterOutput",
204                )
205            })?,
206            deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
207                ::aws_smithy_types::error::operation::BuildError::missing_field(
208                    "deletion_protection_enabled",
209                    "deletion_protection_enabled was not specified but it is required when building DeleteClusterOutput",
210                )
211            })?,
212            _request_id: self._request_id,
213        })
214    }
215}