Skip to main content

aws_sdk_dsql/operation/delete_stream/
_delete_stream_output.rs

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