aws_sdk_ec2/protocol_serde/
shape_target_capacity_specification_request.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_target_capacity_specification_request(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::TargetCapacitySpecificationRequest,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("TotalTargetCapacity");
9    if let Some(var_2) = &input.total_target_capacity {
10        scope_1.number(
11            #[allow(clippy::useless_conversion)]
12            ::aws_smithy_types::Number::NegInt((*var_2).into()),
13        );
14    }
15    #[allow(unused_mut)]
16    let mut scope_3 = writer.prefix("OnDemandTargetCapacity");
17    if let Some(var_4) = &input.on_demand_target_capacity {
18        scope_3.number(
19            #[allow(clippy::useless_conversion)]
20            ::aws_smithy_types::Number::NegInt((*var_4).into()),
21        );
22    }
23    #[allow(unused_mut)]
24    let mut scope_5 = writer.prefix("SpotTargetCapacity");
25    if let Some(var_6) = &input.spot_target_capacity {
26        scope_5.number(
27            #[allow(clippy::useless_conversion)]
28            ::aws_smithy_types::Number::NegInt((*var_6).into()),
29        );
30    }
31    #[allow(unused_mut)]
32    let mut scope_7 = writer.prefix("DefaultTargetCapacityType");
33    if let Some(var_8) = &input.default_target_capacity_type {
34        scope_7.string(var_8.as_str());
35    }
36    #[allow(unused_mut)]
37    let mut scope_9 = writer.prefix("TargetCapacityUnitType");
38    if let Some(var_10) = &input.target_capacity_unit_type {
39        scope_9.string(var_10.as_str());
40    }
41    Ok(())
42}