cfn/aws/
directoryservice.rs

1//! Types for the `DirectoryService` service.
2
3/// The [`AWS::DirectoryService::MicrosoftAD`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html) resource type.
4#[derive(Debug, Default)]
5pub struct MicrosoftAD {
6    properties: MicrosoftADProperties
7}
8
9/// Properties for the `MicrosoftAD` resource.
10#[derive(Debug, Default)]
11pub struct MicrosoftADProperties {
12    /// Property [`CreateAlias`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html#cfn-directoryservice-microsoftad-createalias).
13    ///
14    /// Update type: _Immutable_.
15    /// AWS CloudFormation replaces the resource when you change this property.
16    pub create_alias: Option<::Value<bool>>,
17    /// Property [`Edition`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html#cfn-directoryservice-microsoftad-edition).
18    ///
19    /// Update type: _Immutable_.
20    /// AWS CloudFormation replaces the resource when you change this property.
21    pub edition: Option<::Value<String>>,
22    /// Property [`EnableSso`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html#cfn-directoryservice-microsoftad-enablesso).
23    ///
24    /// Update type: _Mutable_.
25    /// AWS CloudFormation doesn't replace the resource when you change this property.
26    pub enable_sso: Option<::Value<bool>>,
27    /// Property [`Name`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html#cfn-directoryservice-microsoftad-name).
28    ///
29    /// Update type: _Immutable_.
30    /// AWS CloudFormation replaces the resource when you change this property.
31    pub name: ::Value<String>,
32    /// Property [`Password`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html#cfn-directoryservice-microsoftad-password).
33    ///
34    /// Update type: _Immutable_.
35    /// AWS CloudFormation replaces the resource when you change this property.
36    pub password: ::Value<String>,
37    /// Property [`ShortName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html#cfn-directoryservice-microsoftad-shortname).
38    ///
39    /// Update type: _Immutable_.
40    /// AWS CloudFormation replaces the resource when you change this property.
41    pub short_name: Option<::Value<String>>,
42    /// Property [`VpcSettings`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-microsoftad.html#cfn-directoryservice-microsoftad-vpcsettings).
43    ///
44    /// Update type: _Immutable_.
45    /// AWS CloudFormation replaces the resource when you change this property.
46    pub vpc_settings: ::Value<self::microsoft_ad::VpcSettings>,
47}
48
49impl ::serde::Serialize for MicrosoftADProperties {
50    fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
51        let mut map = ::serde::Serializer::serialize_map(s, None)?;
52        if let Some(ref create_alias) = self.create_alias {
53            ::serde::ser::SerializeMap::serialize_entry(&mut map, "CreateAlias", create_alias)?;
54        }
55        if let Some(ref edition) = self.edition {
56            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Edition", edition)?;
57        }
58        if let Some(ref enable_sso) = self.enable_sso {
59            ::serde::ser::SerializeMap::serialize_entry(&mut map, "EnableSso", enable_sso)?;
60        }
61        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Name", &self.name)?;
62        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Password", &self.password)?;
63        if let Some(ref short_name) = self.short_name {
64            ::serde::ser::SerializeMap::serialize_entry(&mut map, "ShortName", short_name)?;
65        }
66        ::serde::ser::SerializeMap::serialize_entry(&mut map, "VpcSettings", &self.vpc_settings)?;
67        ::serde::ser::SerializeMap::end(map)
68    }
69}
70
71impl<'de> ::serde::Deserialize<'de> for MicrosoftADProperties {
72    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<MicrosoftADProperties, D::Error> {
73        struct Visitor;
74
75        impl<'de> ::serde::de::Visitor<'de> for Visitor {
76            type Value = MicrosoftADProperties;
77
78            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
79                write!(f, "a struct of type MicrosoftADProperties")
80            }
81
82            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
83                let mut create_alias: Option<::Value<bool>> = None;
84                let mut edition: Option<::Value<String>> = None;
85                let mut enable_sso: Option<::Value<bool>> = None;
86                let mut name: Option<::Value<String>> = None;
87                let mut password: Option<::Value<String>> = None;
88                let mut short_name: Option<::Value<String>> = None;
89                let mut vpc_settings: Option<::Value<self::microsoft_ad::VpcSettings>> = None;
90
91                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
92                    match __cfn_key.as_ref() {
93                        "CreateAlias" => {
94                            create_alias = ::serde::de::MapAccess::next_value(&mut map)?;
95                        }
96                        "Edition" => {
97                            edition = ::serde::de::MapAccess::next_value(&mut map)?;
98                        }
99                        "EnableSso" => {
100                            enable_sso = ::serde::de::MapAccess::next_value(&mut map)?;
101                        }
102                        "Name" => {
103                            name = ::serde::de::MapAccess::next_value(&mut map)?;
104                        }
105                        "Password" => {
106                            password = ::serde::de::MapAccess::next_value(&mut map)?;
107                        }
108                        "ShortName" => {
109                            short_name = ::serde::de::MapAccess::next_value(&mut map)?;
110                        }
111                        "VpcSettings" => {
112                            vpc_settings = ::serde::de::MapAccess::next_value(&mut map)?;
113                        }
114                        _ => {}
115                    }
116                }
117
118                Ok(MicrosoftADProperties {
119                    create_alias: create_alias,
120                    edition: edition,
121                    enable_sso: enable_sso,
122                    name: name.ok_or(::serde::de::Error::missing_field("Name"))?,
123                    password: password.ok_or(::serde::de::Error::missing_field("Password"))?,
124                    short_name: short_name,
125                    vpc_settings: vpc_settings.ok_or(::serde::de::Error::missing_field("VpcSettings"))?,
126                })
127            }
128        }
129
130        d.deserialize_map(Visitor)
131    }
132}
133
134impl ::Resource for MicrosoftAD {
135    type Properties = MicrosoftADProperties;
136    const TYPE: &'static str = "AWS::DirectoryService::MicrosoftAD";
137    fn properties(&self) -> &MicrosoftADProperties {
138        &self.properties
139    }
140    fn properties_mut(&mut self) -> &mut MicrosoftADProperties {
141        &mut self.properties
142    }
143}
144
145impl ::private::Sealed for MicrosoftAD {}
146
147impl From<MicrosoftADProperties> for MicrosoftAD {
148    fn from(properties: MicrosoftADProperties) -> MicrosoftAD {
149        MicrosoftAD { properties }
150    }
151}
152
153/// The [`AWS::DirectoryService::SimpleAD`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html) resource type.
154#[derive(Debug, Default)]
155pub struct SimpleAD {
156    properties: SimpleADProperties
157}
158
159/// Properties for the `SimpleAD` resource.
160#[derive(Debug, Default)]
161pub struct SimpleADProperties {
162    /// Property [`CreateAlias`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-createalias).
163    ///
164    /// Update type: _Immutable_.
165    /// AWS CloudFormation replaces the resource when you change this property.
166    pub create_alias: Option<::Value<bool>>,
167    /// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-description).
168    ///
169    /// Update type: _Immutable_.
170    /// AWS CloudFormation replaces the resource when you change this property.
171    pub description: Option<::Value<String>>,
172    /// Property [`EnableSso`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-enablesso).
173    ///
174    /// Update type: _Mutable_.
175    /// AWS CloudFormation doesn't replace the resource when you change this property.
176    pub enable_sso: Option<::Value<bool>>,
177    /// Property [`Name`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-name).
178    ///
179    /// Update type: _Immutable_.
180    /// AWS CloudFormation replaces the resource when you change this property.
181    pub name: ::Value<String>,
182    /// Property [`Password`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-password).
183    ///
184    /// Update type: _Immutable_.
185    /// AWS CloudFormation replaces the resource when you change this property.
186    pub password: ::Value<String>,
187    /// Property [`ShortName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-shortname).
188    ///
189    /// Update type: _Immutable_.
190    /// AWS CloudFormation replaces the resource when you change this property.
191    pub short_name: Option<::Value<String>>,
192    /// Property [`Size`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-size).
193    ///
194    /// Update type: _Immutable_.
195    /// AWS CloudFormation replaces the resource when you change this property.
196    pub size: ::Value<String>,
197    /// Property [`VpcSettings`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html#cfn-directoryservice-simplead-vpcsettings).
198    ///
199    /// Update type: _Immutable_.
200    /// AWS CloudFormation replaces the resource when you change this property.
201    pub vpc_settings: ::Value<self::simple_ad::VpcSettings>,
202}
203
204impl ::serde::Serialize for SimpleADProperties {
205    fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
206        let mut map = ::serde::Serializer::serialize_map(s, None)?;
207        if let Some(ref create_alias) = self.create_alias {
208            ::serde::ser::SerializeMap::serialize_entry(&mut map, "CreateAlias", create_alias)?;
209        }
210        if let Some(ref description) = self.description {
211            ::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
212        }
213        if let Some(ref enable_sso) = self.enable_sso {
214            ::serde::ser::SerializeMap::serialize_entry(&mut map, "EnableSso", enable_sso)?;
215        }
216        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Name", &self.name)?;
217        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Password", &self.password)?;
218        if let Some(ref short_name) = self.short_name {
219            ::serde::ser::SerializeMap::serialize_entry(&mut map, "ShortName", short_name)?;
220        }
221        ::serde::ser::SerializeMap::serialize_entry(&mut map, "Size", &self.size)?;
222        ::serde::ser::SerializeMap::serialize_entry(&mut map, "VpcSettings", &self.vpc_settings)?;
223        ::serde::ser::SerializeMap::end(map)
224    }
225}
226
227impl<'de> ::serde::Deserialize<'de> for SimpleADProperties {
228    fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<SimpleADProperties, D::Error> {
229        struct Visitor;
230
231        impl<'de> ::serde::de::Visitor<'de> for Visitor {
232            type Value = SimpleADProperties;
233
234            fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
235                write!(f, "a struct of type SimpleADProperties")
236            }
237
238            fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
239                let mut create_alias: Option<::Value<bool>> = None;
240                let mut description: Option<::Value<String>> = None;
241                let mut enable_sso: Option<::Value<bool>> = None;
242                let mut name: Option<::Value<String>> = None;
243                let mut password: Option<::Value<String>> = None;
244                let mut short_name: Option<::Value<String>> = None;
245                let mut size: Option<::Value<String>> = None;
246                let mut vpc_settings: Option<::Value<self::simple_ad::VpcSettings>> = None;
247
248                while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
249                    match __cfn_key.as_ref() {
250                        "CreateAlias" => {
251                            create_alias = ::serde::de::MapAccess::next_value(&mut map)?;
252                        }
253                        "Description" => {
254                            description = ::serde::de::MapAccess::next_value(&mut map)?;
255                        }
256                        "EnableSso" => {
257                            enable_sso = ::serde::de::MapAccess::next_value(&mut map)?;
258                        }
259                        "Name" => {
260                            name = ::serde::de::MapAccess::next_value(&mut map)?;
261                        }
262                        "Password" => {
263                            password = ::serde::de::MapAccess::next_value(&mut map)?;
264                        }
265                        "ShortName" => {
266                            short_name = ::serde::de::MapAccess::next_value(&mut map)?;
267                        }
268                        "Size" => {
269                            size = ::serde::de::MapAccess::next_value(&mut map)?;
270                        }
271                        "VpcSettings" => {
272                            vpc_settings = ::serde::de::MapAccess::next_value(&mut map)?;
273                        }
274                        _ => {}
275                    }
276                }
277
278                Ok(SimpleADProperties {
279                    create_alias: create_alias,
280                    description: description,
281                    enable_sso: enable_sso,
282                    name: name.ok_or(::serde::de::Error::missing_field("Name"))?,
283                    password: password.ok_or(::serde::de::Error::missing_field("Password"))?,
284                    short_name: short_name,
285                    size: size.ok_or(::serde::de::Error::missing_field("Size"))?,
286                    vpc_settings: vpc_settings.ok_or(::serde::de::Error::missing_field("VpcSettings"))?,
287                })
288            }
289        }
290
291        d.deserialize_map(Visitor)
292    }
293}
294
295impl ::Resource for SimpleAD {
296    type Properties = SimpleADProperties;
297    const TYPE: &'static str = "AWS::DirectoryService::SimpleAD";
298    fn properties(&self) -> &SimpleADProperties {
299        &self.properties
300    }
301    fn properties_mut(&mut self) -> &mut SimpleADProperties {
302        &mut self.properties
303    }
304}
305
306impl ::private::Sealed for SimpleAD {}
307
308impl From<SimpleADProperties> for SimpleAD {
309    fn from(properties: SimpleADProperties) -> SimpleAD {
310        SimpleAD { properties }
311    }
312}
313
314pub mod microsoft_ad {
315    //! Property types for the `MicrosoftAD` resource.
316
317    /// The [`AWS::DirectoryService::MicrosoftAD.VpcSettings`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-directoryservice-microsoftad-vpcsettings.html) property type.
318    #[derive(Debug, Default)]
319    pub struct VpcSettings {
320        /// Property [`SubnetIds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-directoryservice-microsoftad-vpcsettings.html#cfn-directoryservice-microsoftad-vpcsettings-subnetids).
321        ///
322        /// Update type: _Mutable_.
323        /// AWS CloudFormation doesn't replace the resource when you change this property.
324        pub subnet_ids: ::ValueList<String>,
325        /// Property [`VpcId`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-directoryservice-microsoftad-vpcsettings.html#cfn-directoryservice-microsoftad-vpcsettings-vpcid).
326        ///
327        /// Update type: _Mutable_.
328        /// AWS CloudFormation doesn't replace the resource when you change this property.
329        pub vpc_id: ::Value<String>,
330    }
331
332    impl ::codec::SerializeValue for VpcSettings {
333        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
334            let mut map = ::serde::Serializer::serialize_map(s, None)?;
335            ::serde::ser::SerializeMap::serialize_entry(&mut map, "SubnetIds", &self.subnet_ids)?;
336            ::serde::ser::SerializeMap::serialize_entry(&mut map, "VpcId", &self.vpc_id)?;
337            ::serde::ser::SerializeMap::end(map)
338        }
339    }
340
341    impl ::codec::DeserializeValue for VpcSettings {
342        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<VpcSettings, D::Error> {
343            struct Visitor;
344
345            impl<'de> ::serde::de::Visitor<'de> for Visitor {
346                type Value = VpcSettings;
347
348                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
349                    write!(f, "a struct of type VpcSettings")
350                }
351
352                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
353                    let mut subnet_ids: Option<::ValueList<String>> = None;
354                    let mut vpc_id: Option<::Value<String>> = None;
355
356                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
357                        match __cfn_key.as_ref() {
358                            "SubnetIds" => {
359                                subnet_ids = ::serde::de::MapAccess::next_value(&mut map)?;
360                            }
361                            "VpcId" => {
362                                vpc_id = ::serde::de::MapAccess::next_value(&mut map)?;
363                            }
364                            _ => {}
365                        }
366                    }
367
368                    Ok(VpcSettings {
369                        subnet_ids: subnet_ids.ok_or(::serde::de::Error::missing_field("SubnetIds"))?,
370                        vpc_id: vpc_id.ok_or(::serde::de::Error::missing_field("VpcId"))?,
371                    })
372                }
373            }
374
375            d.deserialize_map(Visitor)
376        }
377    }
378}
379
380pub mod simple_ad {
381    //! Property types for the `SimpleAD` resource.
382
383    /// The [`AWS::DirectoryService::SimpleAD.VpcSettings`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-directoryservice-simplead-vpcsettings.html) property type.
384    #[derive(Debug, Default)]
385    pub struct VpcSettings {
386        /// Property [`SubnetIds`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-directoryservice-simplead-vpcsettings.html#cfn-directoryservice-simplead-vpcsettings-subnetids).
387        ///
388        /// Update type: _Mutable_.
389        /// AWS CloudFormation doesn't replace the resource when you change this property.
390        pub subnet_ids: ::ValueList<String>,
391        /// Property [`VpcId`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-directoryservice-simplead-vpcsettings.html#cfn-directoryservice-simplead-vpcsettings-vpcid).
392        ///
393        /// Update type: _Mutable_.
394        /// AWS CloudFormation doesn't replace the resource when you change this property.
395        pub vpc_id: ::Value<String>,
396    }
397
398    impl ::codec::SerializeValue for VpcSettings {
399        fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
400            let mut map = ::serde::Serializer::serialize_map(s, None)?;
401            ::serde::ser::SerializeMap::serialize_entry(&mut map, "SubnetIds", &self.subnet_ids)?;
402            ::serde::ser::SerializeMap::serialize_entry(&mut map, "VpcId", &self.vpc_id)?;
403            ::serde::ser::SerializeMap::end(map)
404        }
405    }
406
407    impl ::codec::DeserializeValue for VpcSettings {
408        fn deserialize<'de, D: ::serde::Deserializer<'de>>(d: D) -> Result<VpcSettings, D::Error> {
409            struct Visitor;
410
411            impl<'de> ::serde::de::Visitor<'de> for Visitor {
412                type Value = VpcSettings;
413
414                fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
415                    write!(f, "a struct of type VpcSettings")
416                }
417
418                fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
419                    let mut subnet_ids: Option<::ValueList<String>> = None;
420                    let mut vpc_id: Option<::Value<String>> = None;
421
422                    while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
423                        match __cfn_key.as_ref() {
424                            "SubnetIds" => {
425                                subnet_ids = ::serde::de::MapAccess::next_value(&mut map)?;
426                            }
427                            "VpcId" => {
428                                vpc_id = ::serde::de::MapAccess::next_value(&mut map)?;
429                            }
430                            _ => {}
431                        }
432                    }
433
434                    Ok(VpcSettings {
435                        subnet_ids: subnet_ids.ok_or(::serde::de::Error::missing_field("SubnetIds"))?,
436                        vpc_id: vpc_id.ok_or(::serde::de::Error::missing_field("VpcId"))?,
437                    })
438                }
439            }
440
441            d.deserialize_map(Visitor)
442        }
443    }
444}