aws_sdk_ec2/protocol_serde/
shape_describe_regions_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_describe_regions_input_input_input(
3    input: &crate::operation::describe_regions::DescribeRegionsInput,
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, "DescribeRegions", "2016-11-15");
8    #[allow(unused_mut)]
9    let mut scope_1 = writer.prefix("RegionName");
10    if let Some(var_2) = &input.region_names {
11        if !var_2.is_empty() {
12            let mut list_4 = scope_1.start_list(true, Some("RegionName"));
13            for item_3 in var_2 {
14                #[allow(unused_mut)]
15                let mut entry_5 = list_4.entry();
16                entry_5.string(item_3);
17            }
18            list_4.finish();
19        }
20    }
21    #[allow(unused_mut)]
22    let mut scope_6 = writer.prefix("AllRegions");
23    if let Some(var_7) = &input.all_regions {
24        scope_6.boolean(*var_7);
25    }
26    #[allow(unused_mut)]
27    let mut scope_8 = writer.prefix("DryRun");
28    if let Some(var_9) = &input.dry_run {
29        scope_8.boolean(*var_9);
30    }
31    #[allow(unused_mut)]
32    let mut scope_10 = writer.prefix("Filter");
33    if let Some(var_11) = &input.filters {
34        if !var_11.is_empty() {
35            let mut list_13 = scope_10.start_list(true, Some("Filter"));
36            for item_12 in var_11 {
37                #[allow(unused_mut)]
38                let mut entry_14 = list_13.entry();
39                crate::protocol_serde::shape_filter::ser_filter(entry_14, item_12)?;
40            }
41            list_13.finish();
42        }
43    }
44    writer.finish();
45    Ok(::aws_smithy_types::body::SdkBody::from(out))
46}