// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_cancel_quantum_task_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CancelQuantumTaskInput,
) {
    if let Some(var_1) = &input.client_token {
        object.key("clientToken").string(var_1);
    }
}

pub fn serialize_structure_create_quantum_task_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateQuantumTaskInput,
) {
    if let Some(var_2) = &input.action {
        object.key("action").string(var_2);
    }
    if let Some(var_3) = &input.client_token {
        object.key("clientToken").string(var_3);
    }
    if let Some(var_4) = &input.device_arn {
        object.key("deviceArn").string(var_4);
    }
    if let Some(var_5) = &input.device_parameters {
        object.key("deviceParameters").string(var_5);
    }
    if let Some(var_6) = &input.output_s3_bucket {
        object.key("outputS3Bucket").string(var_6);
    }
    if let Some(var_7) = &input.output_s3_key_prefix {
        object.key("outputS3KeyPrefix").string(var_7);
    }
    if let Some(var_8) = &input.shots {
        object.key("shots").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_8).into()),
        );
    }
    if let Some(var_9) = &input.tags {
        let mut object_10 = object.key("tags").start_object();
        for (key_11, value_12) in var_9 {
            {
                object_10.key(key_11).string(value_12);
            }
        }
        object_10.finish();
    }
}

pub fn serialize_structure_search_devices_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchDevicesInput,
) {
    if let Some(var_13) = &input.filters {
        let mut array_14 = object.key("filters").start_array();
        for item_15 in var_13 {
            {
                let mut object_16 = array_14.value().start_object();
                crate::json_ser::serialize_structure_search_devices_filter(&mut object_16, item_15);
                object_16.finish();
            }
        }
        array_14.finish();
    }
    if let Some(var_17) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_17).into()),
        );
    }
    if let Some(var_18) = &input.next_token {
        object.key("nextToken").string(var_18);
    }
}

pub fn serialize_structure_search_quantum_tasks_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchQuantumTasksInput,
) {
    if let Some(var_19) = &input.filters {
        let mut array_20 = object.key("filters").start_array();
        for item_21 in var_19 {
            {
                let mut object_22 = array_20.value().start_object();
                crate::json_ser::serialize_structure_search_quantum_tasks_filter(
                    &mut object_22,
                    item_21,
                );
                object_22.finish();
            }
        }
        array_20.finish();
    }
    if let Some(var_23) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_23).into()),
        );
    }
    if let Some(var_24) = &input.next_token {
        object.key("nextToken").string(var_24);
    }
}

pub fn serialize_structure_tag_resource_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::TagResourceInput,
) {
    if let Some(var_25) = &input.tags {
        let mut object_26 = object.key("tags").start_object();
        for (key_27, value_28) in var_25 {
            {
                object_26.key(key_27).string(value_28);
            }
        }
        object_26.finish();
    }
}

pub fn serialize_structure_search_devices_filter(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SearchDevicesFilter,
) {
    if let Some(var_29) = &input.name {
        object.key("name").string(var_29);
    }
    if let Some(var_30) = &input.values {
        let mut array_31 = object.key("values").start_array();
        for item_32 in var_30 {
            {
                array_31.value().string(item_32);
            }
        }
        array_31.finish();
    }
}

pub fn serialize_structure_search_quantum_tasks_filter(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SearchQuantumTasksFilter,
) {
    if let Some(var_33) = &input.name {
        object.key("name").string(var_33);
    }
    if let Some(var_34) = &input.values {
        let mut array_35 = object.key("values").start_array();
        for item_36 in var_34 {
            {
                array_35.value().string(item_36);
            }
        }
        array_35.finish();
    }
    if let Some(var_37) = &input.operator {
        object.key("operator").string(var_37.as_str());
    }
}
