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
//! Types for the `CodeStarNotifications` service.
/// The [`AWS::CodeStarNotifications::NotificationRule`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html) resource type.
#[derive(Debug, Default)]
pub struct NotificationRule {
properties: NotificationRuleProperties
}
/// Properties for the `NotificationRule` resource.
#[derive(Debug, Default)]
pub struct NotificationRuleProperties {
/// Property [`DetailType`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html#cfn-codestarnotifications-notificationrule-detailtype).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub detail_type: ::Value<String>,
/// Property [`EventTypeIds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html#cfn-codestarnotifications-notificationrule-eventtypeids).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub event_type_ids: ::ValueList<String>,
/// Property [`Name`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html#cfn-codestarnotifications-notificationrule-name).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub name: ::Value<String>,
/// Property [`Resource`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html#cfn-codestarnotifications-notificationrule-resource).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub resource: ::Value<String>,
/// Property [`Status`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html#cfn-codestarnotifications-notificationrule-status).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub status: Option<::Value<String>>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html#cfn-codestarnotifications-notificationrule-tags).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub tags: Option<::Value<::json::Value>>,
/// Property [`Targets`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codestarnotifications-notificationrule.html#cfn-codestarnotifications-notificationrule-targets).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub targets: ::ValueList<self::notification_rule::Target>,
}
impl ::serde::Serialize for NotificationRuleProperties {
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, "DetailType", &self.detail_type)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "EventTypeIds", &self.event_type_ids)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "Name", &self.name)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "Resource", &self.resource)?;
if let Some(ref status) = self.status {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Status", status)?;
}
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "Targets", &self.targets)?;
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for NotificationRuleProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<NotificationRuleProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = NotificationRuleProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type NotificationRuleProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut detail_type: Option<::Value<String>> = None;
let mut event_type_ids: Option<::ValueList<String>> = None;
let mut name: Option<::Value<String>> = None;
let mut resource: Option<::Value<String>> = None;
let mut status: Option<::Value<String>> = None;
let mut tags: Option<::Value<::json::Value>> = None;
let mut targets: Option<::ValueList<self::notification_rule::Target>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"DetailType" => {
detail_type = ::serde::de::MapAccess::next_value(&mut map)?;
}
"EventTypeIds" => {
event_type_ids = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Name" => {
name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Resource" => {
resource = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Status" => {
status = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Targets" => {
targets = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(NotificationRuleProperties {
detail_type: detail_type.ok_or(::serde::de::Error::missing_field("DetailType"))?,
event_type_ids: event_type_ids.ok_or(::serde::de::Error::missing_field("EventTypeIds"))?,
name: name.ok_or(::serde::de::Error::missing_field("Name"))?,
resource: resource.ok_or(::serde::de::Error::missing_field("Resource"))?,
status: status,
tags: tags,
targets: targets.ok_or(::serde::de::Error::missing_field("Targets"))?,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for NotificationRule {
type Properties = NotificationRuleProperties;
const TYPE: &'static str = "AWS::CodeStarNotifications::NotificationRule";
fn properties(&self) -> &NotificationRuleProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut NotificationRuleProperties {
&mut self.properties
}
}
impl ::private::Sealed for NotificationRule {}
impl From<NotificationRuleProperties> for NotificationRule {
fn from(properties: NotificationRuleProperties) -> NotificationRule {
NotificationRule { properties }
}
}
pub mod notification_rule {
//! Property types for the `NotificationRule` resource.
/// The [`AWS::CodeStarNotifications::NotificationRule.Target`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestarnotifications-notificationrule-target.html) property type.
#[derive(Debug, Default)]
pub struct Target {
/// Property [`TargetAddress`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestarnotifications-notificationrule-target.html#cfn-codestarnotifications-notificationrule-target-targetaddress).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub target_address: Option<::Value<String>>,
/// Property [`TargetType`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codestarnotifications-notificationrule-target.html#cfn-codestarnotifications-notificationrule-target-targettype).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub target_type: Option<::Value<String>>,
}
impl ::codec::SerializeValue for Target {
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 target_address) = self.target_address {
::serde::ser::SerializeMap::serialize_entry(&mut map, "TargetAddress", target_address)?;
}
if let Some(ref target_type) = self.target_type {
::serde::ser::SerializeMap::serialize_entry(&mut map, "TargetType", target_type)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl ::codec::DeserializeValue for Target {
fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<Target, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = Target;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type Target")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut target_address: Option<::Value<String>> = None;
let mut target_type: Option<::Value<String>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"TargetAddress" => {
target_address = ::serde::de::MapAccess::next_value(&mut map)?;
}
"TargetType" => {
target_type = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(Target {
target_address: target_address,
target_type: target_type,
})
}
}
d.deserialize_map(Visitor)
}
}
}