aws_sdk_dsql/operation/create_cluster/
_create_cluster_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateClusterOutput {
7 pub identifier: ::std::string::String,
9 pub arn: ::std::string::String,
11 pub status: crate::types::ClusterStatus,
13 pub creation_time: ::aws_smithy_types::DateTime,
15 pub deletion_protection_enabled: bool,
17 _request_id: Option<String>,
18}
19impl CreateClusterOutput {
20 pub fn identifier(&self) -> &str {
22 use std::ops::Deref;
23 self.identifier.deref()
24 }
25 pub fn arn(&self) -> &str {
27 use std::ops::Deref;
28 self.arn.deref()
29 }
30 pub fn status(&self) -> &crate::types::ClusterStatus {
32 &self.status
33 }
34 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
36 &self.creation_time
37 }
38 pub fn deletion_protection_enabled(&self) -> bool {
40 self.deletion_protection_enabled
41 }
42}
43impl ::aws_types::request_id::RequestId for CreateClusterOutput {
44 fn request_id(&self) -> Option<&str> {
45 self._request_id.as_deref()
46 }
47}
48impl CreateClusterOutput {
49 pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterOutputBuilder {
51 crate::operation::create_cluster::builders::CreateClusterOutputBuilder::default()
52 }
53}
54
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct CreateClusterOutputBuilder {
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 CreateClusterOutputBuilder {
67 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 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.identifier = input;
76 self
77 }
78 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
80 &self.identifier
81 }
82 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.arn = input;
91 self
92 }
93 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
95 &self.arn
96 }
97 pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
100 self.status = ::std::option::Option::Some(input);
101 self
102 }
103 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
105 self.status = input;
106 self
107 }
108 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
110 &self.status
111 }
112 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 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 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
125 &self.creation_time
126 }
127 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
130 self.deletion_protection_enabled = ::std::option::Option::Some(input);
131 self
132 }
133 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
135 self.deletion_protection_enabled = input;
136 self
137 }
138 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 pub fn build(
159 self,
160 ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
161 ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterOutput {
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 CreateClusterOutput",
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 CreateClusterOutput",
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 CreateClusterOutput",
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 CreateClusterOutput",
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 CreateClusterOutput",
190 )
191 })?,
192 _request_id: self._request_id,
193 })
194 }
195}