cfn 0.0.8

Type-safe representations for AWS CloudFormation templates, resources and properties
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
//! Types for the `Location` service.

/// The [`AWS::Location::GeofenceCollection`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-geofencecollection.html) resource type.
#[derive(Debug, Default)]
pub struct GeofenceCollection {
    properties: GeofenceCollectionProperties
}

/// Properties for the `GeofenceCollection` resource.
#[derive(Debug, Default)]
pub struct GeofenceCollectionProperties {
    /// Property [`CollectionName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-geofencecollection.html#cfn-location-geofencecollection-collectionname).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub collection_name: ::Value<String>,
    /// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-geofencecollection.html#cfn-location-geofencecollection-description).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub description: Option<::Value<String>>,
    /// Property [`KmsKeyId`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-geofencecollection.html#cfn-location-geofencecollection-kmskeyid).
    ///
    /// Update type: _Mutable_.
    /// AWS CloudFormation doesn't replace the resource when you change this property.
    pub kms_key_id: Option<::Value<String>>,
    /// Property [`PricingPlan`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-geofencecollection.html#cfn-location-geofencecollection-pricingplan).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub pricing_plan: ::Value<String>,
    /// Property [`PricingPlanDataSource`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-geofencecollection.html#cfn-location-geofencecollection-pricingplandatasource).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub pricing_plan_data_source: Option<::Value<String>>,
}

impl ::serde::Serialize for GeofenceCollectionProperties {
    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, "CollectionName", &self.collection_name)?;
        if let Some(ref description) = self.description {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
        }
        if let Some(ref kms_key_id) = self.kms_key_id {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "KmsKeyId", kms_key_id)?;
        }
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "PricingPlan", &self.pricing_plan)?;
        if let Some(ref pricing_plan_data_source) = self.pricing_plan_data_source {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "PricingPlanDataSource", pricing_plan_data_source)?;
        }
        ::serde::ser::SerializeMap::end(map)
    }
}

impl<'de> ::serde::Deserialize<'de> for GeofenceCollectionProperties {
    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<GeofenceCollectionProperties, D::Error> {
        struct Visitor;

        impl<'de> ::serde::de::Visitor<'de> for Visitor {
            type Value = GeofenceCollectionProperties;

            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                write!(f, "a struct of type GeofenceCollectionProperties")
            }

            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                let mut collection_name: Option<::Value<String>> = None;
                let mut description: Option<::Value<String>> = None;
                let mut kms_key_id: Option<::Value<String>> = None;
                let mut pricing_plan: Option<::Value<String>> = None;
                let mut pricing_plan_data_source: Option<::Value<String>> = None;

                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                    match __cfn_key.as_ref() {
                        "CollectionName" => {
                            collection_name = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "Description" => {
                            description = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "KmsKeyId" => {
                            kms_key_id = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "PricingPlan" => {
                            pricing_plan = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "PricingPlanDataSource" => {
                            pricing_plan_data_source = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        _ => {}
                    }
                }

                Ok(GeofenceCollectionProperties {
                    collection_name: collection_name.ok_or(::serde::de::Error::missing_field("CollectionName"))?,
                    description: description,
                    kms_key_id: kms_key_id,
                    pricing_plan: pricing_plan.ok_or(::serde::de::Error::missing_field("PricingPlan"))?,
                    pricing_plan_data_source: pricing_plan_data_source,
                })
            }
        }

        d.deserialize_map(Visitor)
    }
}

impl ::Resource for GeofenceCollection {
    type Properties = GeofenceCollectionProperties;
    const TYPE: &'static str = "AWS::Location::GeofenceCollection";
    fn properties(&self) -> &GeofenceCollectionProperties {
        &self.properties
    }
    fn properties_mut(&mut self) -> &mut GeofenceCollectionProperties {
        &mut self.properties
    }
}

impl ::private::Sealed for GeofenceCollection {}

impl From<GeofenceCollectionProperties> for GeofenceCollection {
    fn from(properties: GeofenceCollectionProperties) -> GeofenceCollection {
        GeofenceCollection { properties }
    }
}

/// The [`AWS::Location::Map`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-map.html) resource type.
#[derive(Debug, Default)]
pub struct Map {
    properties: MapProperties
}

/// Properties for the `Map` resource.
#[derive(Debug, Default)]
pub struct MapProperties {
    /// Property [`Configuration`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-map.html#cfn-location-map-configuration).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub configuration: ::Value<self::map::MapConfiguration>,
    /// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-map.html#cfn-location-map-description).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub description: Option<::Value<String>>,
    /// Property [`MapName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-map.html#cfn-location-map-mapname).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub map_name: ::Value<String>,
    /// Property [`PricingPlan`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-map.html#cfn-location-map-pricingplan).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub pricing_plan: ::Value<String>,
}

impl ::serde::Serialize for MapProperties {
    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, "Configuration", &self.configuration)?;
        if let Some(ref description) = self.description {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
        }
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "MapName", &self.map_name)?;
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "PricingPlan", &self.pricing_plan)?;
        ::serde::ser::SerializeMap::end(map)
    }
}

