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