aws_sdk_dsql/operation/create_stream/
_create_stream_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateStreamOutput {
7 pub cluster_identifier: ::std::string::String,
9 pub stream_identifier: ::std::string::String,
11 pub arn: ::std::string::String,
13 pub status: crate::types::StreamStatus,
15 pub creation_time: ::aws_smithy_types::DateTime,
17 pub ordering: crate::types::StreamOrdering,
19 pub format: crate::types::StreamFormat,
21 _request_id: Option<String>,
22}
23impl CreateStreamOutput {
24 pub fn cluster_identifier(&self) -> &str {
26 use std::ops::Deref;
27 self.cluster_identifier.deref()
28 }
29 pub fn stream_identifier(&self) -> &str {
31 use std::ops::Deref;
32 self.stream_identifier.deref()
33 }
34 pub fn arn(&self) -> &str {
36 use std::ops::Deref;
37 self.arn.deref()
38 }
39 pub fn status(&self) -> &crate::types::StreamStatus {
41 &self.status
42 }
43 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
45 &self.creation_time
46 }
47 pub fn ordering(&self) -> &crate::types::StreamOrdering {
49 &self.ordering
50 }
51 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 pub fn builder() -> crate::operation::create_stream::builders::CreateStreamOutputBuilder {
64 crate::operation::create_stream::builders::CreateStreamOutputBuilder::default()
65 }
66}
67
68#[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 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 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.cluster_identifier = input;
91 self
92 }
93 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
95 &self.cluster_identifier
96 }
97 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 pub fn set_stream_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105 self.stream_identifier = input;
106 self
107 }
108 pub fn get_stream_identifier(&self) -> &::std::option::Option<::std::string::String> {
110 &self.stream_identifier
111 }
112 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.arn = input;
121 self
122 }
123 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
125 &self.arn
126 }
127 pub fn status(mut self, input: crate::types::StreamStatus) -> Self {
130 self.status = ::std::option::Option::Some(input);
131 self
132 }
133 pub fn set_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
135 self.status = input;
136 self
137 }
138 pub fn get_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
140 &self.status
141 }
142 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 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 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
155 &self.creation_time
156 }
157 pub fn ordering(mut self, input: crate::types::StreamOrdering) -> Self {
160 self.ordering = ::std::option::Option::Some(input);
161 self
162 }
163 pub fn set_ordering(mut self, input: ::std::option::Option<crate::types::StreamOrdering>) -> Self {
165 self.ordering = input;
166 self
167 }
168 pub fn get_ordering(&self) -> &::std::option::Option<crate::types::StreamOrdering> {
170 &self.ordering
171 }
172 pub fn format(mut self, input: crate::types::StreamFormat) -> Self {
175 self.format = ::std::option::Option::Some(input);
176 self
177 }
178 pub fn set_format(mut self, input: ::std::option::Option<crate::types::StreamFormat>) -> Self {
180 self.format = input;
181 self
182 }
183 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 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}