cfn/aws/
synthetics.rs

1//! Types for the `Synthetics` service.
2
3/// The [`AWS::Synthetics::Canary`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html) resource type.
4#[derive(Debug, Default)]
5pub struct Canary {
6    properties: CanaryProperties
7}
8
9/// Properties for the `Canary` resource.
10#[derive(Debug, Default)]
11pub struct CanaryProperties {
12    /// Property [`ArtifactS3Location`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-artifacts3location).
13    ///
14    /// Update type: _Mutable_.
15    /// AWS CloudFormation doesn't replace the resource when you change this property.
16    pub artifact_s3_location: ::Value<String>,
17    /// Property [`Code`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-code).
18    ///
19    /// Update type: _Mutable_.
20    /// AWS CloudFormation doesn't replace the resource when you change this property.
21    pub code: ::Value<self::canary::Code>,
22    /// Property [`ExecutionRoleArn`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-executionrolearn).
23    ///
24    /// Update type: _Mutable_.
25    /// AWS CloudFormation doesn't replace the resource when you change this property.
26    pub execution_role_arn: ::Value<String>,
27    /// Property [`FailureRetentionPeriod`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-failureretentionperiod).
28    ///
29    /// Update type: _Mutable_.
30    /// AWS CloudFormation doesn't replace the resource when you change this property.
31    pub failure_retention_period: Option<::Value<u32>>,
32    /// Property [`Name`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-name).
33    ///
34    /// Update type: _Immutable_.
35    /// AWS CloudFormation replaces the resource when you change this property.
36    pub name: ::Value<String>,
37    /// Property [`RunConfig`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-runconfig).
38    ///
39    /// Update type: _Mutable_.
40    /// AWS CloudFormation doesn't replace the resource when you change this property.
41    pub run_config: Option<::Value<self::canary::RunConfig>>,
42    /// Property [`RuntimeVersion`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-runtimeversion).
43    ///
44    /// Update type: _Mutable_.
45    /// AWS CloudFormation doesn't replace the resource when you change this property.
46    pub runtime_version: ::Value<String>,
47    /// Property [`Schedule`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-schedule).
48    ///
49    /// Update type: _Mutable_.
50    /// AWS CloudFormation doesn't replace the resource when you change this property.
51    pub schedule: ::Value<self::canary::Schedule>,
52    /// Property [`StartCanaryAfterCreation`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-startcanaryaftercreation).
53    ///
54    /// Update type: _Mutable_.
55    /// AWS CloudFormation doesn't replace the resource when you change this property.
56    pub start_canary_after_creation: ::Value<bool>,
57    /// Property [`SuccessRetentionPeriod`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-successretentionperiod).
58    ///
59    /// Update type: _Mutable_.
60    /// AWS CloudFormation doesn't replace the resource when you change this property.
61    pub success_retention_period: Option<::Value<u32>>,
62    /// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-tags).
63    ///
64    /// Update type: _Mutable_.
65    /// AWS CloudFormation doesn't replace the resource when you change this property.
66    pub tags: Option<::ValueList<::Tag>>,
67    /// Property [`VPCConfig`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-vpcconfig).
68    ///
69    /// Update type: _Mutable_.
70    /// AWS CloudFormation doesn't replace the resource when you change this property.
71    pub vpc_config: Option<::Value<self::canary::VPCConfig>>,
72}
73
74impl ::serde::Serialize for CanaryProperties {
75    fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
76        let mut map = ::serde::Serializer::serialize_map(s, None)?;
77        ::serde::ser::SerializeMap::serialize_entry(&mut map, "ArtifactS3Location", &self.artifact_s3_location)?;
78        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Code", &self.code)?;
79        ::serde::ser::SerializeMap::serialize_entry(&mut map, "ExecutionRoleArn", &self.execution_role_arn)?;
80        if let Some(ref failure_retention_period) = self.failure_retention_period {
81            ::serde::ser::SerializeMap::serialize_entry(&mut map, "FailureRetentionPeriod", failure_retention_period)?;
82        }
83        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Name", &self.name)?;
84        if let Some(ref run_config) = self.run_config {
85            ::serde::ser::SerializeMap::serialize_entry(&mut map, "RunConfig", run_config)?;
86        }
87        ::serde::ser::SerializeMap::serialize_entry(&mut map, "RuntimeVersion", &self.runtime_version)?;
88        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Schedule", &self.schedule)?;
89        ::serde::ser::SerializeMap::serialize_entry(&mut map, "StartCanaryAfterCreation", &self.start_canary_after_creation)?;
90        if let Some(ref success_retention_period) = self.success_retention_period {
91            ::serde::ser::SerializeMap::serialize_entry(&mut map, "SuccessRetentionPeriod", success_retention_period)?;
92        }
93        if let Some(ref tags) = self.tags {
94            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
95        }
96        if let Some(ref vpc_config) = self.vpc_config {
97            ::serde::ser::SerializeMap::serialize_entry(&mut map, "VPCConfig", vpc_config)?;
98        }
99        ::serde::ser::SerializeMap::end(map)
100    }
101}
102
103impl<'de> ::serde::Deserialize<'de> for CanaryProperties {
104    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<CanaryProperties, D::Error> {
105        struct Visitor;
106
107        impl<'de> ::serde::de::Visitor<'de> for Visitor {
108            type Value = CanaryProperties;
109
110            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
111                write!(f, "a struct of type CanaryProperties")
112            }
113
114            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
115                let mut artifact_s3_location: Option<::Value<String>> = None;
116                let mut code: Option<::Value<self::canary::Code>> = None;
117                let mut execution_role_arn: Option<::Value<String>> = None;
118                let mut failure_retention_period: Option<::Value<u32>> = None;
119                let mut name: Option<::Value<String>> = None;
120                let mut run_config: Option<::Value<self::canary::RunConfig>> = None;
121                let mut runtime_version: Option<::Value<String>> = None;
122                let mut schedule: Option<::Value<self::canary::Schedule>> = None;
123                let mut start_canary_after_creation: Option<::Value<bool>> = None;
124                let mut success_retention_period: Option<::Value<u32>> = None;
125                let mut tags: Option<::ValueList<::Tag>> = None;
126                let mut vpc_config: Option<::Value<self::canary::VPCConfig>> = None;
127
128                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
129                    match __cfn_key.as_ref() {
130                        "ArtifactS3Location" => {
131                            artifact_s3_location = ::serde::de::MapAccess::next_value(&mut map)?;
132                        }
133                        "Code" => {
134                            code = ::serde::de::MapAccess::next_value(&mut map)?;
135                        }
136                        "ExecutionRoleArn" => {
137                            execution_role_arn = ::serde::de::MapAccess::next_value(&mut map)?;
138                        }
139                        "FailureRetentionPeriod" => {
140                            failure_retention_period = ::serde::de::MapAccess::next_value(&mut map)?;
141                        }
142                        "Name" => {
143                            name = ::serde::de::MapAccess::next_value(&mut map)?;
144                        }
145                        "RunConfig" => {
146                            run_config = ::serde::de::MapAccess::next_value(&mut map)?;
147                        }
148                        "RuntimeVersion" => {
149                            runtime_version = ::serde::de::MapAccess::next_value(&mut map)?;
150                        }
151                        "Schedule" => {
152                            schedule = ::serde::de::MapAccess::next_value(&mut map)?;
153                        }
154                        "StartCanaryAfterCreation" => {
155                            start_canary_after_creation = ::serde::de::MapAccess::next_value(&mut map)?;
156                        }
157                        "SuccessRetentionPeriod" => {
158                            success_retention_period = ::serde::de::MapAccess::next_value(&mut map)?;
159                        }
160                        "Tags" => {
161                            tags = ::serde::de::MapAccess::next_value(&mut map)?;
162                        }
163                        "VPCConfig" => {
164                            vpc_config = ::serde::de::MapAccess::next_value(&mut map)?;
165                        }
166                        _ => {}
167                    }
168                }
169
170                Ok(CanaryProperties {
171                    artifact_s3_location: artifact_s3_location.ok_or(::serde::de::Error::missing_field("ArtifactS3Location"))?,
172                    code: code.ok_or(::serde::de::Error::missing_field("Code"))?,
173                    execution_role_arn: execution_role_arn.ok_or(::serde::de::Error::missing_field("ExecutionRoleArn"))?,
174                    failure_retention_period: failure_retention_period,
175                    name: name.ok_or(::serde::de::Error::missing_field("Name"))?,
176                    run_config: run_config,
177                    runtime_version: runtime_version.ok_or(::serde::de::Error::missing_field("RuntimeVersion"))?,
178                    schedule: schedule.ok_or(::serde::de::Error::missing_field("Schedule"))?,
179                    start_canary_after_creation: start_canary_after_creation.ok_or(::serde::de::Error::missing_field("StartCanaryAfterCreation"))?,
180                    success_retention_period: success_retention_period,
181                    tags: tags,
182                    vpc_config: vpc_config,
183                })
184            }
185        }
186
187        d.deserialize_map(Visitor)
188    }
189}
190
191impl ::Resource for Canary {
192    type Properties = CanaryProperties;
193    const TYPE: &'static str = "AWS::Synthetics::Canary";
194    fn properties(&self) -> &CanaryProperties {
195        &self.properties
196    }
197    fn properties_mut(&mut self) -> &mut CanaryProperties {
198        &mut self.properties
199    }
200}
201
202impl ::private::Sealed for Canary {}
203
204impl From<CanaryProperties> for Canary {
205    fn from(properties: CanaryProperties) -> Canary {
206        Canary { properties }
207    }
208}
209
210pub mod canary {
211    //! Property types for the `Canary` resource.
212
213    /// The [`AWS::Synthetics::Canary.Code`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html) property type.
214    #[derive(Debug, Default)]
215    pub struct Code {
216        /// Property [`Handler`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-handler).
217        ///
218        /// Update type: _Mutable_.
219        /// AWS CloudFormation doesn't replace the resource when you change this property.
220        pub handler: ::Value<String>,
221        /// Property [`S3Bucket`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-s3bucket).
222        ///
223        /// Update type: _Mutable_.
224        /// AWS CloudFormation doesn't replace the resource when you change this property.
225        pub s3_bucket: Option<::Value<String>>,
226        /// Property [`S3Key`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-s3key).
227        ///
228        /// Update type: _Mutable_.
229        /// AWS CloudFormation doesn't replace the resource when you change this property.
230        pub s3_key: Option<::Value<String>>,
231        /// Property [`S3ObjectVersion`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-s3objectversion).
232        ///
233        /// Update type: _Mutable_.
234        /// AWS CloudFormation doesn't replace the resource when you change this property.
235        pub s3_object_version: Option<::Value<String>>,
236        /// Property [`Script`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-script).
237        ///
238        /// Update type: _Mutable_.
239        /// AWS CloudFormation doesn't replace the resource when you change this property.
240        pub script: Option<::Value<String>>,
241    }
242
243    impl ::codec::SerializeValue for Code {
244        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
245            let mut map = ::serde::Serializer::serialize_map(s, None)?;
246            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Handler", &self.handler)?;
247            if let Some(ref s3_bucket) = self.s3_bucket {
248                ::serde::ser::SerializeMap::serialize_entry(&mut map, "S3Bucket", s3_bucket)?;
249            }
250            if let Some(ref s3_key) = self.s3_key {
251                ::serde::ser::SerializeMap::serialize_entry(&mut map, "S3Key", s3_key)?;
252            }
253            if let Some(ref s3_object_version) = self.s3_object_version {
254                ::serde::ser::SerializeMap::serialize_entry(&mut map, "S3ObjectVersion", s3_object_version)?;
255            }
256            if let Some(ref script) = self.script {
257                ::serde::ser::SerializeMap::serialize_entry(&mut map, "Script", script)?;
258            }
259            ::serde::ser::SerializeMap::end(map)
260        }
261    }
262
263    impl ::codec::DeserializeValue for Code {
264        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<Code, D::Error> {
265            struct Visitor;
266
267            impl<'de> ::serde::de::Visitor<'de> for Visitor {
268                type Value = Code;
269
270                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
271                    write!(f, "a struct of type Code")
272                }
273
274                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
275                    let mut handler: Option<::Value<String>> = None;
276                    let mut s3_bucket: Option<::Value<String>> = None;
277                    let mut s3_key: Option<::Value<String>> = None;
278                    let mut s3_object_version: Option<::Value<String>> = None;
279                    let mut script: Option<::Value<String>> = None;
280
281                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
282                        match __cfn_key.as_ref() {
283                            "Handler" => {
284                                handler = ::serde::de::MapAccess::next_value(&mut map)?;
285                            }
286                            "S3Bucket" => {
287                                s3_bucket = ::serde::de::MapAccess::next_value(&mut map)?;
288                            }
289                            "S3Key" => {
290                                s3_key = ::serde::de::MapAccess::next_value(&mut map)?;
291                            }
292                            "S3ObjectVersion" => {
293                                s3_object_version = ::serde::de::MapAccess::next_value(&mut map)?;
294                            }
295                            "Script" => {
296                                script = ::serde::de::MapAccess::next_value(&mut map)?;
297                            }
298                            _ => {}
299                        }
300                    }
301
302                    Ok(Code {
303                        handler: handler.ok_or(::serde::de::Error::missing_field("Handler"))?,
304                        s3_bucket: s3_bucket,
305                        s3_key: s3_key,
306                        s3_object_version: s3_object_version,
307                        script: script,
308                    })
309                }
310            }
311
312            d.deserialize_map(Visitor)
313        }
314    }
315
316    /// The [`AWS::Synthetics::Canary.RunConfig`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html) property type.
317    #[derive(Debug, Default)]
318    pub struct RunConfig {
319        /// Property [`ActiveTracing`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-activetracing).
320        ///
321        /// Update type: _Mutable_.
322        /// AWS CloudFormation doesn't replace the resource when you change this property.
323        pub active_tracing: Option<::Value<bool>>,
324        /// Property [`EnvironmentVariables`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-environmentvariables).
325        ///
326        /// Update type: _Mutable_.
327        /// AWS CloudFormation doesn't replace the resource when you change this property.
328        pub environment_variables: Option<::ValueMap<String>>,
329        /// Property [`MemoryInMB`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-memoryinmb).
330        ///
331        /// Update type: _Mutable_.
332        /// AWS CloudFormation doesn't replace the resource when you change this property.
333        pub memory_in_mb: Option<::Value<u32>>,
334        /// Property [`TimeoutInSeconds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-timeoutinseconds).
335        ///
336        /// Update type: _Mutable_.
337        /// AWS CloudFormation doesn't replace the resource when you change this property.
338        pub timeout_in_seconds: Option<::Value<u32>>,
339    }
340
341    impl ::codec::SerializeValue for RunConfig {
342        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
343            let mut map = ::serde::Serializer::serialize_map(s, None)?;
344            if let Some(ref active_tracing) = self.active_tracing {
345                ::serde::ser::SerializeMap::serialize_entry(&mut map, "ActiveTracing", active_tracing)?;
346            }
347            if let Some(ref environment_variables) = self.environment_variables {
348                ::serde::ser::SerializeMap::serialize_entry(&mut map, "EnvironmentVariables", environment_variables)?;
349            }
350            if let Some(ref memory_in_mb) = self.memory_in_mb {
351                ::serde::ser::SerializeMap::serialize_entry(&mut map, "MemoryInMB", memory_in_mb)?;
352            }
353            if let Some(ref timeout_in_seconds) = self.timeout_in_seconds {
354                ::serde::ser::SerializeMap::serialize_entry(&mut map, "TimeoutInSeconds", timeout_in_seconds)?;
355            }
356            ::serde::ser::SerializeMap::end(map)
357        }
358    }
359
360    impl ::codec::DeserializeValue for RunConfig {
361        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<RunConfig, D::Error> {
362            struct Visitor;
363
364            impl<'de> ::serde::de::Visitor<'de> for Visitor {
365                type Value = RunConfig;
366
367                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
368                    write!(f, "a struct of type RunConfig")
369                }
370
371                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
372                    let mut active_tracing: Option<::Value<bool>> = None;
373                    let mut environment_variables: Option<::ValueMap<String>> = None;
374                    let mut memory_in_mb: Option<::Value<u32>> = None;
375                    let mut timeout_in_seconds: Option<::Value<u32>> = None;
376
377                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
378                        match __cfn_key.as_ref() {
379                            "ActiveTracing" => {
380                                active_tracing = ::serde::de::MapAccess::next_value(&mut map)?;
381                            }
382                            "EnvironmentVariables" => {
383                                environment_variables = ::serde::de::MapAccess::next_value(&mut map)?;
384                            }
385                            "MemoryInMB" => {
386                                memory_in_mb = ::serde::de::MapAccess::next_value(&mut map)?;
387                            }
388                            "TimeoutInSeconds" => {
389                                timeout_in_seconds = ::serde::de::MapAccess::next_value(&mut map)?;
390                            }
391                            _ => {}
392                        }
393                    }
394
395                    Ok(RunConfig {
396                        active_tracing: active_tracing,
397                        environment_variables: environment_variables,
398                        memory_in_mb: memory_in_mb,
399                        timeout_in_seconds: timeout_in_seconds,
400                    })
401                }
402            }
403
404            d.deserialize_map(Visitor)
405        }
406    }
407
408    /// The [`AWS::Synthetics::Canary.Schedule`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-schedule.html) property type.
409    #[derive(Debug, Default)]
410    pub struct Schedule {
411        /// Property [`DurationInSeconds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-schedule.html#cfn-synthetics-canary-schedule-durationinseconds).
412        ///
413        /// Update type: _Mutable_.
414        /// AWS CloudFormation doesn't replace the resource when you change this property.
415        pub duration_in_seconds: Option<::Value<String>>,
416        /// Property [`Expression`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-schedule.html#cfn-synthetics-canary-schedule-expression).
417        ///
418        /// Update type: _Mutable_.
419        /// AWS CloudFormation doesn't replace the resource when you change this property.
420        pub expression: ::Value<String>,
421    }
422
423    impl ::codec::SerializeValue for Schedule {
424        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
425            let mut map = ::serde::Serializer::serialize_map(s, None)?;
426            if let Some(ref duration_in_seconds) = self.duration_in_seconds {
427                ::serde::ser::SerializeMap::serialize_entry(&mut map, "DurationInSeconds", duration_in_seconds)?;
428            }
429            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Expression", &self.expression)?;
430            ::serde::ser::SerializeMap::end(map)
431        }
432    }
433
434    impl ::codec::DeserializeValue for Schedule {
435        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<Schedule, D::Error> {
436            struct Visitor;
437
438            impl<'de> ::serde::de::Visitor<'de> for Visitor {
439                type Value = Schedule;
440
441                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
442                    write!(f, "a struct of type Schedule")
443                }
444
445                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
446                    let mut duration_in_seconds: Option<::Value<String>> = None;
447                    let mut expression: Option<::Value<String>> = None;
448
449                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
450                        match __cfn_key.as_ref() {
451                            "DurationInSeconds" => {
452                                duration_in_seconds = ::serde::de::MapAccess::next_value(&mut map)?;
453                            }
454                            "Expression" => {
455                                expression = ::serde::de::MapAccess::next_value(&mut map)?;
456                            }
457                            _ => {}
458                        }
459                    }
460
461                    Ok(Schedule {
462                        duration_in_seconds: duration_in_seconds,
463                        expression: expression.ok_or(::serde::de::Error::missing_field("Expression"))?,
464                    })
465                }
466            }
467
468            d.deserialize_map(Visitor)
469        }
470    }
471
472    /// The [`AWS::Synthetics::Canary.VPCConfig`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html) property type.
473    #[derive(Debug, Default)]
474    pub struct VPCConfig {
475        /// Property [`SecurityGroupIds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html#cfn-synthetics-canary-vpcconfig-securitygroupids).
476        ///
477        /// Update type: _Mutable_.
478        /// AWS CloudFormation doesn't replace the resource when you change this property.
479        pub security_group_ids: ::ValueList<String>,
480        /// Property [`SubnetIds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html#cfn-synthetics-canary-vpcconfig-subnetids).
481        ///
482        /// Update type: _Mutable_.
483        /// AWS CloudFormation doesn't replace the resource when you change this property.
484        pub subnet_ids: ::ValueList<String>,
485        /// Property [`VpcId`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html#cfn-synthetics-canary-vpcconfig-vpcid).
486        ///
487        /// Update type: _Mutable_.
488        /// AWS CloudFormation doesn't replace the resource when you change this property.
489        pub vpc_id: Option<::Value<String>>,
490    }
491
492    impl ::codec::SerializeValue for VPCConfig {
493        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
494            let mut map = ::serde::Serializer::serialize_map(s, None)?;
495            ::serde::ser::SerializeMap::serialize_entry(&mut map, "SecurityGroupIds", &self.security_group_ids)?;
496            ::serde::ser::SerializeMap::serialize_entry(&mut map, "SubnetIds", &self.subnet_ids)?;
497            if let Some(ref vpc_id) = self.vpc_id {
498                ::serde::ser::SerializeMap::serialize_entry(&mut map, "VpcId", vpc_id)?;
499            }
500            ::serde::ser::SerializeMap::end(map)
501        }
502    }
503
504    impl ::codec::DeserializeValue for VPCConfig {
505        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<VPCConfig, D::Error> {
506            struct Visitor;
507
508            impl<'de> ::serde::de::Visitor<'de> for Visitor {
509                type Value = VPCConfig;
510
511                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
512                    write!(f, "a struct of type VPCConfig")
513                }
514
515                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
516                    let mut security_group_ids: Option<::ValueList<String>> = None;
517                    let mut subnet_ids: Option<::ValueList<String>> = None;
518                    let mut vpc_id: Option<::Value<String>> = None;
519
520                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
521                        match __cfn_key.as_ref() {
522                            "SecurityGroupIds" => {
523                                security_group_ids = ::serde::de::MapAccess::next_value(&mut map)?;
524                            }
525                            "SubnetIds" => {
526                                subnet_ids = ::serde::de::MapAccess::next_value(&mut map)?;
527                            }
528                            "VpcId" => {
529                                vpc_id = ::serde::de::MapAccess::next_value(&mut map)?;
530                            }
531                            _ => {}
532                        }
533                    }
534
535                    Ok(VPCConfig {
536                        security_group_ids: security_group_ids.ok_or(::serde::de::Error::missing_field("SecurityGroupIds"))?,
537                        subnet_ids: subnet_ids.ok_or(::serde::de::Error::missing_field("SubnetIds"))?,
538                        vpc_id: vpc_id,
539                    })
540                }
541            }
542
543            d.deserialize_map(Visitor)
544        }
545    }
546}