aws_sdk_ec2/protocol_serde/
shape_on_demand_options_request.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_on_demand_options_request(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::OnDemandOptionsRequest,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("AllocationStrategy");
9    if let Some(var_2) = &input.allocation_strategy {
10        scope_1.string(var_2.as_str());
11    }
12    #[allow(unused_mut)]
13    let mut scope_3 = writer.prefix("CapacityReservationOptions");
14    if let Some(var_4) = &input.capacity_reservation_options {
15        crate::protocol_serde::shape_capacity_reservation_options_request::ser_capacity_reservation_options_request(scope_3, var_4)?;
16    }
17    #[allow(unused_mut)]
18    let mut scope_5 = writer.prefix("SingleInstanceType");
19    if let Some(var_6) = &input.single_instance_type {
20        scope_5.boolean(*var_6);
21    }
22    #[allow(unused_mut)]
23    let mut scope_7 = writer.prefix("SingleAvailabilityZone");
24    if let Some(var_8) = &input.single_availability_zone {
25        scope_7.boolean(*var_8);
26    }
27    #[allow(unused_mut)]
28    let mut scope_9 = writer.prefix("MinTargetCapacity");
29    if let Some(var_10) = &input.min_target_capacity {
30        scope_9.number(
31            #[allow(clippy::useless_conversion)]
32            ::aws_smithy_types::Number::NegInt((*var_10).into()),
33        );
34    }
35    #[allow(unused_mut)]
36    let mut scope_11 = writer.prefix("MaxTotalPrice");
37    if let Some(var_12) = &input.max_total_price {
38        scope_11.string(var_12);
39    }
40    Ok(())
41}