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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetStreamOutput {
/// <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>
pub stream_arn: ::std::string::String,
/// <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>
pub stream_label: ::std::string::String,
/// <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>
pub stream_status: crate::types::StreamStatus,
/// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
/// <ul>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
/// <li>
/// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
/// </ul>
pub stream_view_type: crate::types::StreamViewType,
/// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
pub creation_request_date_time: ::aws_smithy_types::DateTime,
/// <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>
pub keyspace_name: ::std::string::String,
/// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
pub table_name: ::std::string::String,
/// <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>
pub shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
/// <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>
pub next_token: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetStreamOutput {
/// <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>
pub fn stream_arn(&self) -> &str {
use std::ops::Deref;
self.stream_arn.deref()
}
/// <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>
pub fn stream_label(&self) -> &str {
use std::ops::Deref;
self.stream_label.deref()
}
/// <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>
pub fn stream_status(&self) -> &crate::types::StreamStatus {
&self.stream_status
}
/// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
/// <ul>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
/// <li>
/// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
/// </ul>
pub fn stream_view_type(&self) -> &crate::types::StreamViewType {
&self.stream_view_type
}
/// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
pub fn creation_request_date_time(&self) -> &::aws_smithy_types::DateTime {
&self.creation_request_date_time
}
/// <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>
pub fn keyspace_name(&self) -> &str {
use std::ops::Deref;
self.keyspace_name.deref()
}
/// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
pub fn table_name(&self) -> &str {
use std::ops::Deref;
self.table_name.deref()
}
/// <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>
///
/// 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>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>
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl ::aws_types::request_id::RequestId for GetStreamOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetStreamOutput {
/// Creates a new builder-style object to manufacture [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
pub fn builder() -> crate::operation::get_stream::builders::GetStreamOutputBuilder {
crate::operation::get_stream::builders::GetStreamOutputBuilder::default()
}
}
/// A builder for [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetStreamOutputBuilder {
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) keyspace_name: ::std::option::Option<::std::string::String>,
pub(crate) table_name: ::std::option::Option<::std::string::String>,
pub(crate) shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetStreamOutputBuilder {
/// <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>
/// This field is required.
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) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific 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) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.stream_arn
}
/// <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>
/// This field is required.
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 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>
pub fn set_stream_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.stream_label = input;
self
}
/// <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>
pub fn get_stream_label(&self) -> &::std::option::Option<::std::string::String> {
&self.stream_label
}
/// <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>
/// This field is required.
pub fn stream_status(mut self, input: crate::types::StreamStatus) -> Self {
self.stream_status = ::std::option::Option::Some(input);
self
}
/// <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>
pub fn set_stream_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
self.stream_status = input;
self
}
/// <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>
pub fn get_stream_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
&self.stream_status
}
/// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
/// <ul>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
/// <li>
/// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
/// </ul>
/// This field is required.
pub fn stream_view_type(mut self, input: crate::types::StreamViewType) -> Self {
self.stream_view_type = ::std::option::Option::Some(input);
self
}
/// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
/// <ul>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
/// <li>
/// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</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>The format of the data records in this stream. Currently, this can be one of the following options:</p>
/// <ul>
/// <li>
/// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
/// <li>
/// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
/// <li>
/// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
/// <li>
/// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</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. The value is represented in ISO 8601 format.</p>
/// This field is required.
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. The value is represented in ISO 8601 format.</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. The value is represented in ISO 8601 format.</p>
pub fn get_creation_request_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.creation_request_date_time
}
/// <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>
/// This field is required.
pub fn keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.keyspace_name = ::std::option::Option::Some(input.into());
self
}
/// <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>
pub fn set_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.keyspace_name = input;
self
}
/// <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>
pub fn get_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
&self.keyspace_name
}
/// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
/// This field is required.
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 name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.table_name = input;
self
}
/// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
&self.table_name
}
/// Appends an item to `shards`.
///
/// To override the contents of this collection use [`set_shards`](Self::set_shards).
///
/// <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>
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>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>
pub fn set_shards(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>) -> Self {
self.shards = input;
self
}
/// <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>
pub fn get_shards(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Shard>> {
&self.shards
}
/// <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>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// <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>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// <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>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
/// This method will fail if any of the following fields are not set:
/// - [`stream_arn`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_arn)
/// - [`stream_label`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_label)
/// - [`stream_status`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_status)
/// - [`stream_view_type`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_view_type)
/// - [`creation_request_date_time`](crate::operation::get_stream::builders::GetStreamOutputBuilder::creation_request_date_time)
/// - [`keyspace_name`](crate::operation::get_stream::builders::GetStreamOutputBuilder::keyspace_name)
/// - [`table_name`](crate::operation::get_stream::builders::GetStreamOutputBuilder::table_name)
pub fn build(self) -> ::std::result::Result<crate::operation::get_stream::GetStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_stream::GetStreamOutput {
stream_arn: self.stream_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"stream_arn",
"stream_arn was not specified but it is required when building GetStreamOutput",
)
})?,
stream_label: self.stream_label.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"stream_label",
"stream_label was not specified but it is required when building GetStreamOutput",
)
})?,
stream_status: self.stream_status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"stream_status",
"stream_status was not specified but it is required when building GetStreamOutput",
)
})?,
stream_view_type: self.stream_view_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"stream_view_type",
"stream_view_type was not specified but it is required when building GetStreamOutput",
)
})?,
creation_request_date_time: self.creation_request_date_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"creation_request_date_time",
"creation_request_date_time was not specified but it is required when building GetStreamOutput",
)
})?,
keyspace_name: self.keyspace_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"keyspace_name",
"keyspace_name was not specified but it is required when building GetStreamOutput",
)
})?,
table_name: self.table_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"table_name",
"table_name was not specified but it is required when building GetStreamOutput",
)
})?,
shards: self.shards,
next_token: self.next_token,
_request_id: self._request_id,
})
}
}