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
//! Types for the `CodeCommit` service.
/// The [`AWS::CodeCommit::Repository`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html) resource type.
#[derive(Debug, Default)]
pub struct Repository {
properties: RepositoryProperties
}
/// Properties for the `Repository` resource.
#[derive(Debug, Default)]
pub struct RepositoryProperties {
/// Property [`Code`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-code).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub code: Option<::Value<self::repository::Code>>,
/// Property [`RepositoryDescription`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-repositorydescription).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub repository_description: Option<::Value<String>>,
/// Property [`RepositoryName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-repositoryname).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub repository_name: ::Value<String>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-tags).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub tags: Option<::ValueList<::Tag>>,
/// Property [`Triggers`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-triggers).
///
/// Update type: _Conditional_.
/// Conditional updates can be mutable or immutable, depending on, for example, which other properties you updated.
/// For more information, see the relevant resource type documentation.
pub triggers: Option<::ValueList<self::repository::RepositoryTrigger>>,
}
impl ::serde::Serialize for RepositoryProperties {
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 code) = self.code {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Code", code)?;
}
if let Some(ref repository_description) = self.repository_description {
::serde::ser::SerializeMap::serialize_entry(&mut map, "RepositoryDescription", repository_description)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "RepositoryName", &self.repository_name)?;
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
if let Some(ref triggers) = self.triggers {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Triggers", triggers)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for RepositoryProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<RepositoryProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = RepositoryProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type RepositoryProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut code: Option<::Value<self::repository::Code>> = None;
let mut repository_description: Option<::Value<String>> = None;
let mut repository_name: Option<::Value<String>> = None;
let mut tags: Option<::ValueList<::Tag>> = None;
let mut triggers: Option<::ValueList<self::repository::RepositoryTrigger>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"Code" => {
code = ::serde::de::MapAccess::next_value(&mut map)?;
}
"RepositoryDescription" => {
repository_description = ::serde::de::MapAccess::next_value(&mut map)?;
}
"RepositoryName" => {
repository_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Triggers" => {
triggers = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(RepositoryProperties {
code: code,
repository_description: repository_description,
repository_name: repository_name.ok_or(::serde::de::Error::missing_field("RepositoryName"))?,
tags: tags,
triggers: triggers,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for Repository {
type Properties = RepositoryProperties;
const TYPE: &'static str = "AWS::CodeCommit::Repository";
fn properties(&self) -> &RepositoryProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut RepositoryProperties {
&mut self.properties
}
}
impl ::private::Sealed for Repository {}
impl From<RepositoryProperties> for Repository {
fn from(properties: RepositoryProperties) -> Repository {
Repository { properties }
}
}
pub mod repository {
//! Property types for the `Repository` resource.
/// The [`AWS::CodeCommit::Repository.Code`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-code.html) property type.
#[derive(Debug, Default)]
pub struct Code {
/// Property [`BranchName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-code.html#cfn-codecommit-repository-code-branchname).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub branch_name: Option<::Value<String>>,
/// Property [`S3`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-code.html#cfn-codecommit-repository-code-s3).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub s3: ::Value<S3>,
}
impl ::codec::SerializeValue for Code {
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 branch_name) = self.branch_name {
::serde::ser::SerializeMap::serialize_entry(&mut map, "BranchName", branch_name)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "S3", &self.s3)?;
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for Code {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<Code, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = Code;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type Code")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut branch_name: Option<::Value<String>> = None;
let mut s3: Option<::Value<S3>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"BranchName" => {
branch_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"S3" => {
s3 = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(Code {
branch_name: branch_name,
s3: s3.ok_or(::serde::de::Error::missing_field("S3"))?,
})
}
}
d.deserialize_map(Visitor)
}
}
/// The [`AWS::CodeCommit::Repository.RepositoryTrigger`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html) property type.
#[derive(Debug, Default)]
pub struct RepositoryTrigger {
/// Property [`Branches`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-branches).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub branches: Option<::ValueList<String>>,
/// Property [`CustomData`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-customdata).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub custom_data: Option<::Value<String>>,
/// Property [`DestinationArn`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-destinationarn).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub destination_arn: ::Value<String>,
/// Property [`Events`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-events).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub events: ::ValueList<String>,
/// Property [`Name`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-name).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub name: ::Value<String>,
}
impl ::codec::SerializeValue for RepositoryTrigger {
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 branches) = self.branches {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Branches", branches)?;
}
if let Some(ref custom_data) = self.custom_data {
::serde::ser::SerializeMap::serialize_entry(&mut map, "CustomData", custom_data)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "DestinationArn", &self.destination_arn)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "Events", &self.events)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "Name", &self.name)?;
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for RepositoryTrigger {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<RepositoryTrigger, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = RepositoryTrigger;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type RepositoryTrigger")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut branches: Option<::ValueList<String>> = None;
let mut custom_data: Option<::Value<String>> = None;
let mut destination_arn: Option<::Value<String>> = None;
let mut events: Option<::ValueList<String>> = None;
let mut name: Option<::Value<String>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"Branches" => {
branches = ::serde::de::MapAccess::next_value(&mut map)?;
}
"CustomData" => {
custom_data = ::serde::de::MapAccess::next_value(&mut map)?;
}
"DestinationArn" => {
destination_arn = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Events" => {
events = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Name" => {
name = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(RepositoryTrigger {
branches: branches,
custom_data: custom_data,
destination_arn: destination_arn.ok_or(::serde::de::Error::missing_field("DestinationArn"))?,
events: events.ok_or(::serde::de::Error::missing_field("Events"))?,
name: name.ok_or(::serde::de::Error::missing_field("Name"))?,
})
}
}
d.deserialize_map(Visitor)
}
}
/// The [`AWS::CodeCommit::Repository.S3`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-s3.html) property type.
#[derive(Debug, Default)]
pub struct S3 {
/// Property [`Bucket`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-s3.html#cfn-codecommit-repository-s3-bucket).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub bucket: ::Value<String>,
/// Property [`Key`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-s3.html#cfn-codecommit-repository-s3-key).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub key: ::Value<String>,
/// Property [`ObjectVersion`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-s3.html#cfn-codecommit-repository-s3-objectversion).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub object_version: Option<::Value<String>>,
}
impl ::codec::SerializeValue for S3 {
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, "Bucket", &self.bucket)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "Key", &self.key)?;
if let Some(ref object_version) = self.object_version {
::serde::ser::SerializeMap::serialize_entry(&mut map, "ObjectVersion", object_version)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for S3 {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<S3, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = S3;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type S3")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut bucket: Option<::Value<String>> = None;
let mut key: Option<::Value<String>> = None;
let mut object_version: Option<::Value<String>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"Bucket" => {
bucket = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Key" => {
key = ::serde::de::MapAccess::next_value(&mut map)?;
}
"ObjectVersion" => {
object_version = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(S3 {
bucket: bucket.ok_or(::serde::de::Error::missing_field("Bucket"))?,
key: key.ok_or(::serde::de::Error::missing_field("Key"))?,
object_version: object_version,
})
}
}
d.deserialize_map(Visitor)
}
}
}