aws_sdk_ec2/protocol_serde/
shape_modify_vpc_endpoint_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_modify_vpc_endpoint_input_input_input(
3    input: &crate::operation::modify_vpc_endpoint::ModifyVpcEndpointInput,
4) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
5    let mut out = String::new();
6    #[allow(unused_mut)]
7    let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "ModifyVpcEndpoint", "2016-11-15");
8    #[allow(unused_mut)]
9    let mut scope_1 = writer.prefix("DryRun");
10    if let Some(var_2) = &input.dry_run {
11        scope_1.boolean(*var_2);
12    }
13    #[allow(unused_mut)]
14    let mut scope_3 = writer.prefix("VpcEndpointId");
15    if let Some(var_4) = &input.vpc_endpoint_id {
16        scope_3.string(var_4);
17    }
18    #[allow(unused_mut)]
19    let mut scope_5 = writer.prefix("ResetPolicy");
20    if let Some(var_6) = &input.reset_policy {
21        scope_5.boolean(*var_6);
22    }
23    #[allow(unused_mut)]
24    let mut scope_7 = writer.prefix("PolicyDocument");
25    if let Some(var_8) = &input.policy_document {
26        scope_7.string(var_8);
27    }
28    #[allow(unused_mut)]
29    let mut scope_9 = writer.prefix("AddRouteTableId");
30    if let Some(var_10) = &input.add_route_table_ids {
31        if !var_10.is_empty() {
32            let mut list_12 = scope_9.start_list(true, Some("item"));
33            for item_11 in var_10 {
34                #[allow(unused_mut)]
35                let mut entry_13 = list_12.entry();
36                entry_13.string(item_11);
37            }
38            list_12.finish();
39        }
40    }
41    #[allow(unused_mut)]
42    let mut scope_14 = writer.prefix("RemoveRouteTableId");
43    if let Some(var_15) = &input.remove_route_table_ids {
44        if !var_15.is_empty() {
45            let mut list_17 = scope_14.start_list(true, Some("item"));
46            for item_16 in var_15 {
47                #[allow(unused_mut)]
48                let mut entry_18 = list_17.entry();
49                entry_18.string(item_16);
50            }
51            list_17.finish();
52        }
53    }
54    #[allow(unused_mut)]
55    let mut scope_19 = writer.prefix("AddSubnetId");
56    if let Some(var_20) = &input.add_subnet_ids {
57        if !var_20.is_empty() {
58            let mut list_22 = scope_19.start_list(true, Some("item"));
59            for item_21 in var_20 {
60                #[allow(unused_mut)]
61                let mut entry_23 = list_22.entry();
62                entry_23.string(item_21);
63            }
64            list_22.finish();
65        }
66    }
67    #[allow(unused_mut)]
68    let mut scope_24 = writer.prefix("RemoveSubnetId");
69    if let Some(var_25) = &input.remove_subnet_ids {
70        if !var_25.is_empty() {
71            let mut list_27 = scope_24.start_list(true, Some("item"));
72            for item_26 in var_25 {
73                #[allow(unused_mut)]
74                let mut entry_28 = list_27.entry();
75                entry_28.string(item_26);
76            }
77            list_27.finish();
78        }
79    }
80    #[allow(unused_mut)]
81    let mut scope_29 = writer.prefix("AddSecurityGroupId");
82    if let Some(var_30) = &input.add_security_group_ids {
83        if !var_30.is_empty() {
84            let mut list_32 = scope_29.start_list(true, Some("item"));
85            for item_31 in var_30 {
86                #[allow(unused_mut)]
87                let mut entry_33 = list_32.entry();
88                entry_33.string(item_31);
89            }
90            list_32.finish();
91        }
92    }
93    #[allow(unused_mut)]
94    let mut scope_34 = writer.prefix("RemoveSecurityGroupId");
95    if let Some(var_35) = &input.remove_security_group_ids {
96        if !var_35.is_empty() {
97            let mut list_37 = scope_34.start_list(true, Some("item"));
98            for item_36 in var_35 {
99                #[allow(unused_mut)]
100                let mut entry_38 = list_37.entry();
101                entry_38.string(item_36);
102            }
103            list_37.finish();
104        }
105    }
106    #[allow(unused_mut)]
107    let mut scope_39 = writer.prefix("IpAddressType");
108    if let Some(var_40) = &input.ip_address_type {
109        scope_39.string(var_40.as_str());
110    }
111    #[allow(unused_mut)]
112    let mut scope_41 = writer.prefix("DnsOptions");
113    if let Some(var_42) = &input.dns_options {
114        crate::protocol_serde::shape_dns_options_specification::ser_dns_options_specification(scope_41, var_42)?;
115    }
116    #[allow(unused_mut)]
117    let mut scope_43 = writer.prefix("PrivateDnsEnabled");
118    if let Some(var_44) = &input.private_dns_enabled {
119        scope_43.boolean(*var_44);
120    }
121    #[allow(unused_mut)]
122    let mut scope_45 = writer.prefix("SubnetConfiguration");
123    if let Some(var_46) = &input.subnet_configurations {
124        if !var_46.is_empty() {
125            let mut list_48 = scope_45.start_list(true, Some("item"));
126            for item_47 in var_46 {
127                #[allow(unused_mut)]
128                let mut entry_49 = list_48.entry();
129                crate::protocol_serde::shape_subnet_configuration::ser_subnet_configuration(entry_49, item_47)?;
130            }
131            list_48.finish();
132        }
133    }
134    writer.finish();
135    Ok(::aws_smithy_types::body::SdkBody::from(out))
136}