impl<'de> ::serde::Deserialize<'de> for MapProperties {
    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<MapProperties, D::Error> {
        struct Visitor;

        impl<'de> ::serde::de::Visitor<'de> for Visitor {
            type Value = MapProperties;

            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                write!(f, "a struct of type MapProperties")
            }

            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                let mut configuration: Option<::Value<self::map::MapConfiguration>> = None;
                let mut description: Option<::Value<String>> = None;
                let mut map_name: Option<::Value<String>> = None;
                let mut pricing_plan: Option<::Value<String>> = None;

                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                    match __cfn_key.as_ref() {
                        "Configuration" => {
                            configuration = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "Description" => {
                            description = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "MapName" => {
                            map_name = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "PricingPlan" => {
                            pricing_plan = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        _ => {}
                    }
                }

                Ok(MapProperties {
                    configuration: configuration.ok_or(::serde::de::Error::missing_field("Configuration"))?,
                    description: description,
                    map_name: map_name.ok_or(::serde::de::Error::missing_field("MapName"))?,
                    pricing_plan: pricing_plan.ok_or(::serde::de::Error::missing_field("PricingPlan"))?,
                })
            }
        }

        d.deserialize_map(Visitor)
    }
}

impl ::Resource for Map {
    type Properties = MapProperties;
    const TYPE: &'static str = "AWS::Location::Map";
    fn properties(&self) -> &MapProperties {
        &self.properties
    }
    fn properties_mut(&mut self) -> &mut MapProperties {
        &mut self.properties
    }
}

impl ::private::Sealed for Map {}

impl From<MapProperties> for Map {
    fn from(properties: MapProperties) -> Map {
        Map { properties }
    }
}

/// The [`AWS::Location::PlaceIndex`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-placeindex.html) resource type.
#[derive(Debug, Default)]
pub struct PlaceIndex {
    properties: PlaceIndexProperties
}

/// Properties for the `PlaceIndex` resource.
#[derive(Debug, Default)]
pub struct PlaceIndexProperties {
    /// Property [`DataSource`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-placeindex.html#cfn-location-placeindex-datasource).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub data_source: ::Value<String>,
    /// Property [`DataSourceConfiguration`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-placeindex.html#cfn-location-placeindex-datasourceconfiguration).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub data_source_configuration: Option<::Value<self::place_index::DataSourceConfiguration>>,
    /// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-placeindex.html#cfn-location-placeindex-description).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub description: Option<::Value<String>>,
    /// Property [`IndexName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-placeindex.html#cfn-location-placeindex-indexname).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub index_name: ::Value<String>,
    /// Property [`PricingPlan`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-placeindex.html#cfn-location-placeindex-pricingplan).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub pricing_plan: ::Value<String>,
}

impl ::serde::Serialize for PlaceIndexProperties {
    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, "DataSource", &self.data_source)?;
        if let Some(ref data_source_configuration) = self.data_source_configuration {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "DataSourceConfiguration", data_source_configuration)?;
        }
        if let Some(ref description) = self.description {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
        }
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "IndexName", &self.index_name)?;
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "PricingPlan", &self.pricing_plan)?;
        ::serde::ser::SerializeMap::end(map)
    }
}

