aws_sdk_dsql/operation/create_cluster/
_create_cluster_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output of a created cluster.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateClusterOutput {
7    /// <p>The ID of the created cluster.</p>
8    pub identifier: ::std::string::String,
9    /// <p>The ARN of the created cluster.</p>
10    pub arn: ::std::string::String,
11    /// <p>The status of the created cluster.</p>
12    pub status: crate::types::ClusterStatus,
13    /// <p>The time of when created the cluster.</p>
14    pub creation_time: ::aws_smithy_types::DateTime,
15    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
16    pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
17    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
18    pub encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
19    /// <p>Whether deletion protection is enabled on this cluster.</p>
20    pub deletion_protection_enabled: bool,
21    _request_id: Option<String>,
22}
23impl CreateClusterOutput {
24    /// <p>The ID of the created cluster.</p>
25    pub fn identifier(&self) -> &str {
26        use std::ops::Deref;
27        self.identifier.deref()
28    }
29    /// <p>The ARN of the created cluster.</p>
30    pub fn arn(&self) -> &str {
31        use std::ops::Deref;
32        self.arn.deref()
33    }
34    /// <p>The status of the created cluster.</p>
35    pub fn status(&self) -> &crate::types::ClusterStatus {
36        &self.status
37    }
38    /// <p>The time of when created the cluster.</p>
39    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
40        &self.creation_time
41    }
42    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
43    pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
44        self.multi_region_properties.as_ref()
45    }
46    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
47    pub fn encryption_details(&self) -> ::std::option::Option<&crate::types::EncryptionDetails> {
48        self.encryption_details.as_ref()
49    }
50    /// <p>Whether deletion protection is enabled on this cluster.</p>
51    pub fn deletion_protection_enabled(&self) -> bool {
52        self.deletion_protection_enabled
53    }
54}
55impl ::aws_types::request_id::RequestId for CreateClusterOutput {
56    fn request_id(&self) -> Option<&str> {
57        self._request_id.as_deref()
58    }
59}
60impl CreateClusterOutput {
61    /// Creates a new builder-style object to manufacture [`CreateClusterOutput`](crate::operation::create_cluster::CreateClusterOutput).
62    pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterOutputBuilder {
63        crate::operation::create_cluster::builders::CreateClusterOutputBuilder::default()
64    }
65}
66
67/// A builder for [`CreateClusterOutput`](crate::operation::create_cluster::CreateClusterOutput).
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct CreateClusterOutputBuilder {
71    pub(crate) identifier: ::std::option::Option<::std::string::String>,
72    pub(crate) arn: ::std::option::Option<::std::string::String>,
73    pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
74    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
75    pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
76    pub(crate) encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
77    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
78    _request_id: Option<String>,
79}
80impl CreateClusterOutputBuilder {
81    /// <p>The ID of the created cluster.</p>
82    /// This field is required.
83    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.identifier = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The ID of the created cluster.</p>
88    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.identifier = input;
90        self
91    }
92    /// <p>The ID of the created cluster.</p>
93    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
94        &self.identifier
95    }
96    /// <p>The ARN of the created cluster.</p>
97    /// This field is required.
98    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.arn = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The ARN of the created cluster.</p>
103    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.arn = input;
105        self
106    }
107    /// <p>The ARN of the created cluster.</p>
108    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
109        &self.arn
110    }
111    /// <p>The status of the created cluster.</p>
112    /// This field is required.
113    pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
114        self.status = ::std::option::Option::Some(input);
115        self
116    }
117    /// <p>The status of the created cluster.</p>
118    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
119        self.status = input;
120        self
121    }
122    /// <p>The status of the created cluster.</p>
123    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
124        &self.status
125    }
126    /// <p>The time of when created the cluster.</p>
127    /// This field is required.
128    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
129        self.creation_time = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>The time of when created the cluster.</p>
133    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
134        self.creation_time = input;
135        self
136    }
137    /// <p>The time of when created the cluster.</p>
138    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
139        &self.creation_time
140    }
141    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
142    pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
143        self.multi_region_properties = ::std::option::Option::Some(input);
144        self
145    }
146    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
147    pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
148        self.multi_region_properties = input;
149        self
150    }
151    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
152    pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
153        &self.multi_region_properties
154    }
155    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
156    pub fn encryption_details(mut self, input: crate::types::EncryptionDetails) -> Self {
157        self.encryption_details = ::std::option::Option::Some(input);
158        self
159    }
160    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
161    pub fn set_encryption_details(mut self, input: ::std::option::Option<crate::types::EncryptionDetails>) -> Self {
162        self.encryption_details = input;
163        self
164    }
165    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
166    pub fn get_encryption_details(&self) -> &::std::option::Option<crate::types::EncryptionDetails> {
167        &self.encryption_details
168    }
169    /// <p>Whether deletion protection is enabled on this cluster.</p>
170    /// This field is required.
171    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
172        self.deletion_protection_enabled = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>Whether deletion protection is enabled on this cluster.</p>
176    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
177        self.deletion_protection_enabled = input;
178        self
179    }
180    /// <p>Whether deletion protection is enabled on this cluster.</p>
181    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
182        &self.deletion_protection_enabled
183    }
184    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
185        self._request_id = Some(request_id.into());
186        self
187    }
188
189    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
190        self._request_id = request_id;
191        self
192    }
193    /// Consumes the builder and constructs a [`CreateClusterOutput`](crate::operation::create_cluster::CreateClusterOutput).
194    /// This method will fail if any of the following fields are not set:
195    /// - [`identifier`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::identifier)
196    /// - [`arn`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::arn)
197    /// - [`status`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::status)
198    /// - [`creation_time`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::creation_time)
199    /// - [`deletion_protection_enabled`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::deletion_protection_enabled)
200    pub fn build(
201        self,
202    ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
203        ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterOutput {
204            identifier: self.identifier.ok_or_else(|| {
205                ::aws_smithy_types::error::operation::BuildError::missing_field(
206                    "identifier",
207                    "identifier was not specified but it is required when building CreateClusterOutput",
208                )
209            })?,
210            arn: self.arn.ok_or_else(|| {
211                ::aws_smithy_types::error::operation::BuildError::missing_field(
212                    "arn",
213                    "arn was not specified but it is required when building CreateClusterOutput",
214                )
215            })?,
216            status: self.status.ok_or_else(|| {
217                ::aws_smithy_types::error::operation::BuildError::missing_field(
218                    "status",
219                    "status was not specified but it is required when building CreateClusterOutput",
220                )
221            })?,
222            creation_time: self.creation_time.ok_or_else(|| {
223                ::aws_smithy_types::error::operation::BuildError::missing_field(
224                    "creation_time",
225                    "creation_time was not specified but it is required when building CreateClusterOutput",
226                )
227            })?,
228            multi_region_properties: self.multi_region_properties,
229            encryption_details: self.encryption_details,
230            deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
231                ::aws_smithy_types::error::operation::BuildError::missing_field(
232                    "deletion_protection_enabled",
233                    "deletion_protection_enabled was not specified but it is required when building CreateClusterOutput",
234                )
235            })?,
236            _request_id: self._request_id,
237        })
238    }
239}