aws_sdk_autoscaling/protocol_serde/
shape_desired_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_desired_configuration(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::DesiredConfiguration,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("LaunchTemplate");
9    if let Some(var_2) = &input.launch_template {
10        crate::protocol_serde::shape_launch_template_specification::ser_launch_template_specification(scope_1, var_2)?;
11    }
12    #[allow(unused_mut)]
13    let mut scope_3 = writer.prefix("MixedInstancesPolicy");
14    if let Some(var_4) = &input.mixed_instances_policy {
15        crate::protocol_serde::shape_mixed_instances_policy::ser_mixed_instances_policy(scope_3, var_4)?;
16    }
17    Ok(())
18}
19
20#[allow(clippy::needless_question_mark)]
21pub fn de_desired_configuration(
22    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
23) -> ::std::result::Result<crate::types::DesiredConfiguration, ::aws_smithy_xml::decode::XmlDecodeError> {
24    #[allow(unused_mut)]
25    let mut builder = crate::types::DesiredConfiguration::builder();
26    while let Some(mut tag) = decoder.next_tag() {
27        match tag.start_el() {
28            s if s.matches("LaunchTemplate") /* LaunchTemplate com.amazonaws.autoscaling#DesiredConfiguration$LaunchTemplate */ =>  {
29                let var_5 =
30                    Some(
31                        crate::protocol_serde::shape_launch_template_specification::de_launch_template_specification(&mut tag)
32                        ?
33                    )
34                ;
35                builder = builder.set_launch_template(var_5);
36            }
37            ,
38            s if s.matches("MixedInstancesPolicy") /* MixedInstancesPolicy com.amazonaws.autoscaling#DesiredConfiguration$MixedInstancesPolicy */ =>  {
39                let var_6 =
40                    Some(
41                        crate::protocol_serde::shape_mixed_instances_policy::de_mixed_instances_policy(&mut tag)
42                        ?
43                    )
44                ;
45                builder = builder.set_mixed_instances_policy(var_6);
46            }
47            ,
48            _ => {}
49        }
50    }
51    Ok(builder.build())
52}