cfn/aws/
elasticloadbalancing.rs

1//! Types for the `ElasticLoadBalancing` service.
2
3/// The [`AWS::ElasticLoadBalancing::LoadBalancer`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html) resource type.
4#[derive(Debug, Default)]
5pub struct LoadBalancer {
6    properties: LoadBalancerProperties
7}
8
9/// Properties for the `LoadBalancer` resource.
10#[derive(Debug, Default)]
11pub struct LoadBalancerProperties {
12    /// Property [`AccessLoggingPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-accessloggingpolicy).
13    ///
14    /// Update type: _Mutable_.
15    /// AWS CloudFormation doesn't replace the resource when you change this property.
16    pub access_logging_policy: Option<::Value<self::load_balancer::AccessLoggingPolicy>>,
17    /// Property [`AppCookieStickinessPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-appcookiestickinesspolicy).
18    ///
19    /// Update type: _Mutable_.
20    /// AWS CloudFormation doesn't replace the resource when you change this property.
21    pub app_cookie_stickiness_policy: Option<::ValueList<self::load_balancer::AppCookieStickinessPolicy>>,
22    /// Property [`AvailabilityZones`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-availabilityzones).
23    ///
24    /// Update type: _Conditional_.
25    /// Conditional updates can be mutable or immutable, depending on, for example, which other properties you updated.
26    /// For more information, see the relevant resource type documentation.
27    pub availability_zones: Option<::ValueList<String>>,
28    /// Property [`ConnectionDrainingPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-connectiondrainingpolicy).
29    ///
30    /// Update type: _Mutable_.
31    /// AWS CloudFormation doesn't replace the resource when you change this property.
32    pub connection_draining_policy: Option<::Value<self::load_balancer::ConnectionDrainingPolicy>>,
33    /// Property [`ConnectionSettings`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-connectionsettings).
34    ///
35    /// Update type: _Mutable_.
36    /// AWS CloudFormation doesn't replace the resource when you change this property.
37    pub connection_settings: Option<::Value<self::load_balancer::ConnectionSettings>>,
38    /// Property [`CrossZone`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-crosszone).
39    ///
40    /// Update type: _Mutable_.
41    /// AWS CloudFormation doesn't replace the resource when you change this property.
42    pub cross_zone: Option<::Value<bool>>,
43    /// Property [`HealthCheck`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-healthcheck).
44    ///
45    /// Update type: _Conditional_.
46    /// Conditional updates can be mutable or immutable, depending on, for example, which other properties you updated.
47    /// For more information, see the relevant resource type documentation.
48    pub health_check: Option<::Value<self::load_balancer::HealthCheck>>,
49    /// Property [`Instances`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-instances).
50    ///
51    /// Update type: _Mutable_.
52    /// AWS CloudFormation doesn't replace the resource when you change this property.
53    pub instances: Option<::ValueList<String>>,
54    /// Property [`LBCookieStickinessPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-lbcookiestickinesspolicy).
55    ///
56    /// Update type: _Mutable_.
57    /// AWS CloudFormation doesn't replace the resource when you change this property.
58    pub lb_cookie_stickiness_policy: Option<::ValueList<self::load_balancer::LBCookieStickinessPolicy>>,
59    /// Property [`Listeners`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-listeners).
60    ///
61    /// Update type: _Mutable_.
62    /// AWS CloudFormation doesn't replace the resource when you change this property.
63    pub listeners: ::ValueList<self::load_balancer::Listeners>,
64    /// Property [`LoadBalancerName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-elbname).
65    ///
66    /// Update type: _Immutable_.
67    /// AWS CloudFormation replaces the resource when you change this property.
68    pub load_balancer_name: Option<::Value<String>>,
69    /// Property [`Policies`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-policies).
70    ///
71    /// Update type: _Mutable_.
72    /// AWS CloudFormation doesn't replace the resource when you change this property.
73    pub policies: Option<::ValueList<self::load_balancer::Policies>>,
74    /// Property [`Scheme`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-scheme).
75    ///
76    /// Update type: _Immutable_.
77    /// AWS CloudFormation replaces the resource when you change this property.
78    pub scheme: Option<::Value<String>>,
79    /// Property [`SecurityGroups`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-securitygroups).
80    ///
81    /// Update type: _Mutable_.
82    /// AWS CloudFormation doesn't replace the resource when you change this property.
83    pub security_groups: Option<::ValueList<String>>,
84    /// Property [`Subnets`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-ec2-elb-subnets).
85    ///
86    /// Update type: _Conditional_.
87    /// Conditional updates can be mutable or immutable, depending on, for example, which other properties you updated.
88    /// For more information, see the relevant resource type documentation.
89    pub subnets: Option<::ValueList<String>>,
90    /// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html#cfn-elasticloadbalancing-loadbalancer-tags).
91    ///
92    /// Update type: _Mutable_.
93    /// AWS CloudFormation doesn't replace the resource when you change this property.
94    pub tags: Option<::ValueList<::Tag>>,
95}
96
97impl ::serde::Serialize for LoadBalancerProperties {
98    fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
99        let mut map = ::serde::Serializer::serialize_map(s, None)?;
100        if let Some(ref access_logging_policy) = self.access_logging_policy {
101            ::serde::ser::SerializeMap::serialize_entry(&mut map, "AccessLoggingPolicy", access_logging_policy)?;
102        }
103        if let Some(ref app_cookie_stickiness_policy) = self.app_cookie_stickiness_policy {
104            ::serde::ser::SerializeMap::serialize_entry(&mut map, "AppCookieStickinessPolicy", app_cookie_stickiness_policy)?;
105        }
106        if let Some(ref availability_zones) = self.availability_zones {
107            ::serde::ser::SerializeMap::serialize_entry(&mut map, "AvailabilityZones", availability_zones)?;
108        }
109        if let Some(ref connection_draining_policy) = self.connection_draining_policy {
110            ::serde::ser::SerializeMap::serialize_entry(&mut map, "ConnectionDrainingPolicy", connection_draining_policy)?;
111        }
112        if let Some(ref connection_settings) = self.connection_settings {
113            ::serde::ser::SerializeMap::serialize_entry(&mut map, "ConnectionSettings", connection_settings)?;
114        }
115        if let Some(ref cross_zone) = self.cross_zone {
116            ::serde::ser::SerializeMap::serialize_entry(&mut map, "CrossZone", cross_zone)?;
117        }
118        if let Some(ref health_check) = self.health_check {
119            ::serde::ser::SerializeMap::serialize_entry(&mut map, "HealthCheck", health_check)?;
120        }
121        if let Some(ref instances) = self.instances {
122            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Instances", instances)?;
123        }
124        if let Some(ref lb_cookie_stickiness_policy) = self.lb_cookie_stickiness_policy {
125            ::serde::ser::SerializeMap::serialize_entry(&mut map, "LBCookieStickinessPolicy", lb_cookie_stickiness_policy)?;
126        }
127        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Listeners", &self.listeners)?;
128        if let Some(ref load_balancer_name) = self.load_balancer_name {
129            ::serde::ser::SerializeMap::serialize_entry(&mut map, "LoadBalancerName", load_balancer_name)?;
130        }
131        if let Some(ref policies) = self.policies {
132            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Policies", policies)?;
133        }
134        if let Some(ref scheme) = self.scheme {
135            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Scheme", scheme)?;
136        }
137        if let Some(ref security_groups) = self.security_groups {
138            ::serde::ser::SerializeMap::serialize_entry(&mut map, "SecurityGroups", security_groups)?;
139        }
140        if let Some(ref subnets) = self.subnets {
141            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Subnets", subnets)?;
142        }
143        if let Some(ref tags) = self.tags {
144            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
145        }
146        ::serde::ser::SerializeMap::end(map)
147    }
148}
149
150impl<'de> ::serde::Deserialize<'de> for LoadBalancerProperties {
151    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<LoadBalancerProperties, D::Error> {
152        struct Visitor;
153
154        impl<'de> ::serde::de::Visitor<'de> for Visitor {
155            type Value = LoadBalancerProperties;
156
157            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
158                write!(f, "a struct of type LoadBalancerProperties")
159            }
160
161            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
162                let mut access_logging_policy: Option<::Value<self::load_balancer::AccessLoggingPolicy>> = None;
163                let mut app_cookie_stickiness_policy: Option<::ValueList<self::load_balancer::AppCookieStickinessPolicy>> = None;
164                let mut availability_zones: Option<::ValueList<String>> = None;
165                let mut connection_draining_policy: Option<::Value<self::load_balancer::ConnectionDrainingPolicy>> = None;
166                let mut connection_settings: Option<::Value<self::load_balancer::ConnectionSettings>> = None;
167                let mut cross_zone: Option<::Value<bool>> = None;
168                let mut health_check: Option<::Value<self::load_balancer::HealthCheck>> = None;
169                let mut instances: Option<::ValueList<String>> = None;
170                let mut lb_cookie_stickiness_policy: Option<::ValueList<self::load_balancer::LBCookieStickinessPolicy>> = None;
171                let mut listeners: Option<::ValueList<self::load_balancer::Listeners>> = None;
172                let mut load_balancer_name: Option<::Value<String>> = None;
173                let mut policies: Option<::ValueList<self::load_balancer::Policies>> = None;
174                let mut scheme: Option<::Value<String>> = None;
175                let mut security_groups: Option<::ValueList<String>> = None;
176                let mut subnets: Option<::ValueList<String>> = None;
177                let mut tags: Option<::ValueList<::Tag>> = None;
178
179                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
180                    match __cfn_key.as_ref() {
181                        "AccessLoggingPolicy" => {
182                            access_logging_policy = ::serde::de::MapAccess::next_value(&mut map)?;
183                        }
184                        "AppCookieStickinessPolicy" => {
185                            app_cookie_stickiness_policy = ::serde::de::MapAccess::next_value(&mut map)?;
186                        }
187                        "AvailabilityZones" => {
188                            availability_zones = ::serde::de::MapAccess::next_value(&mut map)?;
189                        }
190                        "ConnectionDrainingPolicy" => {
191                            connection_draining_policy = ::serde::de::MapAccess::next_value(&mut map)?;
192                        }
193                        "ConnectionSettings" => {
194                            connection_settings = ::serde::de::MapAccess::next_value(&mut map)?;
195                        }
196                        "CrossZone" => {
197                            cross_zone = ::serde::de::MapAccess::next_value(&mut map)?;
198                        }
199                        "HealthCheck" => {
200                            health_check = ::serde::de::MapAccess::next_value(&mut map)?;
201                        }
202                        "Instances" => {
203                            instances = ::serde::de::MapAccess::next_value(&mut map)?;
204                        }
205                        "LBCookieStickinessPolicy" => {
206                            lb_cookie_stickiness_policy = ::serde::de::MapAccess::next_value(&mut map)?;
207                        }
208                        "Listeners" => {
209                            listeners = ::serde::de::MapAccess::next_value(&mut map)?;
210                        }
211                        "LoadBalancerName" => {
212                            load_balancer_name = ::serde::de::MapAccess::next_value(&mut map)?;
213                        }
214                        "Policies" => {
215                            policies = ::serde::de::MapAccess::next_value(&mut map)?;
216                        }
217                        "Scheme" => {
218                            scheme = ::serde::de::MapAccess::next_value(&mut map)?;
219                        }
220                        "SecurityGroups" => {
221                            security_groups = ::serde::de::MapAccess::next_value(&mut map)?;
222                        }
223                        "Subnets" => {
224                            subnets = ::serde::de::MapAccess::next_value(&mut map)?;
225                        }
226                        "Tags" => {
227                            tags = ::serde::de::MapAccess::next_value(&mut map)?;
228                        }
229                        _ => {}
230                    }
231                }
232
233                Ok(LoadBalancerProperties {
234                    access_logging_policy: access_logging_policy,
235                    app_cookie_stickiness_policy: app_cookie_stickiness_policy,
236                    availability_zones: availability_zones,
237                    connection_draining_policy: connection_draining_policy,
238                    connection_settings: connection_settings,
239                    cross_zone: cross_zone,
240                    health_check: health_check,
241                    instances: instances,
242                    lb_cookie_stickiness_policy: lb_cookie_stickiness_policy,
243                    listeners: listeners.ok_or(::serde::de::Error::missing_field("Listeners"))?,
244                    load_balancer_name: load_balancer_name,
245                    policies: policies,
246                    scheme: scheme,
247                    security_groups: security_groups,
248                    subnets: subnets,
249                    tags: tags,
250                })
251            }
252        }
253
254        d.deserialize_map(Visitor)
255    }
256}
257
258impl ::Resource for LoadBalancer {
259    type Properties = LoadBalancerProperties;
260    const TYPE: &'static str = "AWS::ElasticLoadBalancing::LoadBalancer";
261    fn properties(&self) -> &LoadBalancerProperties {
262        &self.properties
263    }
264    fn properties_mut(&mut self) -> &mut LoadBalancerProperties {
265        &mut self.properties
266    }
267}
268
269impl ::private::Sealed for LoadBalancer {}
270
271impl From<LoadBalancerProperties> for LoadBalancer {
272    fn from(properties: LoadBalancerProperties) -> LoadBalancer {
273        LoadBalancer { properties }
274    }
275}
276
277pub mod load_balancer {
278    //! Property types for the `LoadBalancer` resource.
279
280    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.AccessLoggingPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-accessloggingpolicy.html) property type.
281    #[derive(Debug, Default)]
282    pub struct AccessLoggingPolicy {
283        /// Property [`EmitInterval`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-accessloggingpolicy.html#cfn-elb-accessloggingpolicy-emitinterval).
284        ///
285        /// Update type: _Mutable_.
286        /// AWS CloudFormation doesn't replace the resource when you change this property.
287        pub emit_interval: Option<::Value<u32>>,
288        /// Property [`Enabled`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-accessloggingpolicy.html#cfn-elb-accessloggingpolicy-enabled).
289        ///
290        /// Update type: _Mutable_.
291        /// AWS CloudFormation doesn't replace the resource when you change this property.
292        pub enabled: ::Value<bool>,
293        /// Property [`S3BucketName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-accessloggingpolicy.html#cfn-elb-accessloggingpolicy-s3bucketname).
294        ///
295        /// Update type: _Mutable_.
296        /// AWS CloudFormation doesn't replace the resource when you change this property.
297        pub s3_bucket_name: ::Value<String>,
298        /// Property [`S3BucketPrefix`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-accessloggingpolicy.html#cfn-elb-accessloggingpolicy-s3bucketprefix).
299        ///
300        /// Update type: _Mutable_.
301        /// AWS CloudFormation doesn't replace the resource when you change this property.
302        pub s3_bucket_prefix: Option<::Value<String>>,
303    }
304
305    impl ::codec::SerializeValue for AccessLoggingPolicy {
306        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
307            let mut map = ::serde::Serializer::serialize_map(s, None)?;
308            if let Some(ref emit_interval) = self.emit_interval {
309                ::serde::ser::SerializeMap::serialize_entry(&mut map, "EmitInterval", emit_interval)?;
310            }
311            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Enabled", &self.enabled)?;
312            ::serde::ser::SerializeMap::serialize_entry(&mut map, "S3BucketName", &self.s3_bucket_name)?;
313            if let Some(ref s3_bucket_prefix) = self.s3_bucket_prefix {
314                ::serde::ser::SerializeMap::serialize_entry(&mut map, "S3BucketPrefix", s3_bucket_prefix)?;
315            }
316            ::serde::ser::SerializeMap::end(map)
317        }
318    }
319
320    impl ::codec::DeserializeValue for AccessLoggingPolicy {
321        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<AccessLoggingPolicy, D::Error> {
322            struct Visitor;
323
324            impl<'de> ::serde::de::Visitor<'de> for Visitor {
325                type Value = AccessLoggingPolicy;
326
327                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
328                    write!(f, "a struct of type AccessLoggingPolicy")
329                }
330
331                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
332                    let mut emit_interval: Option<::Value<u32>> = None;
333                    let mut enabled: Option<::Value<bool>> = None;
334                    let mut s3_bucket_name: Option<::Value<String>> = None;
335                    let mut s3_bucket_prefix: Option<::Value<String>> = None;
336
337                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
338                        match __cfn_key.as_ref() {
339                            "EmitInterval" => {
340                                emit_interval = ::serde::de::MapAccess::next_value(&mut map)?;
341                            }
342                            "Enabled" => {
343                                enabled = ::serde::de::MapAccess::next_value(&mut map)?;
344                            }
345                            "S3BucketName" => {
346                                s3_bucket_name = ::serde::de::MapAccess::next_value(&mut map)?;
347                            }
348                            "S3BucketPrefix" => {
349                                s3_bucket_prefix = ::serde::de::MapAccess::next_value(&mut map)?;
350                            }
351                            _ => {}
352                        }
353                    }
354
355                    Ok(AccessLoggingPolicy {
356                        emit_interval: emit_interval,
357                        enabled: enabled.ok_or(::serde::de::Error::missing_field("Enabled"))?,
358                        s3_bucket_name: s3_bucket_name.ok_or(::serde::de::Error::missing_field("S3BucketName"))?,
359                        s3_bucket_prefix: s3_bucket_prefix,
360                    })
361                }
362            }
363
364            d.deserialize_map(Visitor)
365        }
366    }
367
368    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.AppCookieStickinessPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-AppCookieStickinessPolicy.html) property type.
369    #[derive(Debug, Default)]
370    pub struct AppCookieStickinessPolicy {
371        /// Property [`CookieName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-AppCookieStickinessPolicy.html#cfn-elb-appcookiestickinesspolicy-cookiename).
372        ///
373        /// Update type: _Mutable_.
374        /// AWS CloudFormation doesn't replace the resource when you change this property.
375        pub cookie_name: ::Value<String>,
376        /// Property [`PolicyName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-AppCookieStickinessPolicy.html#cfn-elb-appcookiestickinesspolicy-policyname).
377        ///
378        /// Update type: _Mutable_.
379        /// AWS CloudFormation doesn't replace the resource when you change this property.
380        pub policy_name: ::Value<String>,
381    }
382
383    impl ::codec::SerializeValue for AppCookieStickinessPolicy {
384        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
385            let mut map = ::serde::Serializer::serialize_map(s, None)?;
386            ::serde::ser::SerializeMap::serialize_entry(&mut map, "CookieName", &self.cookie_name)?;
387            ::serde::ser::SerializeMap::serialize_entry(&mut map, "PolicyName", &self.policy_name)?;
388            ::serde::ser::SerializeMap::end(map)
389        }
390    }
391
392    impl ::codec::DeserializeValue for AppCookieStickinessPolicy {
393        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<AppCookieStickinessPolicy, D::Error> {
394            struct Visitor;
395
396            impl<'de> ::serde::de::Visitor<'de> for Visitor {
397                type Value = AppCookieStickinessPolicy;
398
399                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
400                    write!(f, "a struct of type AppCookieStickinessPolicy")
401                }
402
403                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
404                    let mut cookie_name: Option<::Value<String>> = None;
405                    let mut policy_name: Option<::Value<String>> = None;
406
407                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
408                        match __cfn_key.as_ref() {
409                            "CookieName" => {
410                                cookie_name = ::serde::de::MapAccess::next_value(&mut map)?;
411                            }
412                            "PolicyName" => {
413                                policy_name = ::serde::de::MapAccess::next_value(&mut map)?;
414                            }
415                            _ => {}
416                        }
417                    }
418
419                    Ok(AppCookieStickinessPolicy {
420                        cookie_name: cookie_name.ok_or(::serde::de::Error::missing_field("CookieName"))?,
421                        policy_name: policy_name.ok_or(::serde::de::Error::missing_field("PolicyName"))?,
422                    })
423                }
424            }
425
426            d.deserialize_map(Visitor)
427        }
428    }
429
430    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.ConnectionDrainingPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-connectiondrainingpolicy.html) property type.
431    #[derive(Debug, Default)]
432    pub struct ConnectionDrainingPolicy {
433        /// Property [`Enabled`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-connectiondrainingpolicy.html#cfn-elb-connectiondrainingpolicy-enabled).
434        ///
435        /// Update type: _Mutable_.
436        /// AWS CloudFormation doesn't replace the resource when you change this property.
437        pub enabled: ::Value<bool>,
438        /// Property [`Timeout`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-connectiondrainingpolicy.html#cfn-elb-connectiondrainingpolicy-timeout).
439        ///
440        /// Update type: _Mutable_.
441        /// AWS CloudFormation doesn't replace the resource when you change this property.
442        pub timeout: Option<::Value<u32>>,
443    }
444
445    impl ::codec::SerializeValue for ConnectionDrainingPolicy {
446        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
447            let mut map = ::serde::Serializer::serialize_map(s, None)?;
448            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Enabled", &self.enabled)?;
449            if let Some(ref timeout) = self.timeout {
450                ::serde::ser::SerializeMap::serialize_entry(&mut map, "Timeout", timeout)?;
451            }
452            ::serde::ser::SerializeMap::end(map)
453        }
454    }
455
456    impl ::codec::DeserializeValue for ConnectionDrainingPolicy {
457        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<ConnectionDrainingPolicy, D::Error> {
458            struct Visitor;
459
460            impl<'de> ::serde::de::Visitor<'de> for Visitor {
461                type Value = ConnectionDrainingPolicy;
462
463                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
464                    write!(f, "a struct of type ConnectionDrainingPolicy")
465                }
466
467                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
468                    let mut enabled: Option<::Value<bool>> = None;
469                    let mut timeout: Option<::Value<u32>> = None;
470
471                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
472                        match __cfn_key.as_ref() {
473                            "Enabled" => {
474                                enabled = ::serde::de::MapAccess::next_value(&mut map)?;
475                            }
476                            "Timeout" => {
477                                timeout = ::serde::de::MapAccess::next_value(&mut map)?;
478                            }
479                            _ => {}
480                        }
481                    }
482
483                    Ok(ConnectionDrainingPolicy {
484                        enabled: enabled.ok_or(::serde::de::Error::missing_field("Enabled"))?,
485                        timeout: timeout,
486                    })
487                }
488            }
489
490            d.deserialize_map(Visitor)
491        }
492    }
493
494    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.ConnectionSettings`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-connectionsettings.html) property type.
495    #[derive(Debug, Default)]
496    pub struct ConnectionSettings {
497        /// Property [`IdleTimeout`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-connectionsettings.html#cfn-elb-connectionsettings-idletimeout).
498        ///
499        /// Update type: _Mutable_.
500        /// AWS CloudFormation doesn't replace the resource when you change this property.
501        pub idle_timeout: ::Value<u32>,
502    }
503
504    impl ::codec::SerializeValue for ConnectionSettings {
505        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
506            let mut map = ::serde::Serializer::serialize_map(s, None)?;
507            ::serde::ser::SerializeMap::serialize_entry(&mut map, "IdleTimeout", &self.idle_timeout)?;
508            ::serde::ser::SerializeMap::end(map)
509        }
510    }
511
512    impl ::codec::DeserializeValue for ConnectionSettings {
513        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<ConnectionSettings, D::Error> {
514            struct Visitor;
515
516            impl<'de> ::serde::de::Visitor<'de> for Visitor {
517                type Value = ConnectionSettings;
518
519                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
520                    write!(f, "a struct of type ConnectionSettings")
521                }
522
523                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
524                    let mut idle_timeout: Option<::Value<u32>> = None;
525
526                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
527                        match __cfn_key.as_ref() {
528                            "IdleTimeout" => {
529                                idle_timeout = ::serde::de::MapAccess::next_value(&mut map)?;
530                            }
531                            _ => {}
532                        }
533                    }
534
535                    Ok(ConnectionSettings {
536                        idle_timeout: idle_timeout.ok_or(::serde::de::Error::missing_field("IdleTimeout"))?,
537                    })
538                }
539            }
540
541            d.deserialize_map(Visitor)
542        }
543    }
544
545    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.HealthCheck`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html) property type.
546    #[derive(Debug, Default)]
547    pub struct HealthCheck {
548        /// Property [`HealthyThreshold`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html#cfn-elb-healthcheck-healthythreshold).
549        ///
550        /// Update type: _Mutable_.
551        /// AWS CloudFormation doesn't replace the resource when you change this property.
552        pub healthy_threshold: ::Value<String>,
553        /// Property [`Interval`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html#cfn-elb-healthcheck-interval).
554        ///
555        /// Update type: _Mutable_.
556        /// AWS CloudFormation doesn't replace the resource when you change this property.
557        pub interval: ::Value<String>,
558        /// Property [`Target`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html#cfn-elb-healthcheck-target).
559        ///
560        /// Update type: _Mutable_.
561        /// AWS CloudFormation doesn't replace the resource when you change this property.
562        pub target: ::Value<String>,
563        /// Property [`Timeout`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html#cfn-elb-healthcheck-timeout).
564        ///
565        /// Update type: _Mutable_.
566        /// AWS CloudFormation doesn't replace the resource when you change this property.
567        pub timeout: ::Value<String>,
568        /// Property [`UnhealthyThreshold`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html#cfn-elb-healthcheck-unhealthythreshold).
569        ///
570        /// Update type: _Mutable_.
571        /// AWS CloudFormation doesn't replace the resource when you change this property.
572        pub unhealthy_threshold: ::Value<String>,
573    }
574
575    impl ::codec::SerializeValue for HealthCheck {
576        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
577            let mut map = ::serde::Serializer::serialize_map(s, None)?;
578            ::serde::ser::SerializeMap::serialize_entry(&mut map, "HealthyThreshold", &self.healthy_threshold)?;
579            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Interval", &self.interval)?;
580            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Target", &self.target)?;
581            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Timeout", &self.timeout)?;
582            ::serde::ser::SerializeMap::serialize_entry(&mut map, "UnhealthyThreshold", &self.unhealthy_threshold)?;
583            ::serde::ser::SerializeMap::end(map)
584        }
585    }
586
587    impl ::codec::DeserializeValue for HealthCheck {
588        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<HealthCheck, D::Error> {
589            struct Visitor;
590
591            impl<'de> ::serde::de::Visitor<'de> for Visitor {
592                type Value = HealthCheck;
593
594                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
595                    write!(f, "a struct of type HealthCheck")
596                }
597
598                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
599                    let mut healthy_threshold: Option<::Value<String>> = None;
600                    let mut interval: Option<::Value<String>> = None;
601                    let mut target: Option<::Value<String>> = None;
602                    let mut timeout: Option<::Value<String>> = None;
603                    let mut unhealthy_threshold: Option<::Value<String>> = None;
604
605                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
606                        match __cfn_key.as_ref() {
607                            "HealthyThreshold" => {
608                                healthy_threshold = ::serde::de::MapAccess::next_value(&mut map)?;
609                            }
610                            "Interval" => {
611                                interval = ::serde::de::MapAccess::next_value(&mut map)?;
612                            }
613                            "Target" => {
614                                target = ::serde::de::MapAccess::next_value(&mut map)?;
615                            }
616                            "Timeout" => {
617                                timeout = ::serde::de::MapAccess::next_value(&mut map)?;
618                            }
619                            "UnhealthyThreshold" => {
620                                unhealthy_threshold = ::serde::de::MapAccess::next_value(&mut map)?;
621                            }
622                            _ => {}
623                        }
624                    }
625
626                    Ok(HealthCheck {
627                        healthy_threshold: healthy_threshold.ok_or(::serde::de::Error::missing_field("HealthyThreshold"))?,
628                        interval: interval.ok_or(::serde::de::Error::missing_field("Interval"))?,
629                        target: target.ok_or(::serde::de::Error::missing_field("Target"))?,
630                        timeout: timeout.ok_or(::serde::de::Error::missing_field("Timeout"))?,
631                        unhealthy_threshold: unhealthy_threshold.ok_or(::serde::de::Error::missing_field("UnhealthyThreshold"))?,
632                    })
633                }
634            }
635
636            d.deserialize_map(Visitor)
637        }
638    }
639
640    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.LBCookieStickinessPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-LBCookieStickinessPolicy.html) property type.
641    #[derive(Debug, Default)]
642    pub struct LBCookieStickinessPolicy {
643        /// Property [`CookieExpirationPeriod`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-LBCookieStickinessPolicy.html#cfn-elb-lbcookiestickinesspolicy-cookieexpirationperiod).
644        ///
645        /// Update type: _Mutable_.
646        /// AWS CloudFormation doesn't replace the resource when you change this property.
647        pub cookie_expiration_period: Option<::Value<String>>,
648        /// Property [`PolicyName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-LBCookieStickinessPolicy.html#cfn-elb-lbcookiestickinesspolicy-policyname).
649        ///
650        /// Update type: _Mutable_.
651        /// AWS CloudFormation doesn't replace the resource when you change this property.
652        pub policy_name: Option<::Value<String>>,
653    }
654
655    impl ::codec::SerializeValue for LBCookieStickinessPolicy {
656        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
657            let mut map = ::serde::Serializer::serialize_map(s, None)?;
658            if let Some(ref cookie_expiration_period) = self.cookie_expiration_period {
659                ::serde::ser::SerializeMap::serialize_entry(&mut map, "CookieExpirationPeriod", cookie_expiration_period)?;
660            }
661            if let Some(ref policy_name) = self.policy_name {
662                ::serde::ser::SerializeMap::serialize_entry(&mut map, "PolicyName", policy_name)?;
663            }
664            ::serde::ser::SerializeMap::end(map)
665        }
666    }
667
668    impl ::codec::DeserializeValue for LBCookieStickinessPolicy {
669        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<LBCookieStickinessPolicy, D::Error> {
670            struct Visitor;
671
672            impl<'de> ::serde::de::Visitor<'de> for Visitor {
673                type Value = LBCookieStickinessPolicy;
674
675                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
676                    write!(f, "a struct of type LBCookieStickinessPolicy")
677                }
678
679                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
680                    let mut cookie_expiration_period: Option<::Value<String>> = None;
681                    let mut policy_name: Option<::Value<String>> = None;
682
683                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
684                        match __cfn_key.as_ref() {
685                            "CookieExpirationPeriod" => {
686                                cookie_expiration_period = ::serde::de::MapAccess::next_value(&mut map)?;
687                            }
688                            "PolicyName" => {
689                                policy_name = ::serde::de::MapAccess::next_value(&mut map)?;
690                            }
691                            _ => {}
692                        }
693                    }
694
695                    Ok(LBCookieStickinessPolicy {
696                        cookie_expiration_period: cookie_expiration_period,
697                        policy_name: policy_name,
698                    })
699                }
700            }
701
702            d.deserialize_map(Visitor)
703        }
704    }
705
706    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.Listeners`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html) property type.
707    #[derive(Debug, Default)]
708    pub struct Listeners {
709        /// Property [`InstancePort`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-instanceport).
710        ///
711        /// Update type: _Mutable_.
712        /// AWS CloudFormation doesn't replace the resource when you change this property.
713        pub instance_port: ::Value<String>,
714        /// Property [`InstanceProtocol`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-instanceprotocol).
715        ///
716        /// Update type: _Mutable_.
717        /// AWS CloudFormation doesn't replace the resource when you change this property.
718        pub instance_protocol: Option<::Value<String>>,
719        /// Property [`LoadBalancerPort`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-loadbalancerport).
720        ///
721        /// Update type: _Mutable_.
722        /// AWS CloudFormation doesn't replace the resource when you change this property.
723        pub load_balancer_port: ::Value<String>,
724        /// Property [`PolicyNames`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-policynames).
725        ///
726        /// Update type: _Mutable_.
727        /// AWS CloudFormation doesn't replace the resource when you change this property.
728        pub policy_names: Option<::ValueList<String>>,
729        /// Property [`Protocol`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-protocol).
730        ///
731        /// Update type: _Mutable_.
732        /// AWS CloudFormation doesn't replace the resource when you change this property.
733        pub protocol: ::Value<String>,
734        /// Property [`SSLCertificateId`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-sslcertificateid).
735        ///
736        /// Update type: _Mutable_.
737        /// AWS CloudFormation doesn't replace the resource when you change this property.
738        pub ssl_certificate_id: Option<::Value<String>>,
739    }
740
741    impl ::codec::SerializeValue for Listeners {
742        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
743            let mut map = ::serde::Serializer::serialize_map(s, None)?;
744            ::serde::ser::SerializeMap::serialize_entry(&mut map, "InstancePort", &self.instance_port)?;
745            if let Some(ref instance_protocol) = self.instance_protocol {
746                ::serde::ser::SerializeMap::serialize_entry(&mut map, "InstanceProtocol", instance_protocol)?;
747            }
748            ::serde::ser::SerializeMap::serialize_entry(&mut map, "LoadBalancerPort", &self.load_balancer_port)?;
749            if let Some(ref policy_names) = self.policy_names {
750                ::serde::ser::SerializeMap::serialize_entry(&mut map, "PolicyNames", policy_names)?;
751            }
752            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Protocol", &self.protocol)?;
753            if let Some(ref ssl_certificate_id) = self.ssl_certificate_id {
754                ::serde::ser::SerializeMap::serialize_entry(&mut map, "SSLCertificateId", ssl_certificate_id)?;
755            }
756            ::serde::ser::SerializeMap::end(map)
757        }
758    }
759
760    impl ::codec::DeserializeValue for Listeners {
761        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<Listeners, D::Error> {
762            struct Visitor;
763
764            impl<'de> ::serde::de::Visitor<'de> for Visitor {
765                type Value = Listeners;
766
767                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
768                    write!(f, "a struct of type Listeners")
769                }
770
771                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
772                    let mut instance_port: Option<::Value<String>> = None;
773                    let mut instance_protocol: Option<::Value<String>> = None;
774                    let mut load_balancer_port: Option<::Value<String>> = None;
775                    let mut policy_names: Option<::ValueList<String>> = None;
776                    let mut protocol: Option<::Value<String>> = None;
777                    let mut ssl_certificate_id: Option<::Value<String>> = None;
778
779                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
780                        match __cfn_key.as_ref() {
781                            "InstancePort" => {
782                                instance_port = ::serde::de::MapAccess::next_value(&mut map)?;
783                            }
784                            "InstanceProtocol" => {
785                                instance_protocol = ::serde::de::MapAccess::next_value(&mut map)?;
786                            }
787                            "LoadBalancerPort" => {
788                                load_balancer_port = ::serde::de::MapAccess::next_value(&mut map)?;
789                            }
790                            "PolicyNames" => {
791                                policy_names = ::serde::de::MapAccess::next_value(&mut map)?;
792                            }
793                            "Protocol" => {
794                                protocol = ::serde::de::MapAccess::next_value(&mut map)?;
795                            }
796                            "SSLCertificateId" => {
797                                ssl_certificate_id = ::serde::de::MapAccess::next_value(&mut map)?;
798                            }
799                            _ => {}
800                        }
801                    }
802
803                    Ok(Listeners {
804                        instance_port: instance_port.ok_or(::serde::de::Error::missing_field("InstancePort"))?,
805                        instance_protocol: instance_protocol,
806                        load_balancer_port: load_balancer_port.ok_or(::serde::de::Error::missing_field("LoadBalancerPort"))?,
807                        policy_names: policy_names,
808                        protocol: protocol.ok_or(::serde::de::Error::missing_field("Protocol"))?,
809                        ssl_certificate_id: ssl_certificate_id,
810                    })
811                }
812            }
813
814            d.deserialize_map(Visitor)
815        }
816    }
817
818    /// The [`AWS::ElasticLoadBalancing::LoadBalancer.Policies`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html) property type.
819    #[derive(Debug, Default)]
820    pub struct Policies {
821        /// Property [`Attributes`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-attributes).
822        ///
823        /// Update type: _Mutable_.
824        /// AWS CloudFormation doesn't replace the resource when you change this property.
825        pub attributes: ::ValueList<::json::Value>,
826        /// Property [`InstancePorts`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-instanceports).
827        ///
828        /// Update type: _Mutable_.
829        /// AWS CloudFormation doesn't replace the resource when you change this property.
830        pub instance_ports: Option<::ValueList<String>>,
831        /// Property [`LoadBalancerPorts`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-loadbalancerports).
832        ///
833        /// Update type: _Mutable_.
834        /// AWS CloudFormation doesn't replace the resource when you change this property.
835        pub load_balancer_ports: Option<::ValueList<String>>,
836        /// Property [`PolicyName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-policyname).
837        ///
838        /// Update type: _Mutable_.
839        /// AWS CloudFormation doesn't replace the resource when you change this property.
840        pub policy_name: ::Value<String>,
841        /// Property [`PolicyType`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-policytype).
842        ///
843        /// Update type: _Mutable_.
844        /// AWS CloudFormation doesn't replace the resource when you change this property.
845        pub policy_type: ::Value<String>,
846    }
847
848    impl ::codec::SerializeValue for Policies {
849        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
850            let mut map = ::serde::Serializer::serialize_map(s, None)?;
851            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Attributes", &self.attributes)?;
852            if let Some(ref instance_ports) = self.instance_ports {
853                ::serde::ser::SerializeMap::serialize_entry(&mut map, "InstancePorts", instance_ports)?;
854            }
855            if let Some(ref load_balancer_ports) = self.load_balancer_ports {
856                ::serde::ser::SerializeMap::serialize_entry(&mut map, "LoadBalancerPorts", load_balancer_ports)?;
857            }
858            ::serde::ser::SerializeMap::serialize_entry(&mut map, "PolicyName", &self.policy_name)?;
859            ::serde::ser::SerializeMap::serialize_entry(&mut map, "PolicyType", &self.policy_type)?;
860            ::serde::ser::SerializeMap::end(map)
861        }
862    }
863
864    impl ::codec::DeserializeValue for Policies {
865        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<Policies, D::Error> {
866            struct Visitor;
867
868            impl<'de> ::serde::de::Visitor<'de> for Visitor {
869                type Value = Policies;
870
871                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
872                    write!(f, "a struct of type Policies")
873                }
874
875                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
876                    let mut attributes: Option<::ValueList<::json::Value>> = None;
877                    let mut instance_ports: Option<::ValueList<String>> = None;
878                    let mut load_balancer_ports: Option<::ValueList<String>> = None;
879                    let mut policy_name: Option<::Value<String>> = None;
880                    let mut policy_type: Option<::Value<String>> = None;
881
882                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
883                        match __cfn_key.as_ref() {
884                            "Attributes" => {
885                                attributes = ::serde::de::MapAccess::next_value(&mut map)?;
886                            }
887                            "InstancePorts" => {
888                                instance_ports = ::serde::de::MapAccess::next_value(&mut map)?;
889                            }
890                            "LoadBalancerPorts" => {
891                                load_balancer_ports = ::serde::de::MapAccess::next_value(&mut map)?;
892                            }
893                            "PolicyName" => {
894                                policy_name = ::serde::de::MapAccess::next_value(&mut map)?;
895                            }
896                            "PolicyType" => {
897                                policy_type = ::serde::de::MapAccess::next_value(&mut map)?;
898                            }
899                            _ => {}
900                        }
901                    }
902
903                    Ok(Policies {
904                        attributes: attributes.ok_or(::serde::de::Error::missing_field("Attributes"))?,
905                        instance_ports: instance_ports,
906                        load_balancer_ports: load_balancer_ports,
907                        policy_name: policy_name.ok_or(::serde::de::Error::missing_field("PolicyName"))?,
908                        policy_type: policy_type.ok_or(::serde::de::Error::missing_field("PolicyType"))?,
909                    })
910                }
911            }
912
913            d.deserialize_map(Visitor)
914        }
915    }
916}