aws_sdk_dsql/operation/get_stream/
_get_stream_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetStreamOutput {
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 pub target_definition: ::std::option::Option<crate::types::TargetDefinition>,
23 pub status_reason: ::std::option::Option<crate::types::StatusReason>,
25 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
27 _request_id: Option<String>,
28}
29impl GetStreamOutput {
30 pub fn cluster_identifier(&self) -> &str {
32 use std::ops::Deref;
33 self.cluster_identifier.deref()
34 }
35 pub fn stream_identifier(&self) -> &str {
37 use std::ops::Deref;
38 self.stream_identifier.deref()
39 }
40 pub fn arn(&self) -> &str {
42 use std::ops::Deref;
43 self.arn.deref()
44 }
45 pub fn status(&self) -> &crate::types::StreamStatus {
47 &self.status
48 }
49 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
51 &self.creation_time
52 }
53 pub fn ordering(&self) -> &crate::types::StreamOrdering {
55 &self.ordering
56 }
57 pub fn format(&self) -> &crate::types::StreamFormat {
59 &self.format
60 }
61 pub fn target_definition(&self) -> ::std::option::Option<&crate::types::TargetDefinition> {
63 self.target_definition.as_ref()
64 }
65 pub fn status_reason(&self) -> ::std::option::Option<&crate::types::StatusReason> {
67 self.status_reason.as_ref()
68 }
69 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 pub fn builder() -> crate::operation::get_stream::builders::GetStreamOutputBuilder {
82 crate::operation::get_stream::builders::GetStreamOutputBuilder::default()
83 }
84}
85
86#[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 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 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.cluster_identifier = input;
112 self
113 }
114 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
116 &self.cluster_identifier
117 }
118 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 pub fn set_stream_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.stream_identifier = input;
127 self
128 }
129 pub fn get_stream_identifier(&self) -> &::std::option::Option<::std::string::String> {
131 &self.stream_identifier
132 }
133 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.arn = input;
142 self
143 }
144 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
146 &self.arn
147 }
148 pub fn status(mut self, input: crate::types::StreamStatus) -> Self {
151 self.status = ::std::option::Option::Some(input);
152 self
153 }
154 pub fn set_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
156 self.status = input;
157 self
158 }
159 pub fn get_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
161 &self.status
162 }
163 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 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 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
176 &self.creation_time
177 }
178 pub fn ordering(mut self, input: crate::types::StreamOrdering) -> Self {
181 self.ordering = ::std::option::Option::Some(input);
182 self
183 }
184 pub fn set_ordering(mut self, input: ::std::option::Option<crate::types::StreamOrdering>) -> Self {
186 self.ordering = input;
187 self
188 }
189 pub fn get_ordering(&self) -> &::std::option::Option<crate::types::StreamOrdering> {
191 &self.ordering
192 }
193 pub fn format(mut self, input: crate::types::StreamFormat) -> Self {
196 self.format = ::std::option::Option::Some(input);
197 self
198 }
199 pub fn set_format(mut self, input: ::std::option::Option<crate::types::StreamFormat>) -> Self {
201 self.format = input;
202 self
203 }
204 pub fn get_format(&self) -> &::std::option::Option<crate::types::StreamFormat> {
206 &self.format
207 }
208 pub fn target_definition(mut self, input: crate::types::TargetDefinition) -> Self {
210 self.target_definition = ::std::option::Option::Some(input);
211 self
212 }
213 pub fn set_target_definition(mut self, input: ::std::option::Option<crate::types::TargetDefinition>) -> Self {
215 self.target_definition = input;
216 self
217 }
218 pub fn get_target_definition(&self) -> &::std::option::Option<crate::types::TargetDefinition> {
220 &self.target_definition
221 }
222 pub fn status_reason(mut self, input: crate::types::StatusReason) -> Self {
224 self.status_reason = ::std::option::Option::Some(input);
225 self
226 }
227 pub fn set_status_reason(mut self, input: ::std::option::Option<crate::types::StatusReason>) -> Self {
229 self.status_reason = input;
230 self
231 }
232 pub fn get_status_reason(&self) -> &::std::option::Option<crate::types::StatusReason> {
234 &self.status_reason
235 }
236 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 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 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 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}