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