pub fn ser_create_capacity_reservation_fleet_input_input_input(
input: &crate::operation::create_capacity_reservation_fleet::CreateCapacityReservationFleetInput,
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
let mut out = String::new();
#[allow(unused_mut)]
let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "CreateCapacityReservationFleet", "2016-11-15");
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("AllocationStrategy");
if let Some(var_2) = &input.allocation_strategy {
scope_1.string(var_2);
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("ClientToken");
if let Some(var_4) = &input.client_token {
scope_3.string(var_4);
}
#[allow(unused_mut)]
let mut scope_5 = writer.prefix("InstanceTypeSpecification");
if let Some(var_6) = &input.instance_type_specifications {
if !var_6.is_empty() {
let mut list_8 = scope_5.start_list(true, None);
for item_7 in var_6 {
#[allow(unused_mut)]
let mut entry_9 = list_8.entry();
crate::protocol_serde::shape_reservation_fleet_instance_specification::ser_reservation_fleet_instance_specification(entry_9, item_7)?;
}
list_8.finish();
}
}
#[allow(unused_mut)]
let mut scope_10 = writer.prefix("InstanceRequirements");
if let Some(var_11) = &input.instance_requirements {
crate::protocol_serde::shape_instance_requirements_request::ser_instance_requirements_request(scope_10, var_11)?;
}
#[allow(unused_mut)]
let mut scope_12 = writer.prefix("AvailabilityZone");
if let Some(var_13) = &input.availability_zone {
scope_12.string(var_13);
}
#[allow(unused_mut)]
let mut scope_14 = writer.prefix("AvailabilityZoneId");
if let Some(var_15) = &input.availability_zone_id {
scope_14.string(var_15);
}
#[allow(unused_mut)]
let mut scope_16 = writer.prefix("Tenancy");
if let Some(var_17) = &input.tenancy {
scope_16.string(var_17.as_str());
}
#[allow(unused_mut)]
let mut scope_18 = writer.prefix("TotalTargetCapacity");
if let Some(var_19) = &input.total_target_capacity {
scope_18.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_19).into()),
);
}
#[allow(unused_mut)]
let mut scope_20 = writer.prefix("EndDate");
if let Some(var_21) = &input.end_date {
scope_20.date_time(var_21, ::aws_smithy_types::date_time::Format::DateTime)?;
}
#[allow(unused_mut)]
let mut scope_22 = writer.prefix("InstanceMatchCriteria");
if let Some(var_23) = &input.instance_match_criteria {
scope_22.string(var_23.as_str());
}
#[allow(unused_mut)]
let mut scope_24 = writer.prefix("TagSpecification");
if let Some(var_25) = &input.tag_specifications {
if !var_25.is_empty() {
let mut list_27 = scope_24.start_list(true, Some("item"));
for item_26 in var_25 {
#[allow(unused_mut)]
let mut entry_28 = list_27.entry();
crate::protocol_serde::shape_tag_specification::ser_tag_specification(entry_28, item_26)?;
}
list_27.finish();
}
}
#[allow(unused_mut)]
let mut scope_29 = writer.prefix("DryRun");
if let Some(var_30) = &input.dry_run {
scope_29.boolean(*var_30);
}
writer.finish();
Ok(::aws_smithy_types::body::SdkBody::from(out))
}