impl<'de> ::serde::Deserialize<'de> for PlaceIndexProperties {
    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<PlaceIndexProperties, D::Error> {
        struct Visitor;

        impl<'de> ::serde::de::Visitor<'de> for Visitor {
            type Value = PlaceIndexProperties;

            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                write!(f, "a struct of type PlaceIndexProperties")
            }

            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                let mut data_source: Option<::Value<String>> = None;
                let mut data_source_configuration: Option<::Value<self::place_index::DataSourceConfiguration>> = None;
                let mut description: Option<::Value<String>> = None;
                let mut index_name: Option<::Value<String>> = None;
                let mut pricing_plan: Option<::Value<String>> = None;

                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                    match __cfn_key.as_ref() {
                        "DataSource" => {
                            data_source = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "DataSourceConfiguration" => {
                            data_source_configuration = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "Description" => {
                            description = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "IndexName" => {
                            index_name = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "PricingPlan" => {
                            pricing_plan = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        _ => {}
                    }
                }

                Ok(PlaceIndexProperties {
                    data_source: data_source.ok_or(::serde::de::Error::missing_field("DataSource"))?,
                    data_source_configuration: data_source_configuration,
                    description: description,
                    index_name: index_name.ok_or(::serde::de::Error::missing_field("IndexName"))?,
                    pricing_plan: pricing_plan.ok_or(::serde::de::Error::missing_field("PricingPlan"))?,
                })
            }
        }

        d.deserialize_map(Visitor)
    }
}

impl ::Resource for PlaceIndex {
    type Properties = PlaceIndexProperties;
    const TYPE: &'static str = "AWS::Location::PlaceIndex";
    fn properties(&self) -> &PlaceIndexProperties {
        &self.properties
    }
    fn properties_mut(&mut self) -> &mut PlaceIndexProperties {
        &mut self.properties
    }
}

impl ::private::Sealed for PlaceIndex {}

impl From<PlaceIndexProperties> for PlaceIndex {
    fn from(properties: PlaceIndexProperties) -> PlaceIndex {
        PlaceIndex { properties }
    }
}

/// The [`AWS::Location::RouteCalculator`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-routecalculator.html) resource type.
#[derive(Debug, Default)]
pub struct RouteCalculator {
    properties: RouteCalculatorProperties
}

/// Properties for the `RouteCalculator` resource.
#[derive(Debug, Default)]
pub struct RouteCalculatorProperties {
    /// Property [`CalculatorName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-routecalculator.html#cfn-location-routecalculator-calculatorname).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub calculator_name: ::Value<String>,
    /// Property [`DataSource`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-routecalculator.html#cfn-location-routecalculator-datasource).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub data_source: ::Value<String>,
    /// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-routecalculator.html#cfn-location-routecalculator-description).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub description: Option<::Value<String>>,
    /// Property [`PricingPlan`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-routecalculator.html#cfn-location-routecalculator-pricingplan).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub pricing_plan: ::Value<String>,
}

impl ::serde::Serialize for RouteCalculatorProperties {
    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, "CalculatorName", &self.calculator_name)?;
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "DataSource", &self.data_source)?;
        if let Some(ref description) = self.description {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
        }
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "PricingPlan", &self.pricing_plan)?;
        ::serde::ser::SerializeMap::end(map)
    }
}

impl<'de> ::serde::Deserialize<'de> for RouteCalculatorProperties {
    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<RouteCalculatorProperties, D::Error> {
        struct Visitor;

        impl<'de> ::serde::de::Visitor<'de> for Visitor {
            type Value = RouteCalculatorProperties;

            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                write!(f, "a struct of type RouteCalculatorProperties")
            }

            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                let mut calculator_name: Option<::Value<String>> = None;
                let mut data_source: Option<::Value<String>> = None;
                let mut description: Option<::Value<String>> = None;
                let mut pricing_plan: Option<::Value<String>> = None;

                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                    match __cfn_key.as_ref() {
                        "CalculatorName" => {
                            calculator_name = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "DataSource" => {
                            data_source = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "Description" => {
                            description = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "PricingPlan" => {
                            pricing_plan = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        _ => {}
                    }
                }

                Ok(RouteCalculatorProperties {
                    calculator_name: calculator_name.ok_or(::serde::de::Error::missing_field("CalculatorName"))?,
                    data_source: data_source.ok_or(::serde::de::Error::missing_field("DataSource"))?,
                    description: description,
                    pricing_plan: pricing_plan.ok_or(::serde::de::Error::missing_field("PricingPlan"))?,
                })
            }
        }

        d.deserialize_map(Visitor)
    }
}

impl ::Resource for RouteCalculator {
    type Properties = RouteCalculatorProperties;
    const TYPE: &'static str = "AWS::Location::RouteCalculator";
    fn properties(&self) -> &RouteCalculatorProperties {
        &self.properties
    }
    fn properties_mut(&mut self) -> &mut RouteCalculatorProperties {
        &mut self.properties
    }
}

impl ::private::Sealed for RouteCalculator {}

impl From<RouteCalculatorProperties> for RouteCalculator {
    fn from(properties: RouteCalculatorProperties) -> RouteCalculator {
        RouteCalculator { properties }
    }
}

/// The [`AWS::Location::Tracker`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html) resource type.
#[derive(Debug, Default)]
pub struct Tracker {
    properties: TrackerProperties
}

/// Properties for the `Tracker` resource.
#[derive(Debug, Default)]
pub struct TrackerProperties {
    /// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-description).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub description: Option<::Value<String>>,
    /// Property [`KmsKeyId`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-kmskeyid).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub kms_key_id: Option<::Value<String>>,
    /// Property [`PricingPlan`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-pricingplan).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub pricing_plan: ::Value<String>,
    /// Property [`PricingPlanDataSource`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-pricingplandatasource).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub pricing_plan_data_source: Option<::Value<String>>,
    /// Property [`TrackerName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-tracker.html#cfn-location-tracker-trackername).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub tracker_name: ::Value<String>,
}

impl ::serde::Serialize for TrackerProperties {
    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 description) = self.description {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
        }
        if let Some(ref kms_key_id) = self.kms_key_id {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "KmsKeyId", kms_key_id)?;
        }
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "PricingPlan", &self.pricing_plan)?;
        if let Some(ref pricing_plan_data_source) = self.pricing_plan_data_source {
            ::serde::ser::SerializeMap::serialize_entry(&mut map, "PricingPlanDataSource", pricing_plan_data_source)?;
        }
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "TrackerName", &self.tracker_name)?;
        ::serde::ser::SerializeMap::end(map)
    }
}

