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
//! Types for the `QLDB` service.
/// The [`AWS::QLDB::Ledger`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html) resource type.
#[derive(Debug, Default)]
pub struct Ledger {
properties: LedgerProperties
}
/// Properties for the `Ledger` resource.
#[derive(Debug, Default)]
pub struct LedgerProperties {
/// Property [`DeletionProtection`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html#cfn-qldb-ledger-deletionprotection).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub deletion_protection: Option<::Value<bool>>,
/// Property [`KmsKey`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html#cfn-qldb-ledger-kmskey).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub kms_key: Option<::Value<String>>,
/// Property [`Name`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html#cfn-qldb-ledger-name).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub name: Option<::Value<String>>,
/// Property [`PermissionsMode`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html#cfn-qldb-ledger-permissionsmode).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub permissions_mode: ::Value<String>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html#cfn-qldb-ledger-tags).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub tags: Option<::ValueList<::Tag>>,
}
impl ::serde::Serialize for LedgerProperties {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
if let Some(ref deletion_protection) = self.deletion_protection {
::serde::ser::SerializeMap::serialize_entry(&mut map, "DeletionProtection", deletion_protection)?;
}
if let Some(ref kms_key) = self.kms_key {
::serde::ser::SerializeMap::serialize_entry(&mut map, "KmsKey", kms_key)?;
}
if let Some(ref name) = self.name {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Name", name)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "PermissionsMode", &self.permissions_mode)?;
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for LedgerProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<LedgerProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = LedgerProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type LedgerProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut deletion_protection: Option<::Value<bool>> = None;
let mut kms_key: Option<::Value<String>> = None;
let mut name: Option<::Value<String>> = None;
let mut permissions_mode: Option<::Value<String>> = None;
let mut tags: Option<::ValueList<::Tag>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"DeletionProtection" => {
deletion_protection = ::serde::de::MapAccess::next_value(&mut map)?;
}
"KmsKey" => {
kms_key = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Name" => {
name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"PermissionsMode" => {
permissions_mode = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(LedgerProperties {
deletion_protection: deletion_protection,
kms_key: kms_key,
name: name,
permissions_mode: permissions_mode.ok_or(::serde::de::Error::missing_field("PermissionsMode"))?,
tags: tags,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for Ledger {
type Properties = LedgerProperties;
const TYPE: &'static str = "AWS::QLDB::Ledger";
fn properties(&self) -> &LedgerProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut LedgerProperties {
&mut self.properties
}
}
impl ::private::Sealed for Ledger {}
impl From<LedgerProperties> for Ledger {
fn from(properties: LedgerProperties) -> Ledger {
Ledger { properties }
}
}
/// The [`AWS::QLDB::Stream`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html) resource type.
#[derive(Debug, Default)]
pub struct Stream {
properties: StreamProperties
}
/// Properties for the `Stream` resource.
#[derive(Debug, Default)]
pub struct StreamProperties {
/// Property [`ExclusiveEndTime`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html#cfn-qldb-stream-exclusiveendtime).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub exclusive_end_time: Option<::Value<String>>,
/// Property [`InclusiveStartTime`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html#cfn-qldb-stream-inclusivestarttime).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub inclusive_start_time: ::Value<String>,
/// Property [`KinesisConfiguration`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html#cfn-qldb-stream-kinesisconfiguration).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub kinesis_configuration: ::Value<self::stream::KinesisConfiguration>,
/// Property [`LedgerName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html#cfn-qldb-stream-ledgername).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub ledger_name: ::Value<String>,
/// Property [`RoleArn`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html#cfn-qldb-stream-rolearn).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub role_arn: ::Value<String>,
/// Property [`StreamName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html#cfn-qldb-stream-streamname).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub stream_name: ::Value<String>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-stream.html#cfn-qldb-stream-tags).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub tags: Option<::ValueList<::Tag>>,
}
impl ::serde::Serialize for StreamProperties {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
if let Some(ref exclusive_end_time) = self.exclusive_end_time {
::serde::ser::SerializeMap::serialize_entry(&mut map, "ExclusiveEndTime", exclusive_end_time)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "InclusiveStartTime", &self.inclusive_start_time)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "KinesisConfiguration", &self.kinesis_configuration)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "LedgerName", &self.ledger_name)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "RoleArn", &self.role_arn)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "StreamName", &self.stream_name)?;
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for StreamProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<StreamProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = StreamProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type StreamProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut exclusive_end_time: Option<::Value<String>> = None;
let mut inclusive_start_time: Option<::Value<String>> = None;
let mut kinesis_configuration: Option<::Value<self::stream::KinesisConfiguration>> = None;
let mut ledger_name: Option<::Value<String>> = None;
let mut role_arn: Option<::Value<String>> = None;
let mut stream_name: Option<::Value<String>> = None;
let mut tags: Option<::ValueList<::Tag>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"ExclusiveEndTime" => {
exclusive_end_time = ::serde::de::MapAccess::next_value(&mut map)?;
}
"InclusiveStartTime" => {
inclusive_start_time = ::serde::de::MapAccess::next_value(&mut map)?;
}
"KinesisConfiguration" => {
kinesis_configuration = ::serde::de::MapAccess::next_value(&mut map)?;
}
"LedgerName" => {
ledger_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"RoleArn" => {
role_arn = ::serde::de::MapAccess::next_value(&mut map)?;
}
"StreamName" => {
stream_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(StreamProperties {
exclusive_end_time: exclusive_end_time,
inclusive_start_time: inclusive_start_time.ok_or(::serde::de::Error::missing_field("InclusiveStartTime"))?,
kinesis_configuration: kinesis_configuration.ok_or(::serde::de::Error::missing_field("KinesisConfiguration"))?,
ledger_name: ledger_name.ok_or(::serde::de::Error::missing_field("LedgerName"))?,
role_arn: role_arn.ok_or(::serde::de::Error::missing_field("RoleArn"))?,
stream_name: stream_name.ok_or(::serde::de::Error::missing_field("StreamName"))?,
tags: tags,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for Stream {
type Properties = StreamProperties;
const TYPE: &'static str = "AWS::QLDB::Stream";
fn properties(&self) -> &StreamProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut StreamProperties {
&mut self.properties
}
}
impl ::private::Sealed for Stream {}
impl From<StreamProperties> for Stream {
fn from(properties: StreamProperties) -> Stream {
Stream { properties }
}
}
pub mod stream {
//! Property types for the `Stream` resource.
/// The [`AWS::QLDB::Stream.KinesisConfiguration`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-qldb-stream-kinesisconfiguration.html) property type.
#[derive(Debug, Default)]
pub struct KinesisConfiguration {
/// Property [`AggregationEnabled`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-qldb-stream-kinesisconfiguration.html#cfn-qldb-stream-kinesisconfiguration-aggregationenabled).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub aggregation_enabled: Option<::Value<bool>>,
/// Property [`StreamArn`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-qldb-stream-kinesisconfiguration.html#cfn-qldb-stream-kinesisconfiguration-streamarn).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub stream_arn: Option<::Value<String>>,
}
impl ::codec::SerializeValue for KinesisConfiguration {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
if let Some(ref aggregation_enabled) = self.aggregation_enabled {
::serde::ser::SerializeMap::serialize_entry(&mut map, "AggregationEnabled", aggregation_enabled)?;
}
if let Some(ref stream_arn) = self.stream_arn {
::serde::ser::SerializeMap::serialize_entry(&mut map, "StreamArn", stream_arn)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for KinesisConfiguration {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<KinesisConfiguration, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = KinesisConfiguration;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type KinesisConfiguration")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut aggregation_enabled: Option<::Value<bool>> = None;
let mut stream_arn: Option<::Value<String>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"AggregationEnabled" => {
aggregation_enabled = ::serde::de::MapAccess::next_value(&mut map)?;
}
"StreamArn" => {
stream_arn = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(KinesisConfiguration {
aggregation_enabled: aggregation_enabled,
stream_arn: stream_arn,
})
}
}
d.deserialize_map(Visitor)
}
}
}