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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents a change data capture stream for an Amazon Keyspaces table, which enables tracking and processing of data changes.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Stream {
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this stream.</p>
pub stream_arn: ::std::string::String,
/// <p>The name of the keyspace containing the table associated with this stream.</p>
pub keyspace_name: ::std::string::String,
/// <p>The name of the table associated with this stream.</p>
pub table_name: ::std::string::String,
/// <p>A unique identifier for this stream that can be used in stream operations.</p>
pub stream_label: ::std::string::String,
}
impl Stream {
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this stream.</p>
pub fn stream_arn(&self) -> &str {
use std::ops::Deref;
self.stream_arn.deref()
}
/// <p>The name of the keyspace containing the table associated with this stream.</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.</p>
pub fn table_name(&self) -> &str {
use std::ops::Deref;
self.table_name.deref()
}
/// <p>A unique identifier for this stream that can be used in stream operations.</p>
pub fn stream_label(&self) -> &str {
use std::ops::Deref;
self.stream_label.deref()
}
}
impl Stream {
/// Creates a new builder-style object to manufacture [`Stream`](crate::types::Stream).
pub fn builder() -> crate::types::builders::StreamBuilder {
crate::types::builders::StreamBuilder::default()
}
}
/// A builder for [`Stream`](crate::types::Stream).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StreamBuilder {
pub(crate) stream_arn: ::std::option::Option<::std::string::String>,
pub(crate) keyspace_name: ::std::option::Option<::std::string::String>,
pub(crate) table_name: ::std::option::Option<::std::string::String>,
pub(crate) stream_label: ::std::option::Option<::std::string::String>,
}
impl StreamBuilder {
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this 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 this 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 this stream.</p>
pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.stream_arn
}
/// <p>The name of the keyspace containing the table associated with this stream.</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.</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.</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.</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.</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.</p>
pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
&self.table_name
}
/// <p>A unique identifier for this stream that can be used in stream operations.</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 unique identifier for this stream that can be used in stream operations.</p>
pub fn set_stream_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.stream_label = input;
self
}
/// <p>A unique identifier for this stream that can be used in stream operations.</p>
pub fn get_stream_label(&self) -> &::std::option::Option<::std::string::String> {
&self.stream_label
}
/// Consumes the builder and constructs a [`Stream`](crate::types::Stream).
/// This method will fail if any of the following fields are not set:
/// - [`stream_arn`](crate::types::builders::StreamBuilder::stream_arn)
/// - [`keyspace_name`](crate::types::builders::StreamBuilder::keyspace_name)
/// - [`table_name`](crate::types::builders::StreamBuilder::table_name)
/// - [`stream_label`](crate::types::builders::StreamBuilder::stream_label)
pub fn build(self) -> ::std::result::Result<crate::types::Stream, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Stream {
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 Stream",
)
})?,
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 Stream",
)
})?,
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 Stream",
)
})?,
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 Stream",
)
})?,
})
}
}