impl<'de> ::serde::Deserialize<'de> for TrackerProperties {
    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<TrackerProperties, D::Error> {
        struct Visitor;

        impl<'de> ::serde::de::Visitor<'de> for Visitor {
            type Value = TrackerProperties;

            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                write!(f, "a struct of type TrackerProperties")
            }

            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                let mut description: Option<::Value<String>> = None;
                let mut kms_key_id: Option<::Value<String>> = None;
                let mut pricing_plan: Option<::Value<String>> = None;
                let mut pricing_plan_data_source: Option<::Value<String>> = None;
                let mut tracker_name: Option<::Value<String>> = None;

                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                    match __cfn_key.as_ref() {
                        "Description" => {
                            description = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "KmsKeyId" => {
                            kms_key_id = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "PricingPlan" => {
                            pricing_plan = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "PricingPlanDataSource" => {
                            pricing_plan_data_source = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "TrackerName" => {
                            tracker_name = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        _ => {}
                    }
                }

                Ok(TrackerProperties {
                    description: description,
                    kms_key_id: kms_key_id,
                    pricing_plan: pricing_plan.ok_or(::serde::de::Error::missing_field("PricingPlan"))?,
                    pricing_plan_data_source: pricing_plan_data_source,
                    tracker_name: tracker_name.ok_or(::serde::de::Error::missing_field("TrackerName"))?,
                })
            }
        }

        d.deserialize_map(Visitor)
    }
}

impl ::Resource for Tracker {
    type Properties = TrackerProperties;
    const TYPE: &'static str = "AWS::Location::Tracker";
    fn properties(&self) -> &TrackerProperties {
        &self.properties
    }
    fn properties_mut(&mut self) -> &mut TrackerProperties {
        &mut self.properties
    }
}

impl ::private::Sealed for Tracker {}

impl From<TrackerProperties> for Tracker {
    fn from(properties: TrackerProperties) -> Tracker {
        Tracker { properties }
    }
}

/// The [`AWS::Location::TrackerConsumer`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-trackerconsumer.html) resource type.
#[derive(Debug, Default)]
pub struct TrackerConsumer {
    properties: TrackerConsumerProperties
}

/// Properties for the `TrackerConsumer` resource.
#[derive(Debug, Default)]
pub struct TrackerConsumerProperties {
    /// Property [`ConsumerArn`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-trackerconsumer.html#cfn-location-trackerconsumer-consumerarn).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub consumer_arn: ::Value<String>,
    /// Property [`TrackerName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-location-trackerconsumer.html#cfn-location-trackerconsumer-trackername).
    ///
    /// Update type: _Immutable_.
    /// AWS CloudFormation replaces the resource when you change this property.
    pub tracker_name: ::Value<String>,
}

impl ::serde::Serialize for TrackerConsumerProperties {
    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, "ConsumerArn", &self.consumer_arn)?;
        ::serde::ser::SerializeMap::serialize_entry(&mut map, "TrackerName", &self.tracker_name)?;
        ::serde::ser::SerializeMap::end(map)
    }
}

