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