aws_sdk_ec2/protocol_serde/
shape_describe_vpn_gateways_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_describe_vpn_gateways_input_input_input(
3    input: &crate::operation::describe_vpn_gateways::DescribeVpnGatewaysInput,
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, "DescribeVpnGateways", "2016-11-15");
8    #[allow(unused_mut)]
9    let mut scope_1 = writer.prefix("Filter");
10    if let Some(var_2) = &input.filters {
11        if !var_2.is_empty() {
12            let mut list_4 = scope_1.start_list(true, Some("Filter"));
13            for item_3 in var_2 {
14                #[allow(unused_mut)]
15                let mut entry_5 = list_4.entry();
16                crate::protocol_serde::shape_filter::ser_filter(entry_5, item_3)?;
17            }
18            list_4.finish();
19        }
20    }
21    #[allow(unused_mut)]
22    let mut scope_6 = writer.prefix("VpnGatewayId");
23    if let Some(var_7) = &input.vpn_gateway_ids {
24        if !var_7.is_empty() {
25            let mut list_9 = scope_6.start_list(true, Some("VpnGatewayId"));
26            for item_8 in var_7 {
27                #[allow(unused_mut)]
28                let mut entry_10 = list_9.entry();
29                entry_10.string(item_8);
30            }
31            list_9.finish();
32        }
33    }
34    #[allow(unused_mut)]
35    let mut scope_11 = writer.prefix("DryRun");
36    if let Some(var_12) = &input.dry_run {
37        scope_11.boolean(*var_12);
38    }
39    writer.finish();
40    Ok(::aws_smithy_types::body::SdkBody::from(out))
41}