1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents all of the data describing a particular stream.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StreamDescription {
    /// <p>The Amazon Resource Name (ARN) for the stream.</p>
    pub stream_arn: ::std::option::Option<::std::string::String>,
    /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
    /// <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>
    /// <ul>
    /// <li>
    /// <p>the Amazon Web Services customer ID.</p></li>
    /// <li>
    /// <p>the table name</p></li>
    /// <li>
    /// <p>the <code>StreamLabel</code></p></li>
    /// </ul>
    pub stream_label: ::std::option::Option<::std::string::String>,
    /// <p>Indicates the current status of the stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
    /// <li>
    /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
    /// </ul>
    pub stream_status: ::std::option::Option<crate::types::StreamStatus>,
    /// <p>Indicates the format of the records within this stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
    /// </ul>
    pub stream_view_type: ::std::option::Option<crate::types::StreamViewType>,
    /// <p>The date and time when the request to create this stream was issued.</p>
    pub creation_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The DynamoDB table with which the stream is associated.</p>
    pub table_name: ::std::option::Option<::std::string::String>,
    /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
    pub key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
    /// <p>The shards that comprise the stream.</p>
    pub shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
    /// <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>
    /// <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>
    /// <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>
    pub last_evaluated_shard_id: ::std::option::Option<::std::string::String>,
}
impl StreamDescription {
    /// <p>The Amazon Resource Name (ARN) for the stream.</p>
    pub fn stream_arn(&self) -> ::std::option::Option<&str> {
        self.stream_arn.as_deref()
    }
    /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
    /// <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>
    /// <ul>
    /// <li>
    /// <p>the Amazon Web Services customer ID.</p></li>
    /// <li>
    /// <p>the table name</p></li>
    /// <li>
    /// <p>the <code>StreamLabel</code></p></li>
    /// </ul>
    pub fn stream_label(&self) -> ::std::option::Option<&str> {
        self.stream_label.as_deref()
    }
    /// <p>Indicates the current status of the stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
    /// <li>
    /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
    /// </ul>
    pub fn stream_status(&self) -> ::std::option::Option<&crate::types::StreamStatus> {
        self.stream_status.as_ref()
    }
    /// <p>Indicates the format of the records within this stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
    /// </ul>
    pub fn stream_view_type(&self) -> ::std::option::Option<&crate::types::StreamViewType> {
        self.stream_view_type.as_ref()
    }
    /// <p>The date and time when the request to create this stream was issued.</p>
    pub fn creation_request_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_request_date_time.as_ref()
    }
    /// <p>The DynamoDB table with which the stream is associated.</p>
    pub fn table_name(&self) -> ::std::option::Option<&str> {
        self.table_name.as_deref()
    }
    /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
    ///
    /// 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()`.
    pub fn key_schema(&self) -> &[crate::types::KeySchemaElement] {
        self.key_schema.as_deref().unwrap_or_default()
    }
    /// <p>The shards that comprise the stream.</p>
    ///
    /// 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()`.
    pub fn shards(&self) -> &[crate::types::Shard] {
        self.shards.as_deref().unwrap_or_default()
    }
    /// <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>
    /// <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>
    /// <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>
    pub fn last_evaluated_shard_id(&self) -> ::std::option::Option<&str> {
        self.last_evaluated_shard_id.as_deref()
    }
}
impl StreamDescription {
    /// Creates a new builder-style object to manufacture [`StreamDescription`](crate::types::StreamDescription).
    pub fn builder() -> crate::types::builders::StreamDescriptionBuilder {
        crate::types::builders::StreamDescriptionBuilder::default()
    }
}

