aws_sdk_ec2/protocol_serde/
shape_target_groups_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_target_groups_config(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::TargetGroupsConfig,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("TargetGroups");
9    if let Some(var_2) = &input.target_groups {
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                crate::protocol_serde::shape_target_group::ser_target_group(entry_5, item_3)?;
16            }
17            list_4.finish();
18        }
19    }
20    Ok(())
21}
22
23#[allow(clippy::needless_question_mark)]
24pub fn de_target_groups_config(
25    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
26) -> ::std::result::Result<crate::types::TargetGroupsConfig, ::aws_smithy_xml::decode::XmlDecodeError> {
27    #[allow(unused_mut)]
28    let mut builder = crate::types::TargetGroupsConfig::builder();
29    while let Some(mut tag) = decoder.next_tag() {
30        match tag.start_el() {
31            s if s.matches("targetGroups") /* TargetGroups com.amazonaws.ec2#TargetGroupsConfig$TargetGroups */ =>  {
32                let var_6 =
33                    Some(
34                        crate::protocol_serde::shape_target_groups::de_target_groups(&mut tag)
35                        ?
36                    )
37                ;
38                builder = builder.set_target_groups(var_6);
39            }
40            ,
41            _ => {}
42        }
43    }
44    Ok(builder.build())
45}