aws_sdk_ec2/protocol_serde/
shape_packet_header_statement_request.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_packet_header_statement_request(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::PacketHeaderStatementRequest,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("SourceAddress");
9    if let Some(var_2) = &input.source_addresses {
10        if !var_2.is_empty() {
11            let mut list_4 = scope_1.start_list(true, Some("item"));
12            for item_3 in var_2 {
13                #[allow(unused_mut)]
14                let mut entry_5 = list_4.entry();
15                entry_5.string(item_3);
16            }
17            list_4.finish();
18        }
19    }
20    #[allow(unused_mut)]
21    let mut scope_6 = writer.prefix("DestinationAddress");
22    if let Some(var_7) = &input.destination_addresses {
23        if !var_7.is_empty() {
24            let mut list_9 = scope_6.start_list(true, Some("item"));
25            for item_8 in var_7 {
26                #[allow(unused_mut)]
27                let mut entry_10 = list_9.entry();
28                entry_10.string(item_8);
29            }
30            list_9.finish();
31        }
32    }
33    #[allow(unused_mut)]
34    let mut scope_11 = writer.prefix("SourcePort");
35    if let Some(var_12) = &input.source_ports {
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("DestinationPort");
48    if let Some(var_17) = &input.destination_ports {
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("SourcePrefixList");
61    if let Some(var_22) = &input.source_prefix_lists {
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("DestinationPrefixList");
74    if let Some(var_27) = &input.destination_prefix_lists {
75        if !var_27.is_empty() {
76            let mut list_29 = scope_26.start_list(true, Some("item"));
77            for item_28 in var_27 {
78                #[allow(unused_mut)]
79                let mut entry_30 = list_29.entry();
80                entry_30.string(item_28);
81            }
82            list_29.finish();
83        }
84    }
85    #[allow(unused_mut)]
86    let mut scope_31 = writer.prefix("Protocol");
87    if let Some(var_32) = &input.protocols {
88        if !var_32.is_empty() {
89            let mut list_34 = scope_31.start_list(true, Some("item"));
90            for item_33 in var_32 {
91                #[allow(unused_mut)]
92                let mut entry_35 = list_34.entry();
93                entry_35.string(item_33.as_str());
94            }
95            list_34.finish();
96        }
97    }
98    Ok(())
99}