aws_sdk_keyspacesstreams/operation/get_stream/_get_stream_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetStreamOutput {
6 /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
7 pub stream_arn: ::std::string::String,
8 /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
9 pub stream_label: ::std::string::String,
10 /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
11 pub stream_status: crate::types::StreamStatus,
12 /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
13 /// <ul>
14 /// <li>
15 /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
16 /// <li>
17 /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
18 /// <li>
19 /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
20 /// <li>
21 /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
22 /// </ul>
23 pub stream_view_type: crate::types::StreamViewType,
24 /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
25 pub creation_request_date_time: ::aws_smithy_types::DateTime,
26 /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
27 pub keyspace_name: ::std::string::String,
28 /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
29 pub table_name: ::std::string::String,
30 /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
31 pub shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
32 /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
33 pub next_token: ::std::option::Option<::std::string::String>,
34 _request_id: Option<String>,
35}
36impl GetStreamOutput {
37 /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
38 pub fn stream_arn(&self) -> &str {
39 use std::ops::Deref;
40 self.stream_arn.deref()
41 }
42 /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
43 pub fn stream_label(&self) -> &str {
44 use std::ops::Deref;
45 self.stream_label.deref()
46 }
47 /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
48 pub fn stream_status(&self) -> &crate::types::StreamStatus {
49 &self.stream_status
50 }
51 /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
52 /// <ul>
53 /// <li>
54 /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
55 /// <li>
56 /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
57 /// <li>
58 /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
59 /// <li>
60 /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
61 /// </ul>
62 pub fn stream_view_type(&self) -> &crate::types::StreamViewType {
63 &self.stream_view_type
64 }
65 /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
66 pub fn creation_request_date_time(&self) -> &::aws_smithy_types::DateTime {
67 &self.creation_request_date_time
68 }
69 /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
70 pub fn keyspace_name(&self) -> &str {
71 use std::ops::Deref;
72 self.keyspace_name.deref()
73 }
74 /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
75 pub fn table_name(&self) -> &str {
76 use std::ops::Deref;
77 self.table_name.deref()
78 }
79 /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
80 ///
81 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.shards.is_none()`.
82 pub fn shards(&self) -> &[crate::types::Shard] {
83 self.shards.as_deref().unwrap_or_default()
84 }
85 /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
86 pub fn next_token(&self) -> ::std::option::Option<&str> {
87 self.next_token.as_deref()
88 }
89}
90impl ::aws_types::request_id::RequestId for GetStreamOutput {
91 fn request_id(&self) -> Option<&str> {
92 self._request_id.as_deref()
93 }
94}
95impl GetStreamOutput {
96 /// Creates a new builder-style object to manufacture [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
97 pub fn builder() -> crate::operation::get_stream::builders::GetStreamOutputBuilder {
98 crate::operation::get_stream::builders::GetStreamOutputBuilder::default()
99 }
100}
101
102/// A builder for [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
104#[non_exhaustive]
105pub struct GetStreamOutputBuilder {
106 pub(crate) stream_arn: ::std::option::Option<::std::string::String>,
107 pub(crate) stream_label: ::std::option::Option<::std::string::String>,
108 pub(crate) stream_status: ::std::option::Option<crate::types::StreamStatus>,
109 pub(crate) stream_view_type: ::std::option::Option<crate::types::StreamViewType>,
110 pub(crate) creation_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
111 pub(crate) keyspace_name: ::std::option::Option<::std::string::String>,
112 pub(crate) table_name: ::std::option::Option<::std::string::String>,
113 pub(crate) shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
114 pub(crate) next_token: ::std::option::Option<::std::string::String>,
115 _request_id: Option<String>,
116}
117impl GetStreamOutputBuilder {
118 /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
119 /// This field is required.
120 pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.stream_arn = ::std::option::Option::Some(input.into());
122 self
123 }
124 /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
125 pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.stream_arn = input;
127 self
128 }
129 /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
130 pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
131 &self.stream_arn
132 }
133 /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
134 /// This field is required.
135 pub fn stream_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.stream_label = ::std::option::Option::Some(input.into());
137 self
138 }
139 /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
140 pub fn set_stream_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.stream_label = input;
142 self
143 }
144 /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
145 pub fn get_stream_label(&self) -> &::std::option::Option<::std::string::String> {
146 &self.stream_label
147 }
148 /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
149 /// This field is required.
150 pub fn stream_status(mut self, input: crate::types::StreamStatus) -> Self {
151 self.stream_status = ::std::option::Option::Some(input);
152 self
153 }
154 /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
155 pub fn set_stream_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
156 self.stream_status = input;
157 self
158 }
159 /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
160 pub fn get_stream_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
161 &self.stream_status
162 }
163 /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
164 /// <ul>
165 /// <li>
166 /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
167 /// <li>
168 /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
169 /// <li>
170 /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
171 /// <li>
172 /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
173 /// </ul>
174 /// This field is required.
175 pub fn stream_view_type(mut self, input: crate::types::StreamViewType) -> Self {
176 self.stream_view_type = ::std::option::Option::Some(input);
177 self
178 }
179 /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
180 /// <ul>
181 /// <li>
182 /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
183 /// <li>
184 /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
185 /// <li>
186 /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
187 /// <li>
188 /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
189 /// </ul>
190 pub fn set_stream_view_type(mut self, input: ::std::option::Option<crate::types::StreamViewType>) -> Self {
191 self.stream_view_type = input;
192 self
193 }
194 /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
195 /// <ul>
196 /// <li>
197 /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
198 /// <li>
199 /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
200 /// <li>
201 /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
202 /// <li>
203 /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
204 /// </ul>
205 pub fn get_stream_view_type(&self) -> &::std::option::Option<crate::types::StreamViewType> {
206 &self.stream_view_type
207 }
208 /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
209 /// This field is required.
210 pub fn creation_request_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
211 self.creation_request_date_time = ::std::option::Option::Some(input);
212 self
213 }
214 /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
215 pub fn set_creation_request_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
216 self.creation_request_date_time = input;
217 self
218 }
219 /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
220 pub fn get_creation_request_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
221 &self.creation_request_date_time
222 }
223 /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
224 /// This field is required.
225 pub fn keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.keyspace_name = ::std::option::Option::Some(input.into());
227 self
228 }
229 /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
230 pub fn set_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231 self.keyspace_name = input;
232 self
233 }
234 /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
235 pub fn get_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
236 &self.keyspace_name
237 }
238 /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
239 /// This field is required.
240 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241 self.table_name = ::std::option::Option::Some(input.into());
242 self
243 }
244 /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
245 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246 self.table_name = input;
247 self
248 }
249 /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
250 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
251 &self.table_name
252 }
253 /// Appends an item to `shards`.
254 ///
255 /// To override the contents of this collection use [`set_shards`](Self::set_shards).
256 ///
257 /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
258 pub fn shards(mut self, input: crate::types::Shard) -> Self {
259 let mut v = self.shards.unwrap_or_default();
260 v.push(input);
261 self.shards = ::std::option::Option::Some(v);
262 self
263 }
264 /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
265 pub fn set_shards(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>) -> Self {
266 self.shards = input;
267 self
268 }
269 /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
270 pub fn get_shards(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Shard>> {
271 &self.shards
272 }
273 /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
274 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275 self.next_token = ::std::option::Option::Some(input.into());
276 self
277 }
278 /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
279 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
280 self.next_token = input;
281 self
282 }
283 /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
284 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
285 &self.next_token
286 }
287 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
288 self._request_id = Some(request_id.into());
289 self
290 }
291
292 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
293 self._request_id = request_id;
294 self
295 }
296 /// Consumes the builder and constructs a [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
297 /// This method will fail if any of the following fields are not set:
298 /// - [`stream_arn`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_arn)
299 /// - [`stream_label`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_label)
300 /// - [`stream_status`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_status)
301 /// - [`stream_view_type`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_view_type)
302 /// - [`creation_request_date_time`](crate::operation::get_stream::builders::GetStreamOutputBuilder::creation_request_date_time)
303 /// - [`keyspace_name`](crate::operation::get_stream::builders::GetStreamOutputBuilder::keyspace_name)
304 /// - [`table_name`](crate::operation::get_stream::builders::GetStreamOutputBuilder::table_name)
305 pub fn build(self) -> ::std::result::Result<crate::operation::get_stream::GetStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
306 ::std::result::Result::Ok(crate::operation::get_stream::GetStreamOutput {
307 stream_arn: self.stream_arn.ok_or_else(|| {
308 ::aws_smithy_types::error::operation::BuildError::missing_field(
309 "stream_arn",
310 "stream_arn was not specified but it is required when building GetStreamOutput",
311 )
312 })?,
313 stream_label: self.stream_label.ok_or_else(|| {
314 ::aws_smithy_types::error::operation::BuildError::missing_field(
315 "stream_label",
316 "stream_label was not specified but it is required when building GetStreamOutput",
317 )
318 })?,
319 stream_status: self.stream_status.ok_or_else(|| {
320 ::aws_smithy_types::error::operation::BuildError::missing_field(
321 "stream_status",
322 "stream_status was not specified but it is required when building GetStreamOutput",
323 )
324 })?,
325 stream_view_type: self.stream_view_type.ok_or_else(|| {
326 ::aws_smithy_types::error::operation::BuildError::missing_field(
327 "stream_view_type",
328 "stream_view_type was not specified but it is required when building GetStreamOutput",
329 )
330 })?,
331 creation_request_date_time: self.creation_request_date_time.ok_or_else(|| {
332 ::aws_smithy_types::error::operation::BuildError::missing_field(
333 "creation_request_date_time",
334 "creation_request_date_time was not specified but it is required when building GetStreamOutput",
335 )
336 })?,
337 keyspace_name: self.keyspace_name.ok_or_else(|| {
338 ::aws_smithy_types::error::operation::BuildError::missing_field(
339 "keyspace_name",
340 "keyspace_name was not specified but it is required when building GetStreamOutput",
341 )
342 })?,
343 table_name: self.table_name.ok_or_else(|| {
344 ::aws_smithy_types::error::operation::BuildError::missing_field(
345 "table_name",
346 "table_name was not specified but it is required when building GetStreamOutput",
347 )
348 })?,
349 shards: self.shards,
350 next_token: self.next_token,
351 _request_id: self._request_id,
352 })
353 }
354}