aws-sdk-ec2 1.221.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn ser_create_image_input_input_input(
    input: &crate::operation::create_image::CreateImageInput,
) -> ::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, "CreateImage", "2016-11-15");
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("TagSpecification");
    if let Some(var_2) = &input.tag_specifications {
        if !var_2.is_empty() {
            let mut list_4 = scope_1.start_list(true, Some("item"));
            for item_3 in var_2 {
                #[allow(unused_mut)]
                let mut entry_5 = list_4.entry();
                crate::protocol_serde::shape_tag_specification::ser_tag_specification(entry_5, item_3)?;
            }
            list_4.finish();
        }
    }
    #[allow(unused_mut)]
    let mut scope_6 = writer.prefix("SnapshotLocation");
    if let Some(var_7) = &input.snapshot_location {
        scope_6.string(var_7.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_8 = writer.prefix("DryRun");
    if let Some(var_9) = &input.dry_run {
        scope_8.boolean(*var_9);
    }
    #[allow(unused_mut)]
    let mut scope_10 = writer.prefix("InstanceId");
    if let Some(var_11) = &input.instance_id {
        scope_10.string(var_11);
    }
    #[allow(unused_mut)]
    let mut scope_12 = writer.prefix("Name");
    if let Some(var_13) = &input.name {
        scope_12.string(var_13);
    }
    #[allow(unused_mut)]
    let mut scope_14 = writer.prefix("Description");
    if let Some(var_15) = &input.description {
        scope_14.string(var_15);
    }
    #[allow(unused_mut)]
    let mut scope_16 = writer.prefix("NoReboot");
    if let Some(var_17) = &input.no_reboot {
        scope_16.boolean(*var_17);
    }
    #[allow(unused_mut)]
    let mut scope_18 = writer.prefix("BlockDeviceMapping");
    if let Some(var_19) = &input.block_device_mappings {
        if !var_19.is_empty() {
            let mut list_21 = scope_18.start_list(true, Some("BlockDeviceMapping"));
            for item_20 in var_19 {
                #[allow(unused_mut)]
                let mut entry_22 = list_21.entry();
                crate::protocol_serde::shape_block_device_mapping::ser_block_device_mapping(entry_22, item_20)?;
            }
            list_21.finish();
        }
    }
    writer.finish();
    Ok(::aws_smithy_types::body::SdkBody::from(out))
}