impl<'de> ::serde::Deserialize<'de> for TrackerConsumerProperties {
    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<TrackerConsumerProperties, D::Error> {
        struct Visitor;

        impl<'de> ::serde::de::Visitor<'de> for Visitor {
            type Value = TrackerConsumerProperties;

            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                write!(f, "a struct of type TrackerConsumerProperties")
            }

            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                let mut consumer_arn: Option<::Value<String>> = None;
                let mut tracker_name: Option<::Value<String>> = None;

                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                    match __cfn_key.as_ref() {
                        "ConsumerArn" => {
                            consumer_arn = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        "TrackerName" => {
                            tracker_name = ::serde::de::MapAccess::next_value(&mut map)?;
                        }
                        _ => {}
                    }
                }

                Ok(TrackerConsumerProperties {
                    consumer_arn: consumer_arn.ok_or(::serde::de::Error::missing_field("ConsumerArn"))?,
                    tracker_name: tracker_name.ok_or(::serde::de::Error::missing_field("TrackerName"))?,
                })
            }
        }

        d.deserialize_map(Visitor)
    }
}

impl ::Resource for TrackerConsumer {
    type Properties = TrackerConsumerProperties;
    const TYPE: &'static str = "AWS::Location::TrackerConsumer";
    fn properties(&self) -> &TrackerConsumerProperties {
        &self.properties
    }
    fn properties_mut(&mut self) -> &mut TrackerConsumerProperties {
        &mut self.properties
    }
}

impl ::private::Sealed for TrackerConsumer {}

impl From<TrackerConsumerProperties> for TrackerConsumer {
    fn from(properties: TrackerConsumerProperties) -> TrackerConsumer {
        TrackerConsumer { properties }
    }
}

pub mod map {
    //! Property types for the `Map` resource.

    /// The [`AWS::Location::Map.MapConfiguration`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-map-mapconfiguration.html) property type.
    #[derive(Debug, Default)]
    pub struct MapConfiguration {
        /// Property [`Style`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-map-mapconfiguration.html#cfn-location-map-mapconfiguration-style).
        ///
        /// Update type: _Immutable_.
        /// AWS CloudFormation replaces the resource when you change this property.
        pub style: ::Value<String>,
    }

    impl ::codec::SerializeValue for MapConfiguration {
        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, "Style", &self.style)?;
            ::serde::ser::SerializeMap::end(map)
        }
    }

    impl ::codec::DeserializeValue for MapConfiguration {
        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<MapConfiguration, D::Error> {
            struct Visitor;

            impl<'de> ::serde::de::Visitor<'de> for Visitor {
                type Value = MapConfiguration;

                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                    write!(f, "a struct of type MapConfiguration")
                }

                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                    let mut style: Option<::Value<String>> = None;

                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                        match __cfn_key.as_ref() {
                            "Style" => {
                                style = ::serde::de::MapAccess::next_value(&mut map)?;
                            }
                            _ => {}
                        }
                    }

                    Ok(MapConfiguration {
                        style: style.ok_or(::serde::de::Error::missing_field("Style"))?,
                    })
                }
            }

            d.deserialize_map(Visitor)
        }
    }
}

pub mod place_index {
    //! Property types for the `PlaceIndex` resource.

    /// The [`AWS::Location::PlaceIndex.DataSourceConfiguration`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-placeindex-datasourceconfiguration.html) property type.
    #[derive(Debug, Default)]
    pub struct DataSourceConfiguration {
        /// Property [`IntendedUse`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-location-placeindex-datasourceconfiguration.html#cfn-location-placeindex-datasourceconfiguration-intendeduse).
        ///
        /// Update type: _Immutable_.
        /// AWS CloudFormation replaces the resource when you change this property.
        pub intended_use: Option<::Value<String>>,
    }

    impl ::codec::SerializeValue for DataSourceConfiguration {
        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 intended_use) = self.intended_use {
                ::serde::ser::SerializeMap::serialize_entry(&mut map, "IntendedUse", intended_use)?;
            }
            ::serde::ser::SerializeMap::end(map)
        }
    }

    impl ::codec::DeserializeValue for DataSourceConfiguration {
        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<DataSourceConfiguration, D::Error> {
            struct Visitor;

            impl<'de> ::serde::de::Visitor<'de> for Visitor {
                type Value = DataSourceConfiguration;

                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
                    write!(f, "a struct of type DataSourceConfiguration")
                }

                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
                    let mut intended_use: Option<::Value<String>> = None;

                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
                        match __cfn_key.as_ref() {
                            "IntendedUse" => {
                                intended_use = ::serde::de::MapAccess::next_value(&mut map)?;
                            }
                            _ => {}
                        }
                    }

                    Ok(DataSourceConfiguration {
                        intended_use: intended_use,
                    })
                }
            }

            d.deserialize_map(Visitor)
        }
    }
}