// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn ser_tool_choice(
    object_5: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::types::ToolChoice,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    match input {
        crate::types::ToolChoice::Auto(inner) => {
            #[allow(unused_mut)]
            let mut object_1 = object_5.key("auto").start_object();
            crate::protocol_serde::shape_auto_tool_choice::ser_auto_tool_choice(&mut object_1, inner)?;
            object_1.finish();
        }
        crate::types::ToolChoice::Any(inner) => {
            #[allow(unused_mut)]
            let mut object_2 = object_5.key("any").start_object();
            crate::protocol_serde::shape_any_tool_choice::ser_any_tool_choice(&mut object_2, inner)?;
            object_2.finish();
        }
        crate::types::ToolChoice::Tool(inner) => {
            #[allow(unused_mut)]
            let mut object_3 = object_5.key("tool").start_object();
            crate::protocol_serde::shape_specific_tool_choice::ser_specific_tool_choice(&mut object_3, inner)?;
            object_3.finish();
        }
        crate::types::ToolChoice::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("ToolChoice")),
    }
    Ok(())
}
