aws_sdk_dsql/operation/update_cluster/
_update_cluster_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The details of the cluster after it has been updated.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateClusterOutput {
7    /// <p>The ID of the cluster to update.</p>
8    pub identifier: ::std::string::String,
9    /// <p>The ARN of the updated cluster.</p>
10    pub arn: ::std::string::String,
11    /// <p>The status of the updated 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    _request_id: Option<String>,
16}
17impl UpdateClusterOutput {
18    /// <p>The ID of the cluster to update.</p>
19    pub fn identifier(&self) -> &str {
20        use std::ops::Deref;
21        self.identifier.deref()
22    }
23    /// <p>The ARN of the updated cluster.</p>
24    pub fn arn(&self) -> &str {
25        use std::ops::Deref;
26        self.arn.deref()
27    }
28    /// <p>The status of the updated cluster.</p>
29    pub fn status(&self) -> &crate::types::ClusterStatus {
30        &self.status
31    }
32    /// <p>The time of when the cluster was created.</p>
33    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
34        &self.creation_time
35    }
36}
37impl ::aws_types::request_id::RequestId for UpdateClusterOutput {
38    fn request_id(&self) -> Option<&str> {
39        self._request_id.as_deref()
40    }
41}
42impl UpdateClusterOutput {
43    /// Creates a new builder-style object to manufacture [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
44    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterOutputBuilder {
45        crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::default()
46    }
47}
48
49/// A builder for [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct UpdateClusterOutputBuilder {
53    pub(crate) identifier: ::std::option::Option<::std::string::String>,
54    pub(crate) arn: ::std::option::Option<::std::string::String>,
55    pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
56    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
57    _request_id: Option<String>,
58}
59impl UpdateClusterOutputBuilder {
60    /// <p>The ID of the cluster to update.</p>
61    /// This field is required.
62    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.identifier = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The ID of the cluster to update.</p>
67    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.identifier = input;
69        self
70    }
71    /// <p>The ID of the cluster to update.</p>
72    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
73        &self.identifier
74    }
75    /// <p>The ARN of the updated cluster.</p>
76    /// This field is required.
77    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.arn = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The ARN of the updated cluster.</p>
82    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.arn = input;
84        self
85    }
86    /// <p>The ARN of the updated cluster.</p>
87    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
88        &self.arn
89    }
90    /// <p>The status of the updated cluster.</p>
91    /// This field is required.
92    pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
93        self.status = ::std::option::Option::Some(input);
94        self
95    }
96    /// <p>The status of the updated cluster.</p>
97    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
98        self.status = input;
99        self
100    }
101    /// <p>The status of the updated cluster.</p>
102    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
103        &self.status
104    }
105    /// <p>The time of when the cluster was created.</p>
106    /// This field is required.
107    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
108        self.creation_time = ::std::option::Option::Some(input);
109        self
110    }
111    /// <p>The time of when the cluster was created.</p>
112    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
113        self.creation_time = input;
114        self
115    }
116    /// <p>The time of when the cluster was created.</p>
117    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
118        &self.creation_time
119    }
120    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
121        self._request_id = Some(request_id.into());
122        self
123    }
124
125    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
126        self._request_id = request_id;
127        self
128    }
129    /// Consumes the builder and constructs a [`UpdateClusterOutput`](crate::operation::update_cluster::UpdateClusterOutput).
130    /// This method will fail if any of the following fields are not set:
131    /// - [`identifier`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::identifier)
132    /// - [`arn`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::arn)
133    /// - [`status`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::status)
134    /// - [`creation_time`](crate::operation::update_cluster::builders::UpdateClusterOutputBuilder::creation_time)
135    pub fn build(
136        self,
137    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
138        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterOutput {
139            identifier: self.identifier.ok_or_else(|| {
140                ::aws_smithy_types::error::operation::BuildError::missing_field(
141                    "identifier",
142                    "identifier was not specified but it is required when building UpdateClusterOutput",
143                )
144            })?,
145            arn: self.arn.ok_or_else(|| {
146                ::aws_smithy_types::error::operation::BuildError::missing_field(
147                    "arn",
148                    "arn was not specified but it is required when building UpdateClusterOutput",
149                )
150            })?,
151            status: self.status.ok_or_else(|| {
152                ::aws_smithy_types::error::operation::BuildError::missing_field(
153                    "status",
154                    "status was not specified but it is required when building UpdateClusterOutput",
155                )
156            })?,
157            creation_time: self.creation_time.ok_or_else(|| {
158                ::aws_smithy_types::error::operation::BuildError::missing_field(
159                    "creation_time",
160                    "creation_time was not specified but it is required when building UpdateClusterOutput",
161                )
162            })?,
163            _request_id: self._request_id,
164        })
165    }
166}