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
//! Types for the `MediaStore` service.
/// The [`AWS::MediaStore::Container`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html) resource type.
#[derive(Debug, Default)]
pub struct Container {
properties: ContainerProperties
}
/// Properties for the `Container` resource.
#[derive(Debug, Default)]
pub struct ContainerProperties {
/// Property [`AccessLoggingEnabled`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html#cfn-mediastore-container-accessloggingenabled).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub access_logging_enabled: Option<::Value<bool>>,
/// Property [`ContainerName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html#cfn-mediastore-container-containername).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub container_name: ::Value<String>,
/// Property [`CorsPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html#cfn-mediastore-container-corspolicy).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub cors_policy: Option<::ValueList<self::container::CorsRule>>,
/// Property [`LifecyclePolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html#cfn-mediastore-container-lifecyclepolicy).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub lifecycle_policy: Option<::Value<String>>,
/// Property [`MetricPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html#cfn-mediastore-container-metricpolicy).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub metric_policy: Option<::Value<self::container::MetricPolicy>>,
/// Property [`Policy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html#cfn-mediastore-container-policy).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub policy: Option<::Value<String>>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediastore-container.html#cfn-mediastore-container-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 ContainerProperties {
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 access_logging_enabled) = self.access_logging_enabled {
::serde::ser::SerializeMap::serialize_entry(&mut map, "AccessLoggingEnabled", access_logging_enabled)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "ContainerName", &self.container_name)?;
if let Some(ref cors_policy) = self.cors_policy {
::serde::ser::SerializeMap::serialize_entry(&mut map, "CorsPolicy", cors_policy)?;
}
if let Some(ref lifecycle_policy) = self.lifecycle_policy {
::serde::ser::SerializeMap::serialize_entry(&mut map, "LifecyclePolicy", lifecycle_policy)?;
}
if let Some(ref metric_policy) = self.metric_policy {
::serde::ser::SerializeMap::serialize_entry(&mut map, "MetricPolicy", metric_policy)?;
}
if let Some(ref policy) = self.policy {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Policy", policy)?;
}
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 ContainerProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<ContainerProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = ContainerProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type ContainerProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut access_logging_enabled: Option<::Value<bool>> = None;
let mut container_name: Option<::Value<String>> = None;
let mut cors_policy: Option<::ValueList<self::container::CorsRule>> = None;
let mut lifecycle_policy: Option<::Value<String>> = None;
let mut metric_policy: Option<::Value<self::container::MetricPolicy>> = None;
let mut policy: 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() {
"AccessLoggingEnabled" => {
access_logging_enabled = ::serde::de::MapAccess::next_value(&mut map)?;
}
"ContainerName" => {
container_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"CorsPolicy" => {
cors_policy = ::serde::de::MapAccess::next_value(&mut map)?;
}
"LifecyclePolicy" => {
lifecycle_policy = ::serde::de::MapAccess::next_value(&mut map)?;
}
"MetricPolicy" => {
metric_policy = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Policy" => {
policy = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(ContainerProperties {
access_logging_enabled: access_logging_enabled,
container_name: container_name.ok_or(::serde::de::Error::missing_field("ContainerName"))?,
cors_policy: cors_policy,
lifecycle_policy: lifecycle_policy,
metric_policy: metric_policy,
policy: policy,
tags: tags,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for Container {
type Properties = ContainerProperties;
const TYPE: &'static str = "AWS::MediaStore::Container";
fn properties(&self) -> &ContainerProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut ContainerProperties {
&mut self.properties
}
}
impl ::private::Sealed for Container {}
impl From<ContainerProperties> for Container {
fn from(properties: ContainerProperties) -> Container {
Container { properties }
}
}
pub mod container {
//! Property types for the `Container` resource.
/// The [`AWS::MediaStore::Container.CorsRule`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html) property type.
#[derive(Debug, Default)]
pub struct CorsRule {
/// Property [`AllowedHeaders`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedheaders).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub allowed_headers: Option<::ValueList<String>>,
/// Property [`AllowedMethods`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedmethods).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub allowed_methods: Option<::ValueList<String>>,
/// Property [`AllowedOrigins`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedorigins).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub allowed_origins: Option<::ValueList<String>>,
/// Property [`ExposeHeaders`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-exposeheaders).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub expose_headers: Option<::ValueList<String>>,
/// Property [`MaxAgeSeconds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-maxageseconds).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub max_age_seconds: Option<::Value<u32>>,
}
impl ::codec::SerializeValue for CorsRule {
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 allowed_headers) = self.allowed_headers {
::serde::ser::SerializeMap::serialize_entry(&mut map, "AllowedHeaders", allowed_headers)?;
}
if let Some(ref allowed_methods) = self.allowed_methods {
::serde::ser::SerializeMap::serialize_entry(&mut map, "AllowedMethods", allowed_methods)?;
}
if let Some(ref allowed_origins) = self.allowed_origins {
::serde::ser::SerializeMap::serialize_entry(&mut map, "AllowedOrigins", allowed_origins)?;
}
if let Some(ref expose_headers) = self.expose_headers {
::serde::ser::SerializeMap::serialize_entry(&mut map, "ExposeHeaders", expose_headers)?;
}
if let Some(ref max_age_seconds) = self.max_age_seconds {
::serde::ser::SerializeMap::serialize_entry(&mut map, "MaxAgeSeconds", max_age_seconds)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for CorsRule {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<CorsRule, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = CorsRule;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type CorsRule")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut allowed_headers: Option<::ValueList<String>> = None;
let mut allowed_methods: Option<::ValueList<String>> = None;
let mut allowed_origins: Option<::ValueList<String>> = None;
let mut expose_headers: Option<::ValueList<String>> = None;
let mut max_age_seconds: Option<::Value<u32>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"AllowedHeaders" => {
allowed_headers = ::serde::de::MapAccess::next_value(&mut map)?;
}
"AllowedMethods" => {
allowed_methods = ::serde::de::MapAccess::next_value(&mut map)?;
}
"AllowedOrigins" => {
allowed_origins = ::serde::de::MapAccess::next_value(&mut map)?;
}
"ExposeHeaders" => {
expose_headers = ::serde::de::MapAccess::next_value(&mut map)?;
}
"MaxAgeSeconds" => {
max_age_seconds = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(CorsRule {
allowed_headers: allowed_headers,
allowed_methods: allowed_methods,
allowed_origins: allowed_origins,
expose_headers: expose_headers,
max_age_seconds: max_age_seconds,
})
}
}
d.deserialize_map(Visitor)
}
}
/// The [`AWS::MediaStore::Container.MetricPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicy.html) property type.
#[derive(Debug, Default)]
pub struct MetricPolicy {
/// Property [`ContainerLevelMetrics`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicy.html#cfn-mediastore-container-metricpolicy-containerlevelmetrics).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub container_level_metrics: ::Value<String>,
/// Property [`MetricPolicyRules`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicy.html#cfn-mediastore-container-metricpolicy-metricpolicyrules).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub metric_policy_rules: Option<::ValueList<MetricPolicyRule>>,
}
impl ::codec::SerializeValue for MetricPolicy {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "ContainerLevelMetrics", &self.container_level_metrics)?;
if let Some(ref metric_policy_rules) = self.metric_policy_rules {
::serde::ser::SerializeMap::serialize_entry(&mut map, "MetricPolicyRules", metric_policy_rules)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for MetricPolicy {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<MetricPolicy, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = MetricPolicy;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type MetricPolicy")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut container_level_metrics: Option<::Value<String>> = None;
let mut metric_policy_rules: Option<::ValueList<MetricPolicyRule>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"ContainerLevelMetrics" => {
container_level_metrics = ::serde::de::MapAccess::next_value(&mut map)?;
}
"MetricPolicyRules" => {
metric_policy_rules = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(MetricPolicy {
container_level_metrics: container_level_metrics.ok_or(::serde::de::Error::missing_field("ContainerLevelMetrics"))?,
metric_policy_rules: metric_policy_rules,
})
}
}
d.deserialize_map(Visitor)
}
}
/// The [`AWS::MediaStore::Container.MetricPolicyRule`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicyrule.html) property type.
#[derive(Debug, Default)]
pub struct MetricPolicyRule {
/// Property [`ObjectGroup`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicyrule.html#cfn-mediastore-container-metricpolicyrule-objectgroup).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub object_group: ::Value<String>,
/// Property [`ObjectGroupName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-metricpolicyrule.html#cfn-mediastore-container-metricpolicyrule-objectgroupname).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub object_group_name: ::Value<String>,
}
impl ::codec::SerializeValue for MetricPolicyRule {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "ObjectGroup", &self.object_group)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "ObjectGroupName", &self.object_group_name)?;
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for MetricPolicyRule {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<MetricPolicyRule, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = MetricPolicyRule;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type MetricPolicyRule")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut object_group: Option<::Value<String>> = None;
let mut object_group_name: Option<::Value<String>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"ObjectGroup" => {
object_group = ::serde::de::MapAccess::next_value(&mut map)?;
}
"ObjectGroupName" => {
object_group_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(MetricPolicyRule {
object_group: object_group.ok_or(::serde::de::Error::missing_field("ObjectGroup"))?,
object_group_name: object_group_name.ok_or(::serde::de::Error::missing_field("ObjectGroupName"))?,
})
}
}
d.deserialize_map(Visitor)
}
}
}