aws_sdk_ec2/protocol_serde/
shape_modify_spot_fleet_request_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_modify_spot_fleet_request_input_input_input(
3    input: &crate::operation::modify_spot_fleet_request::ModifySpotFleetRequestInput,
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, "ModifySpotFleetRequest", "2016-11-15");
8    #[allow(unused_mut)]
9    let mut scope_1 = writer.prefix("LaunchTemplateConfig");
10    if let Some(var_2) = &input.launch_template_configs {
11        if !var_2.is_empty() {
12            let mut list_4 = scope_1.start_list(true, Some("item"));
13            for item_3 in var_2 {
14                #[allow(unused_mut)]
15                let mut entry_5 = list_4.entry();
16                crate::protocol_serde::shape_launch_template_config::ser_launch_template_config(entry_5, item_3)?;
17            }
18            list_4.finish();
19        }
20    }
21    #[allow(unused_mut)]
22    let mut scope_6 = writer.prefix("OnDemandTargetCapacity");
23    if let Some(var_7) = &input.on_demand_target_capacity {
24        scope_6.number(
25            #[allow(clippy::useless_conversion)]
26            ::aws_smithy_types::Number::NegInt((*var_7).into()),
27        );
28    }
29    #[allow(unused_mut)]
30    let mut scope_8 = writer.prefix("Context");
31    if let Some(var_9) = &input.context {
32        scope_8.string(var_9);
33    }
34    #[allow(unused_mut)]
35    let mut scope_10 = writer.prefix("SpotFleetRequestId");
36    if let Some(var_11) = &input.spot_fleet_request_id {
37        scope_10.string(var_11);
38    }
39    #[allow(unused_mut)]
40    let mut scope_12 = writer.prefix("TargetCapacity");
41    if let Some(var_13) = &input.target_capacity {
42        scope_12.number(
43            #[allow(clippy::useless_conversion)]
44            ::aws_smithy_types::Number::NegInt((*var_13).into()),
45        );
46    }
47    #[allow(unused_mut)]
48    let mut scope_14 = writer.prefix("ExcessCapacityTerminationPolicy");
49    if let Some(var_15) = &input.excess_capacity_termination_policy {
50        scope_14.string(var_15.as_str());
51    }
52    writer.finish();
53    Ok(::aws_smithy_types::body::SdkBody::from(out))
54}