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
//! Types for the `CodeGuruReviewer` service.
/// The [`AWS::CodeGuruReviewer::RepositoryAssociation`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codegurureviewer-repositoryassociation.html) resource type.
#[derive(Debug, Default)]
pub struct RepositoryAssociation {
properties: RepositoryAssociationProperties
}
/// Properties for the `RepositoryAssociation` resource.
#[derive(Debug, Default)]
pub struct RepositoryAssociationProperties {
/// Property [`BucketName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codegurureviewer-repositoryassociation.html#cfn-codegurureviewer-repositoryassociation-bucketname).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub bucket_name: Option<::Value<String>>,
/// Property [`ConnectionArn`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codegurureviewer-repositoryassociation.html#cfn-codegurureviewer-repositoryassociation-connectionarn).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub connection_arn: Option<::Value<String>>,
/// Property [`Name`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codegurureviewer-repositoryassociation.html#cfn-codegurureviewer-repositoryassociation-name).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub name: ::Value<String>,
/// Property [`Owner`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codegurureviewer-repositoryassociation.html#cfn-codegurureviewer-repositoryassociation-owner).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub owner: Option<::Value<String>>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codegurureviewer-repositoryassociation.html#cfn-codegurureviewer-repositoryassociation-tags).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub tags: Option<::ValueList<::Tag>>,
/// Property [`Type`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codegurureviewer-repositoryassociation.html#cfn-codegurureviewer-repositoryassociation-type).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub r#type: ::Value<String>,
}
impl ::serde::Serialize for RepositoryAssociationProperties {
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 bucket_name) = self.bucket_name {
::serde::ser::SerializeMap::serialize_entry(&mut map, "BucketName", bucket_name)?;
}
if let Some(ref connection_arn) = self.connection_arn {
::serde::ser::SerializeMap::serialize_entry(&mut map, "ConnectionArn", connection_arn)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "Name", &self.name)?;
if let Some(ref owner) = self.owner {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Owner", owner)?;
}
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "Type", &self.r#type)?;
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for RepositoryAssociationProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<RepositoryAssociationProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = RepositoryAssociationProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type RepositoryAssociationProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut bucket_name: Option<::Value<String>> = None;
let mut connection_arn: Option<::Value<String>> = None;
let mut name: Option<::Value<String>> = None;
let mut owner: Option<::Value<String>> = None;
let mut tags: Option<::ValueList<::Tag>> = None;
let mut r#type: Option<::Value<String>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"BucketName" => {
bucket_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"ConnectionArn" => {
connection_arn = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Name" => {
name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Owner" => {
owner = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Type" => {
r#type = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(RepositoryAssociationProperties {
bucket_name: bucket_name,
connection_arn: connection_arn,
name: name.ok_or(::serde::de::Error::missing_field("Name"))?,
owner: owner,
tags: tags,
r#type: r#type.ok_or(::serde::de::Error::missing_field("Type"))?,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for RepositoryAssociation {
type Properties = RepositoryAssociationProperties;
const TYPE: &'static str = "AWS::CodeGuruReviewer::RepositoryAssociation";
fn properties(&self) -> &RepositoryAssociationProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut RepositoryAssociationProperties {
&mut self.properties
}
}
impl ::private::Sealed for RepositoryAssociation {}
impl From<RepositoryAssociationProperties> for RepositoryAssociation {
fn from(properties: RepositoryAssociationProperties) -> RepositoryAssociation {
RepositoryAssociation { properties }
}
}