aws_sdk_ec2/protocol_serde/
shape_create_vpc_endpoint_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_create_vpc_endpoint_input_input_input(
3    input: &crate::operation::create_vpc_endpoint::CreateVpcEndpointInput,
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, "CreateVpcEndpoint", "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("VpcEndpointType");
15    if let Some(var_4) = &input.vpc_endpoint_type {
16        scope_3.string(var_4.as_str());
17    }
18    #[allow(unused_mut)]
19    let mut scope_5 = writer.prefix("VpcId");
20    if let Some(var_6) = &input.vpc_id {
21        scope_5.string(var_6);
22    }
23    #[allow(unused_mut)]
24    let mut scope_7 = writer.prefix("ServiceName");
25    if let Some(var_8) = &input.service_name {
26        scope_7.string(var_8);
27    }
28    #[allow(unused_mut)]
29    let mut scope_9 = writer.prefix("PolicyDocument");
30    if let Some(var_10) = &input.policy_document {
31        scope_9.string(var_10);
32    }
33    #[allow(unused_mut)]
34    let mut scope_11 = writer.prefix("RouteTableId");
35    if let Some(var_12) = &input.route_table_ids {
36        if !var_12.is_empty() {
37            let mut list_14 = scope_11.start_list(true, Some("item"));
38            for item_13 in var_12 {
39                #[allow(unused_mut)]
40                let mut entry_15 = list_14.entry();
41                entry_15.string(item_13);
42            }
43            list_14.finish();
44        }
45    }
46    #[allow(unused_mut)]
47    let mut scope_16 = writer.prefix("SubnetId");
48    if let Some(var_17) = &input.subnet_ids {
49        if !var_17.is_empty() {
50            let mut list_19 = scope_16.start_list(true, Some("item"));
51            for item_18 in var_17 {
52                #[allow(unused_mut)]
53                let mut entry_20 = list_19.entry();
54                entry_20.string(item_18);
55            }
56            list_19.finish();
57        }
58    }
59    #[allow(unused_mut)]
60    let mut scope_21 = writer.prefix("SecurityGroupId");
61    if let Some(var_22) = &input.security_group_ids {
62        if !var_22.is_empty() {
63            let mut list_24 = scope_21.start_list(true, Some("item"));
64            for item_23 in var_22 {
65                #[allow(unused_mut)]
66                let mut entry_25 = list_24.entry();
67                entry_25.string(item_23);
68            }
69            list_24.finish();
70        }
71    }
72    #[allow(unused_mut)]
73    let mut scope_26 = writer.prefix("IpAddressType");
74    if let Some(var_27) = &input.ip_address_type {
75        scope_26.string(var_27.as_str());
76    }
77    #[allow(unused_mut)]
78    let mut scope_28 = writer.prefix("DnsOptions");
79    if let Some(var_29) = &input.dns_options {
80        crate::protocol_serde::shape_dns_options_specification::ser_dns_options_specification(scope_28, var_29)?;
81    }
82    #[allow(unused_mut)]
83    let mut scope_30 = writer.prefix("ClientToken");
84    if let Some(var_31) = &input.client_token {
85        scope_30.string(var_31);
86    }
87    #[allow(unused_mut)]
88    let mut scope_32 = writer.prefix("PrivateDnsEnabled");
89    if let Some(var_33) = &input.private_dns_enabled {
90        scope_32.boolean(*var_33);
91    }
92    #[allow(unused_mut)]
93    let mut scope_34 = writer.prefix("TagSpecification");
94    if let Some(var_35) = &input.tag_specifications {
95        if !var_35.is_empty() {
96            let mut list_37 = scope_34.start_list(true, Some("item"));
97            for item_36 in var_35 {
98                #[allow(unused_mut)]
99                let mut entry_38 = list_37.entry();
100                crate::protocol_serde::shape_tag_specification::ser_tag_specification(entry_38, item_36)?;
101            }
102            list_37.finish();
103        }
104    }
105    #[allow(unused_mut)]
106    let mut scope_39 = writer.prefix("SubnetConfiguration");
107    if let Some(var_40) = &input.subnet_configurations {
108        if !var_40.is_empty() {
109            let mut list_42 = scope_39.start_list(true, Some("item"));
110            for item_41 in var_40 {
111                #[allow(unused_mut)]
112                let mut entry_43 = list_42.entry();
113                crate::protocol_serde::shape_subnet_configuration::ser_subnet_configuration(entry_43, item_41)?;
114            }
115            list_42.finish();
116        }
117    }
118    #[allow(unused_mut)]
119    let mut scope_44 = writer.prefix("ServiceNetworkArn");
120    if let Some(var_45) = &input.service_network_arn {
121        scope_44.string(var_45);
122    }
123    #[allow(unused_mut)]
124    let mut scope_46 = writer.prefix("ResourceConfigurationArn");
125    if let Some(var_47) = &input.resource_configuration_arn {
126        scope_46.string(var_47);
127    }
128    #[allow(unused_mut)]
129    let mut scope_48 = writer.prefix("ServiceRegion");
130    if let Some(var_49) = &input.service_region {
131        scope_48.string(var_49);
132    }
133    writer.finish();
134    Ok(::aws_smithy_types::body::SdkBody::from(out))
135}