aws-sdk-ec2 1.232.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_modify_instance_attribute_input_input_input(
    input: &crate::operation::modify_instance_attribute::ModifyInstanceAttributeInput,
) -> ::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, "ModifyInstanceAttribute", "2016-11-15");
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("SourceDestCheck");
    if let Some(var_2) = &input.source_dest_check {
        crate::protocol_serde::shape_attribute_boolean_value::ser_attribute_boolean_value(scope_1, var_2)?;
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("EnclaveOptions");
    if let Some(var_4) = &input.enclave_options {
        crate::protocol_serde::shape_enclave_options_request::ser_enclave_options_request(scope_3, var_4)?;
    }
    #[allow(unused_mut)]
    let mut scope_5 = writer.prefix("DisableApiStop");
    if let Some(var_6) = &input.disable_api_stop {
        crate::protocol_serde::shape_attribute_boolean_value::ser_attribute_boolean_value(scope_5, var_6)?;
    }
    #[allow(unused_mut)]
    let mut scope_7 = writer.prefix("DryRun");
    if let Some(var_8) = &input.dry_run {
        scope_7.boolean(*var_8);
    }
    #[allow(unused_mut)]
    let mut scope_9 = writer.prefix("InstanceId");
    if let Some(var_10) = &input.instance_id {
        scope_9.string(var_10);
    }
    #[allow(unused_mut)]
    let mut scope_11 = writer.prefix("Attribute");
    if let Some(var_12) = &input.attribute {
        scope_11.string(var_12.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_13 = writer.prefix("Value");
    if let Some(var_14) = &input.value {
        scope_13.string(var_14);
    }
    #[allow(unused_mut)]
    let mut scope_15 = writer.prefix("BlockDeviceMapping");
    if let Some(var_16) = &input.block_device_mappings {
        if !var_16.is_empty() {
            let mut list_18 = scope_15.start_list(true, Some("item"));
            for item_17 in var_16 {
                #[allow(unused_mut)]
                let mut entry_19 = list_18.entry();
                crate::protocol_serde::shape_instance_block_device_mapping_specification::ser_instance_block_device_mapping_specification(
                    entry_19, item_17,
                )?;
            }
            list_18.finish();
        }
    }
    #[allow(unused_mut)]
    let mut scope_20 = writer.prefix("DisableApiTermination");
    if let Some(var_21) = &input.disable_api_termination {
        crate::protocol_serde::shape_attribute_boolean_value::ser_attribute_boolean_value(scope_20, var_21)?;
    }
    #[allow(unused_mut)]
    let mut scope_22 = writer.prefix("InstanceType");
    if let Some(var_23) = &input.instance_type {
        crate::protocol_serde::shape_attribute_value::ser_attribute_value(scope_22, var_23)?;
    }
    #[allow(unused_mut)]
    let mut scope_24 = writer.prefix("Kernel");
    if let Some(var_25) = &input.kernel {
        crate::protocol_serde::shape_attribute_value::ser_attribute_value(scope_24, var_25)?;
    }
    #[allow(unused_mut)]
    let mut scope_26 = writer.prefix("Ramdisk");
    if let Some(var_27) = &input.ramdisk {
        crate::protocol_serde::shape_attribute_value::ser_attribute_value(scope_26, var_27)?;
    }
    #[allow(unused_mut)]
    let mut scope_28 = writer.prefix("UserData");
    if let Some(var_29) = &input.user_data {
        crate::protocol_serde::shape_blob_attribute_value::ser_blob_attribute_value(scope_28, var_29)?;
    }
    #[allow(unused_mut)]
    let mut scope_30 = writer.prefix("InstanceInitiatedShutdownBehavior");
    if let Some(var_31) = &input.instance_initiated_shutdown_behavior {
        crate::protocol_serde::shape_attribute_value::ser_attribute_value(scope_30, var_31)?;
    }
    #[allow(unused_mut)]
    let mut scope_32 = writer.prefix("GroupId");
    if let Some(var_33) = &input.groups {
        if !var_33.is_empty() {
            let mut list_35 = scope_32.start_list(true, Some("groupId"));
            for item_34 in var_33 {
                #[allow(unused_mut)]
                let mut entry_36 = list_35.entry();
                entry_36.string(item_34);
            }
            list_35.finish();
        }
    }
    #[allow(unused_mut)]
    let mut scope_37 = writer.prefix("EbsOptimized");
    if let Some(var_38) = &input.ebs_optimized {
        crate::protocol_serde::shape_attribute_boolean_value::ser_attribute_boolean_value(scope_37, var_38)?;
    }
    #[allow(unused_mut)]
    let mut scope_39 = writer.prefix("SriovNetSupport");
    if let Some(var_40) = &input.sriov_net_support {
        crate::protocol_serde::shape_attribute_value::ser_attribute_value(scope_39, var_40)?;
    }
    #[allow(unused_mut)]
    let mut scope_41 = writer.prefix("EnaSupport");
    if let Some(var_42) = &input.ena_support {
        crate::protocol_serde::shape_attribute_boolean_value::ser_attribute_boolean_value(scope_41, var_42)?;
    }
    writer.finish();
    Ok(::aws_smithy_types::body::SdkBody::from(out))
}