/// A builder for [`StreamDescription`](crate::types::StreamDescription).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct StreamDescriptionBuilder {
    pub(crate) stream_arn: ::std::option::Option<::std::string::String>,
    pub(crate) stream_label: ::std::option::Option<::std::string::String>,
    pub(crate) stream_status: ::std::option::Option<crate::types::StreamStatus>,
    pub(crate) stream_view_type: ::std::option::Option<crate::types::StreamViewType>,
    pub(crate) creation_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) table_name: ::std::option::Option<::std::string::String>,
    pub(crate) key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
    pub(crate) shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
    pub(crate) last_evaluated_shard_id: ::std::option::Option<::std::string::String>,
}
impl StreamDescriptionBuilder {
    /// <p>The Amazon Resource Name (ARN) for the stream.</p>
    pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stream_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the stream.</p>
    pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stream_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the stream.</p>
    pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.stream_arn
    }
    /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
    /// <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>
    /// <ul>
    /// <li>
    /// <p>the Amazon Web Services customer ID.</p></li>
    /// <li>
    /// <p>the table name</p></li>
    /// <li>
    /// <p>the <code>StreamLabel</code></p></li>
    /// </ul>
    pub fn stream_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stream_label = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
    /// <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>
    /// <ul>
    /// <li>
    /// <p>the Amazon Web Services customer ID.</p></li>
    /// <li>
    /// <p>the table name</p></li>
    /// <li>
    /// <p>the <code>StreamLabel</code></p></li>
    /// </ul>
    pub fn set_stream_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stream_label = input;
        self
    }
    /// <p>A timestamp, in ISO 8601 format, for this stream.</p>
    /// <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>
    /// <ul>
    /// <li>
    /// <p>the Amazon Web Services customer ID.</p></li>
    /// <li>
    /// <p>the table name</p></li>
    /// <li>
    /// <p>the <code>StreamLabel</code></p></li>
    /// </ul>
    pub fn get_stream_label(&self) -> &::std::option::Option<::std::string::String> {
        &self.stream_label
    }
    /// <p>Indicates the current status of the stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
    /// <li>
    /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
    /// </ul>
    pub fn stream_status(mut self, input: crate::types::StreamStatus) -> Self {
        self.stream_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates the current status of the stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
    /// <li>
    /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
    /// </ul>
    pub fn set_stream_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
        self.stream_status = input;
        self
    }
    /// <p>Indicates the current status of the stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>ENABLING</code> - Streams is currently being enabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>ENABLED</code> - the stream is enabled.</p></li>
    /// <li>
    /// <p><code>DISABLING</code> - Streams is currently being disabled on the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>DISABLED</code> - the stream is disabled.</p></li>
    /// </ul>
    pub fn get_stream_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
        &self.stream_status
    }
    /// <p>Indicates the format of the records within this stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
    /// </ul>
    pub fn stream_view_type(mut self, input: crate::types::StreamViewType) -> Self {
        self.stream_view_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates the format of the records within this stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
    /// </ul>
    pub fn set_stream_view_type(mut self, input: ::std::option::Option<crate::types::StreamViewType>) -> Self {
        self.stream_view_type = input;
        self
    }
    /// <p>Indicates the format of the records within this stream:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - only the key attributes of items that were modified in the DynamoDB table.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - entire items from the table, as they appeared after they were modified.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - entire items from the table, as they appeared before they were modified.</p></li>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both the new and the old images of the items from the table.</p></li>
    /// </ul>
    pub fn get_stream_view_type(&self) -> &::std::option::Option<crate::types::StreamViewType> {
        &self.stream_view_type
    }
    /// <p>The date and time when the request to create this stream was issued.</p>
    pub fn creation_request_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_request_date_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the request to create this stream was issued.</p>
    pub fn set_creation_request_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_request_date_time = input;
        self
    }
    /// <p>The date and time when the request to create this stream was issued.</p>
    pub fn get_creation_request_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_request_date_time
    }
    /// <p>The DynamoDB table with which the stream is associated.</p>
    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.table_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The DynamoDB table with which the stream is associated.</p>
    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.table_name = input;
        self
    }
    /// <p>The DynamoDB table with which the stream is associated.</p>
    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.table_name
    }
    /// Appends an item to `key_schema`.
    ///
    /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
    ///
    /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
    pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
        let mut v = self.key_schema.unwrap_or_default();
        v.push(input);
        self.key_schema = ::std::option::Option::Some(v);
        self
    }
    /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
    pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>) -> Self {
        self.key_schema = input;
        self
    }
    /// <p>The key attribute(s) of the stream's DynamoDB table.</p>
    pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>> {
        &self.key_schema
    }
    /// Appends an item to `shards`.
    ///
    /// To override the contents of this collection use [`set_shards`](Self::set_shards).
    ///
    /// <p>The shards that comprise the stream.</p>
    pub fn shards(mut self, input: crate::types::Shard) -> Self {
        let mut v = self.shards.unwrap_or_default();
        v.push(input);
        self.shards = ::std::option::Option::Some(v);
        self
    }
    /// <p>The shards that comprise the stream.</p>
    pub fn set_shards(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>) -> Self {
        self.shards = input;
        self
    }
    /// <p>The shards that comprise the stream.</p>
    pub fn get_shards(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Shard>> {
        &self.shards
    }
    /// <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>
    /// <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>
    /// <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>
    pub fn last_evaluated_shard_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_evaluated_shard_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    /// <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>
    /// <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>
    pub fn set_last_evaluated_shard_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_evaluated_shard_id = input;
        self
    }
    /// <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>
    /// <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>
    /// <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>
    pub fn get_last_evaluated_shard_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_evaluated_shard_id
    }
    /// Consumes the builder and constructs a [`StreamDescription`](crate::types::StreamDescription).
    pub fn build(self) -> crate::types::StreamDescription {
        crate::types::StreamDescription {
            stream_arn: self.stream_arn,
            stream_label: self.stream_label,
            stream_status: self.stream_status,
            stream_view_type: self.stream_view_type,
            creation_request_date_time: self.creation_request_date_time,
            table_name: self.table_name,
            key_schema: self.key_schema,
            shards: self.shards,
            last_evaluated_shard_id: self.last_evaluated_shard_id,
        }
    }
}