aws_sdk_dynamodbstreams/types/_stream_description.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents all of the data describing a particular stream.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StreamDescription {
7 /// <p>The Amazon Resource Name (ARN) for the stream.</p>
8 pub stream_arn: ::std::option::Option<::std::string::String>,
9 /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
10 /// <p>Note that <code>LatestStreamLabel</code> is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:</p>
11 /// <ul>
12 /// <li>
13 /// <p>the Amazon Web Services customer ID.</p></li>
14 /// <li>
15 /// <p>the table name</p></li>
16 /// <li>
17 /// <p>the <code>StreamLabel</code></p></li>
18 /// </ul>
19 pub stream_label: ::std::option::Option<::std::string::String>,
20 /// <p>Indicates the current status of the stream:</p>
21 /// <ul>
22 /// <li>
23 /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
24 /// <li>
25 /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
26 /// <li>
27 /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
28 /// <li>
29 /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
30 /// </ul>
31 pub stream_status: ::std::option::Option<crate::types::StreamStatus>,
32 /// <p>Indicates the format of the records within this stream:</p>
33 /// <ul>
34 /// <li>
35 /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
36 /// <li>
37 /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
38 /// <li>
39 /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
40 /// <li>
41 /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
42 /// </ul>
43 pub stream_view_type: ::std::option::Option<crate::types::StreamViewType>,
44 /// <p>The date and time when the request to create this stream was issued.</p>
45 pub creation_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
46 /// <p>The DynamoDB table with which the stream is associated.</p>
47 pub table_name: ::std::option::Option<::std::string::String>,
48 /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
49 pub key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
50 /// <p>The shards that comprise the stream.</p>
51 pub shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
52 /// <p>The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
53 /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved.</p>
54 /// <p>If <code>LastEvaluatedShardId</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedShardId</code> is empty.</p>
55 pub last_evaluated_shard_id: ::std::option::Option<::std::string::String>,
56}
57impl StreamDescription {
58 /// <p>The Amazon Resource Name (ARN) for the stream.</p>
59 pub fn stream_arn(&self) -> ::std::option::Option<&str> {
60 self.stream_arn.as_deref()
61 }
62 /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
63 /// <p>Note that <code>LatestStreamLabel</code> is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:</p>
64 /// <ul>
65 /// <li>
66 /// <p>the Amazon Web Services customer ID.</p></li>
67 /// <li>
68 /// <p>the table name</p></li>
69 /// <li>
70 /// <p>the <code>StreamLabel</code></p></li>
71 /// </ul>
72 pub fn stream_label(&self) -> ::std::option::Option<&str> {
73 self.stream_label.as_deref()
74 }
75 /// <p>Indicates the current status of the stream:</p>
76 /// <ul>
77 /// <li>
78 /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
79 /// <li>
80 /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
81 /// <li>
82 /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
83 /// <li>
84 /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
85 /// </ul>
86 pub fn stream_status(&self) -> ::std::option::Option<&crate::types::StreamStatus> {
87 self.stream_status.as_ref()
88 }
89 /// <p>Indicates the format of the records within this stream:</p>
90 /// <ul>
91 /// <li>
92 /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
93 /// <li>
94 /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
95 /// <li>
96 /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
97 /// <li>
98 /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
99 /// </ul>
100 pub fn stream_view_type(&self) -> ::std::option::Option<&crate::types::StreamViewType> {
101 self.stream_view_type.as_ref()
102 }
103 /// <p>The date and time when the request to create this stream was issued.</p>
104 pub fn creation_request_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
105 self.creation_request_date_time.as_ref()
106 }
107 /// <p>The DynamoDB table with which the stream is associated.</p>
108 pub fn table_name(&self) -> ::std::option::Option<&str> {
109 self.table_name.as_deref()
110 }
111 /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
112 ///
113 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.key_schema.is_none()`.
114 pub fn key_schema(&self) -> &[crate::types::KeySchemaElement] {
115 self.key_schema.as_deref().unwrap_or_default()
116 }
117 /// <p>The shards that comprise the stream.</p>
118 ///
119 /// 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()`.
120 pub fn shards(&self) -> &[crate::types::Shard] {
121 self.shards.as_deref().unwrap_or_default()
122 }
123 /// <p>The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
124 /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved.</p>
125 /// <p>If <code>LastEvaluatedShardId</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedShardId</code> is empty.</p>
126 pub fn last_evaluated_shard_id(&self) -> ::std::option::Option<&str> {
127 self.last_evaluated_shard_id.as_deref()
128 }
129}
130impl StreamDescription {
131 /// Creates a new builder-style object to manufacture [`StreamDescription`](crate::types::StreamDescription).
132 pub fn builder() -> crate::types::builders::StreamDescriptionBuilder {
133 crate::types::builders::StreamDescriptionBuilder::default()
134 }
135}
136
137/// A builder for [`StreamDescription`](crate::types::StreamDescription).
138#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
139#[non_exhaustive]
140pub struct StreamDescriptionBuilder {
141 pub(crate) stream_arn: ::std::option::Option<::std::string::String>,
142 pub(crate) stream_label: ::std::option::Option<::std::string::String>,
143 pub(crate) stream_status: ::std::option::Option<crate::types::StreamStatus>,
144 pub(crate) stream_view_type: ::std::option::Option<crate::types::StreamViewType>,
145 pub(crate) creation_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
146 pub(crate) table_name: ::std::option::Option<::std::string::String>,
147 pub(crate) key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
148 pub(crate) shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
149 pub(crate) last_evaluated_shard_id: ::std::option::Option<::std::string::String>,
150}
151impl StreamDescriptionBuilder {
152 /// <p>The Amazon Resource Name (ARN) for the stream.</p>
153 pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.stream_arn = ::std::option::Option::Some(input.into());
155 self
156 }
157 /// <p>The Amazon Resource Name (ARN) for the stream.</p>
158 pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.stream_arn = input;
160 self
161 }
162 /// <p>The Amazon Resource Name (ARN) for the stream.</p>
163 pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
164 &self.stream_arn
165 }
166 /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
167 /// <p>Note that <code>LatestStreamLabel</code> is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:</p>
168 /// <ul>
169 /// <li>
170 /// <p>the Amazon Web Services customer ID.</p></li>
171 /// <li>
172 /// <p>the table name</p></li>
173 /// <li>
174 /// <p>the <code>StreamLabel</code></p></li>
175 /// </ul>
176 pub fn stream_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177 self.stream_label = ::std::option::Option::Some(input.into());
178 self
179 }
180 /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
181 /// <p>Note that <code>LatestStreamLabel</code> is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:</p>
182 /// <ul>
183 /// <li>
184 /// <p>the Amazon Web Services customer ID.</p></li>
185 /// <li>
186 /// <p>the table name</p></li>
187 /// <li>
188 /// <p>the <code>StreamLabel</code></p></li>
189 /// </ul>
190 pub fn set_stream_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.stream_label = input;
192 self
193 }
194 /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
195 /// <p>Note that <code>LatestStreamLabel</code> is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:</p>
196 /// <ul>
197 /// <li>
198 /// <p>the Amazon Web Services customer ID.</p></li>
199 /// <li>
200 /// <p>the table name</p></li>
201 /// <li>
202 /// <p>the <code>StreamLabel</code></p></li>
203 /// </ul>
204 pub fn get_stream_label(&self) -> &::std::option::Option<::std::string::String> {
205 &self.stream_label
206 }
207 /// <p>Indicates the current status of the stream:</p>
208 /// <ul>
209 /// <li>
210 /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
211 /// <li>
212 /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
213 /// <li>
214 /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
215 /// <li>
216 /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
217 /// </ul>
218 pub fn stream_status(mut self, input: crate::types::StreamStatus) -> Self {
219 self.stream_status = ::std::option::Option::Some(input);
220 self
221 }
222 /// <p>Indicates the current status of the stream:</p>
223 /// <ul>
224 /// <li>
225 /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
226 /// <li>
227 /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
228 /// <li>
229 /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
230 /// <li>
231 /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
232 /// </ul>
233 pub fn set_stream_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
234 self.stream_status = input;
235 self
236 }
237 /// <p>Indicates the current status of the stream:</p>
238 /// <ul>
239 /// <li>
240 /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
241 /// <li>
242 /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
243 /// <li>
244 /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
245 /// <li>
246 /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
247 /// </ul>
248 pub fn get_stream_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
249 &self.stream_status
250 }
251 /// <p>Indicates the format of the records within this stream:</p>
252 /// <ul>
253 /// <li>
254 /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
255 /// <li>
256 /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
257 /// <li>
258 /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
259 /// <li>
260 /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
261 /// </ul>
262 pub fn stream_view_type(mut self, input: crate::types::StreamViewType) -> Self {
263 self.stream_view_type = ::std::option::Option::Some(input);
264 self
265 }
266 /// <p>Indicates the format of the records within this stream:</p>
267 /// <ul>
268 /// <li>
269 /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
270 /// <li>
271 /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
272 /// <li>
273 /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
274 /// <li>
275 /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
276 /// </ul>
277 pub fn set_stream_view_type(mut self, input: ::std::option::Option<crate::types::StreamViewType>) -> Self {
278 self.stream_view_type = input;
279 self
280 }
281 /// <p>Indicates the format of the records within this stream:</p>
282 /// <ul>
283 /// <li>
284 /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
285 /// <li>
286 /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
287 /// <li>
288 /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
289 /// <li>
290 /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
291 /// </ul>
292 pub fn get_stream_view_type(&self) -> &::std::option::Option<crate::types::StreamViewType> {
293 &self.stream_view_type
294 }
295 /// <p>The date and time when the request to create this stream was issued.</p>
296 pub fn creation_request_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
297 self.creation_request_date_time = ::std::option::Option::Some(input);
298 self
299 }
300 /// <p>The date and time when the request to create this stream was issued.</p>
301 pub fn set_creation_request_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
302 self.creation_request_date_time = input;
303 self
304 }
305 /// <p>The date and time when the request to create this stream was issued.</p>
306 pub fn get_creation_request_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
307 &self.creation_request_date_time
308 }
309 /// <p>The DynamoDB table with which the stream is associated.</p>
310 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311 self.table_name = ::std::option::Option::Some(input.into());
312 self
313 }
314 /// <p>The DynamoDB table with which the stream is associated.</p>
315 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
316 self.table_name = input;
317 self
318 }
319 /// <p>The DynamoDB table with which the stream is associated.</p>
320 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
321 &self.table_name
322 }
323 /// Appends an item to `key_schema`.
324 ///
325 /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
326 ///
327 /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
328 pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
329 let mut v = self.key_schema.unwrap_or_default();
330 v.push(input);
331 self.key_schema = ::std::option::Option::Some(v);
332 self
333 }
334 /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
335 pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>) -> Self {
336 self.key_schema = input;
337 self
338 }
339 /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
340 pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>> {
341 &self.key_schema
342 }
343 /// Appends an item to `shards`.
344 ///
345 /// To override the contents of this collection use [`set_shards`](Self::set_shards).
346 ///
347 /// <p>The shards that comprise the stream.</p>
348 pub fn shards(mut self, input: crate::types::Shard) -> Self {
349 let mut v = self.shards.unwrap_or_default();
350 v.push(input);
351 self.shards = ::std::option::Option::Some(v);
352 self
353 }
354 /// <p>The shards that comprise the stream.</p>
355 pub fn set_shards(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>) -> Self {
356 self.shards = input;
357 self
358 }
359 /// <p>The shards that comprise the stream.</p>
360 pub fn get_shards(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Shard>> {
361 &self.shards
362 }
363 /// <p>The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
364 /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved.</p>
365 /// <p>If <code>LastEvaluatedShardId</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedShardId</code> is empty.</p>
366 pub fn last_evaluated_shard_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
367 self.last_evaluated_shard_id = ::std::option::Option::Some(input.into());
368 self
369 }
370 /// <p>The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
371 /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved.</p>
372 /// <p>If <code>LastEvaluatedShardId</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedShardId</code> is empty.</p>
373 pub fn set_last_evaluated_shard_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
374 self.last_evaluated_shard_id = input;
375 self
376 }
377 /// <p>The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
378 /// <p>If <code>LastEvaluatedShardId</code> is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved.</p>
379 /// <p>If <code>LastEvaluatedShardId</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedShardId</code> is empty.</p>
380 pub fn get_last_evaluated_shard_id(&self) -> &::std::option::Option<::std::string::String> {
381 &self.last_evaluated_shard_id
382 }
383 /// Consumes the builder and constructs a [`StreamDescription`](crate::types::StreamDescription).
384 pub fn build(self) -> crate::types::StreamDescription {
385 crate::types::StreamDescription {
386 stream_arn: self.stream_arn,
387 stream_label: self.stream_label,
388 stream_status: self.stream_status,
389 stream_view_type: self.stream_view_type,
390 creation_request_date_time: self.creation_request_date_time,
391 table_name: self.table_name,
392 key_schema: self.key_schema,
393 shards: self.shards,
394 last_evaluated_shard_id: self.last_evaluated_shard_id,
395 }
396 }
397}