Skip to main content

aws_sdk_dsql/operation/create_stream/
_create_stream_output.rs

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