Skip to main content

aws_sdk_dsql/operation/get_stream/
_get_stream_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output of a retrieved stream.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetStreamOutput {
7    /// <p>The ID of the cluster for the retrieved stream.</p>
8    pub cluster_identifier: ::std::string::String,
9    /// <p>The ID of the retrieved stream.</p>
10    pub stream_identifier: ::std::string::String,
11    /// <p>The ARN of the retrieved stream.</p>
12    pub arn: ::std::string::String,
13    /// <p>The current status of the retrieved 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    /// <p>The ordering mode of the stream.</p>
18    pub ordering: crate::types::StreamOrdering,
19    /// <p>The format of the stream records.</p>
20    pub format: crate::types::StreamFormat,
21    /// <p>The target definition for the stream destination.</p>
22    pub target_definition: ::std::option::Option<crate::types::TargetDefinition>,
23    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
24    pub status_reason: ::std::option::Option<crate::types::StatusReason>,
25    /// <p>A map of tags associated with the stream.</p>
26    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
27    _request_id: Option<String>,
28}
29impl GetStreamOutput {
30    /// <p>The ID of the cluster for the retrieved stream.</p>
31    pub fn cluster_identifier(&self) -> &str {
32        use std::ops::Deref;
33        self.cluster_identifier.deref()
34    }
35    /// <p>The ID of the retrieved stream.</p>
36    pub fn stream_identifier(&self) -> &str {
37        use std::ops::Deref;
38        self.stream_identifier.deref()
39    }
40    /// <p>The ARN of the retrieved stream.</p>
41    pub fn arn(&self) -> &str {
42        use std::ops::Deref;
43        self.arn.deref()
44    }
45    /// <p>The current status of the retrieved stream.</p>
46    pub fn status(&self) -> &crate::types::StreamStatus {
47        &self.status
48    }
49    /// <p>The time when the stream was created.</p>
50    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
51        &self.creation_time
52    }
53    /// <p>The ordering mode of the stream.</p>
54    pub fn ordering(&self) -> &crate::types::StreamOrdering {
55        &self.ordering
56    }
57    /// <p>The format of the stream records.</p>
58    pub fn format(&self) -> &crate::types::StreamFormat {
59        &self.format
60    }
61    /// <p>The target definition for the stream destination.</p>
62    pub fn target_definition(&self) -> ::std::option::Option<&crate::types::TargetDefinition> {
63        self.target_definition.as_ref()
64    }
65    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
66    pub fn status_reason(&self) -> ::std::option::Option<&crate::types::StatusReason> {
67        self.status_reason.as_ref()
68    }
69    /// <p>A map of tags associated with the stream.</p>
70    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
71        self.tags.as_ref()
72    }
73}
74impl ::aws_types::request_id::RequestId for GetStreamOutput {
75    fn request_id(&self) -> Option<&str> {
76        self._request_id.as_deref()
77    }
78}
79impl GetStreamOutput {
80    /// Creates a new builder-style object to manufacture [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
81    pub fn builder() -> crate::operation::get_stream::builders::GetStreamOutputBuilder {
82        crate::operation::get_stream::builders::GetStreamOutputBuilder::default()
83    }
84}
85
86/// A builder for [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
88#[non_exhaustive]
89pub struct GetStreamOutputBuilder {
90    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
91    pub(crate) stream_identifier: ::std::option::Option<::std::string::String>,
92    pub(crate) arn: ::std::option::Option<::std::string::String>,
93    pub(crate) status: ::std::option::Option<crate::types::StreamStatus>,
94    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
95    pub(crate) ordering: ::std::option::Option<crate::types::StreamOrdering>,
96    pub(crate) format: ::std::option::Option<crate::types::StreamFormat>,
97    pub(crate) target_definition: ::std::option::Option<crate::types::TargetDefinition>,
98    pub(crate) status_reason: ::std::option::Option<crate::types::StatusReason>,
99    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
100    _request_id: Option<String>,
101}
102impl GetStreamOutputBuilder {
103    /// <p>The ID of the cluster for the retrieved stream.</p>
104    /// This field is required.
105    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.cluster_identifier = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The ID of the cluster for the retrieved stream.</p>
110    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.cluster_identifier = input;
112        self
113    }
114    /// <p>The ID of the cluster for the retrieved stream.</p>
115    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
116        &self.cluster_identifier
117    }
118    /// <p>The ID of the retrieved stream.</p>
119    /// This field is required.
120    pub fn stream_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.stream_identifier = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The ID of the retrieved stream.</p>
125    pub fn set_stream_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.stream_identifier = input;
127        self
128    }
129    /// <p>The ID of the retrieved stream.</p>
130    pub fn get_stream_identifier(&self) -> &::std::option::Option<::std::string::String> {
131        &self.stream_identifier
132    }
133    /// <p>The ARN of the retrieved stream.</p>
134    /// This field is required.
135    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.arn = ::std::option::Option::Some(input.into());
137        self
138    }
139    /// <p>The ARN of the retrieved stream.</p>
140    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.arn = input;
142        self
143    }
144    /// <p>The ARN of the retrieved stream.</p>
145    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
146        &self.arn
147    }
148    /// <p>The current status of the retrieved stream.</p>
149    /// This field is required.
150    pub fn status(mut self, input: crate::types::StreamStatus) -> Self {
151        self.status = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>The current status of the retrieved stream.</p>
155    pub fn set_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
156        self.status = input;
157        self
158    }
159    /// <p>The current status of the retrieved stream.</p>
160    pub fn get_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
161        &self.status
162    }
163    /// <p>The time when the stream was created.</p>
164    /// This field is required.
165    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
166        self.creation_time = ::std::option::Option::Some(input);
167        self
168    }
169    /// <p>The time when the stream was created.</p>
170    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
171        self.creation_time = input;
172        self
173    }
174    /// <p>The time when the stream was created.</p>
175    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
176        &self.creation_time
177    }
178    /// <p>The ordering mode of the stream.</p>
179    /// This field is required.
180    pub fn ordering(mut self, input: crate::types::StreamOrdering) -> Self {
181        self.ordering = ::std::option::Option::Some(input);
182        self
183    }
184    /// <p>The ordering mode of the stream.</p>
185    pub fn set_ordering(mut self, input: ::std::option::Option<crate::types::StreamOrdering>) -> Self {
186        self.ordering = input;
187        self
188    }
189    /// <p>The ordering mode of the stream.</p>
190    pub fn get_ordering(&self) -> &::std::option::Option<crate::types::StreamOrdering> {
191        &self.ordering
192    }
193    /// <p>The format of the stream records.</p>
194    /// This field is required.
195    pub fn format(mut self, input: crate::types::StreamFormat) -> Self {
196        self.format = ::std::option::Option::Some(input);
197        self
198    }
199    /// <p>The format of the stream records.</p>
200    pub fn set_format(mut self, input: ::std::option::Option<crate::types::StreamFormat>) -> Self {
201        self.format = input;
202        self
203    }
204    /// <p>The format of the stream records.</p>
205    pub fn get_format(&self) -> &::std::option::Option<crate::types::StreamFormat> {
206        &self.format
207    }
208    /// <p>The target definition for the stream destination.</p>
209    pub fn target_definition(mut self, input: crate::types::TargetDefinition) -> Self {
210        self.target_definition = ::std::option::Option::Some(input);
211        self
212    }
213    /// <p>The target definition for the stream destination.</p>
214    pub fn set_target_definition(mut self, input: ::std::option::Option<crate::types::TargetDefinition>) -> Self {
215        self.target_definition = input;
216        self
217    }
218    /// <p>The target definition for the stream destination.</p>
219    pub fn get_target_definition(&self) -> &::std::option::Option<crate::types::TargetDefinition> {
220        &self.target_definition
221    }
222    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
223    pub fn status_reason(mut self, input: crate::types::StatusReason) -> Self {
224        self.status_reason = ::std::option::Option::Some(input);
225        self
226    }
227    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
228    pub fn set_status_reason(mut self, input: ::std::option::Option<crate::types::StatusReason>) -> Self {
229        self.status_reason = input;
230        self
231    }
232    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
233    pub fn get_status_reason(&self) -> &::std::option::Option<crate::types::StatusReason> {
234        &self.status_reason
235    }
236    /// Adds a key-value pair to `tags`.
237    ///
238    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
239    ///
240    /// <p>A map of tags associated with the stream.</p>
241    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
242        let mut hash_map = self.tags.unwrap_or_default();
243        hash_map.insert(k.into(), v.into());
244        self.tags = ::std::option::Option::Some(hash_map);
245        self
246    }
247    /// <p>A map of tags associated with the stream.</p>
248    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
249        self.tags = input;
250        self
251    }
252    /// <p>A map of tags associated with the stream.</p>
253    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
254        &self.tags
255    }
256    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
257        self._request_id = Some(request_id.into());
258        self
259    }
260
261    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
262        self._request_id = request_id;
263        self
264    }
265    /// Consumes the builder and constructs a [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
266    /// This method will fail if any of the following fields are not set:
267    /// - [`cluster_identifier`](crate::operation::get_stream::builders::GetStreamOutputBuilder::cluster_identifier)
268    /// - [`stream_identifier`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_identifier)
269    /// - [`arn`](crate::operation::get_stream::builders::GetStreamOutputBuilder::arn)
270    /// - [`status`](crate::operation::get_stream::builders::GetStreamOutputBuilder::status)
271    /// - [`creation_time`](crate::operation::get_stream::builders::GetStreamOutputBuilder::creation_time)
272    /// - [`ordering`](crate::operation::get_stream::builders::GetStreamOutputBuilder::ordering)
273    /// - [`format`](crate::operation::get_stream::builders::GetStreamOutputBuilder::format)
274    pub fn build(self) -> ::std::result::Result<crate::operation::get_stream::GetStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
275        ::std::result::Result::Ok(crate::operation::get_stream::GetStreamOutput {
276            cluster_identifier: self.cluster_identifier.ok_or_else(|| {
277                ::aws_smithy_types::error::operation::BuildError::missing_field(
278                    "cluster_identifier",
279                    "cluster_identifier was not specified but it is required when building GetStreamOutput",
280                )
281            })?,
282            stream_identifier: self.stream_identifier.ok_or_else(|| {
283                ::aws_smithy_types::error::operation::BuildError::missing_field(
284                    "stream_identifier",
285                    "stream_identifier was not specified but it is required when building GetStreamOutput",
286                )
287            })?,
288            arn: self.arn.ok_or_else(|| {
289                ::aws_smithy_types::error::operation::BuildError::missing_field(
290                    "arn",
291                    "arn was not specified but it is required when building GetStreamOutput",
292                )
293            })?,
294            status: self.status.ok_or_else(|| {
295                ::aws_smithy_types::error::operation::BuildError::missing_field(
296                    "status",
297                    "status was not specified but it is required when building GetStreamOutput",
298                )
299            })?,
300            creation_time: self.creation_time.ok_or_else(|| {
301                ::aws_smithy_types::error::operation::BuildError::missing_field(
302                    "creation_time",
303                    "creation_time was not specified but it is required when building GetStreamOutput",
304                )
305            })?,
306            ordering: self.ordering.ok_or_else(|| {
307                ::aws_smithy_types::error::operation::BuildError::missing_field(
308                    "ordering",
309                    "ordering was not specified but it is required when building GetStreamOutput",
310                )
311            })?,
312            format: self.format.ok_or_else(|| {
313                ::aws_smithy_types::error::operation::BuildError::missing_field(
314                    "format",
315                    "format was not specified but it is required when building GetStreamOutput",
316                )
317            })?,
318            target_definition: self.target_definition,
319            status_reason: self.status_reason,
320            tags: self.tags,
321            _request_id: self._request_id,
322        })
323    }
324}