// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_accept_match_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AcceptMatchInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_1) = &input.ticket_id {
        object.key("TicketId").string(var_1);
    }
    if let Some(var_2) = &input.player_ids {
        let mut array_3 = object.key("PlayerIds").start_array();
        for item_4 in var_2 {
            {
                array_3.value().string(item_4);
            }
        }
        array_3.finish();
    }
    if let Some(var_5) = &input.acceptance_type {
        object.key("AcceptanceType").string(var_5.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_claim_game_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ClaimGameServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_6) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_6);
    }
    if let Some(var_7) = &input.game_server_id {
        object.key("GameServerId").string(var_7);
    }
    if let Some(var_8) = &input.game_server_data {
        object.key("GameServerData").string(var_8);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_alias_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateAliasInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_9) = &input.name {
        object.key("Name").string(var_9);
    }
    if let Some(var_10) = &input.description {
        object.key("Description").string(var_10);
    }
    if let Some(var_11) = &input.routing_strategy {
        let mut object_12 = object.key("RoutingStrategy").start_object();
        crate::json_ser::serialize_structure_crate_model_routing_strategy(&mut object_12, var_11)?;
        object_12.finish();
    }
    if let Some(var_13) = &input.tags {
        let mut array_14 = object.key("Tags").start_array();
        for item_15 in var_13 {
            {
                let mut object_16 = array_14.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_16, item_15)?;
                object_16.finish();
            }
        }
        array_14.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_build_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateBuildInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_17) = &input.name {
        object.key("Name").string(var_17);
    }
    if let Some(var_18) = &input.version {
        object.key("Version").string(var_18);
    }
    if let Some(var_19) = &input.storage_location {
        let mut object_20 = object.key("StorageLocation").start_object();
        crate::json_ser::serialize_structure_crate_model_s3_location(&mut object_20, var_19)?;
        object_20.finish();
    }
    if let Some(var_21) = &input.operating_system {
        object.key("OperatingSystem").string(var_21.as_str());
    }
    if let Some(var_22) = &input.tags {
        let mut array_23 = object.key("Tags").start_array();
        for item_24 in var_22 {
            {
                let mut object_25 = array_23.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_25, item_24)?;
                object_25.finish();
            }
        }
        array_23.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_fleet_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateFleetInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_26) = &input.name {
        object.key("Name").string(var_26);
    }
    if let Some(var_27) = &input.description {
        object.key("Description").string(var_27);
    }
    if let Some(var_28) = &input.build_id {
        object.key("BuildId").string(var_28);
    }
    if let Some(var_29) = &input.script_id {
        object.key("ScriptId").string(var_29);
    }
    if let Some(var_30) = &input.server_launch_path {
        object.key("ServerLaunchPath").string(var_30);
    }
    if let Some(var_31) = &input.server_launch_parameters {
        object.key("ServerLaunchParameters").string(var_31);
    }
    if let Some(var_32) = &input.log_paths {
        let mut array_33 = object.key("LogPaths").start_array();
        for item_34 in var_32 {
            {
                array_33.value().string(item_34);
            }
        }
        array_33.finish();
    }
    if let Some(var_35) = &input.ec2_instance_type {
        object.key("EC2InstanceType").string(var_35.as_str());
    }
    if let Some(var_36) = &input.ec2_inbound_permissions {
        let mut array_37 = object.key("EC2InboundPermissions").start_array();
        for item_38 in var_36 {
            {
                let mut object_39 = array_37.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ip_permission(
                    &mut object_39,
                    item_38,
                )?;
                object_39.finish();
            }
        }
        array_37.finish();
    }
    if let Some(var_40) = &input.new_game_session_protection_policy {
        object
            .key("NewGameSessionProtectionPolicy")
            .string(var_40.as_str());
    }
    if let Some(var_41) = &input.runtime_configuration {
        let mut object_42 = object.key("RuntimeConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_runtime_configuration(
            &mut object_42,
            var_41,
        )?;
        object_42.finish();
    }
    if let Some(var_43) = &input.resource_creation_limit_policy {
        let mut object_44 = object.key("ResourceCreationLimitPolicy").start_object();
        crate::json_ser::serialize_structure_crate_model_resource_creation_limit_policy(
            &mut object_44,
            var_43,
        )?;
        object_44.finish();
    }
    if let Some(var_45) = &input.metric_groups {
        let mut array_46 = object.key("MetricGroups").start_array();
        for item_47 in var_45 {
            {
                array_46.value().string(item_47);
            }
        }
        array_46.finish();
    }
    if let Some(var_48) = &input.peer_vpc_aws_account_id {
        object.key("PeerVpcAwsAccountId").string(var_48);
    }
    if let Some(var_49) = &input.peer_vpc_id {
        object.key("PeerVpcId").string(var_49);
    }
    if let Some(var_50) = &input.fleet_type {
        object.key("FleetType").string(var_50.as_str());
    }
    if let Some(var_51) = &input.instance_role_arn {
        object.key("InstanceRoleArn").string(var_51);
    }
    if let Some(var_52) = &input.certificate_configuration {
        let mut object_53 = object.key("CertificateConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_certificate_configuration(
            &mut object_53,
            var_52,
        )?;
        object_53.finish();
    }
    if let Some(var_54) = &input.locations {
        let mut array_55 = object.key("Locations").start_array();
        for item_56 in var_54 {
            {
                let mut object_57 = array_55.value().start_object();
                crate::json_ser::serialize_structure_crate_model_location_configuration(
                    &mut object_57,
                    item_56,
                )?;
                object_57.finish();
            }
        }
        array_55.finish();
    }
    if let Some(var_58) = &input.tags {
        let mut array_59 = object.key("Tags").start_array();
        for item_60 in var_58 {
            {
                let mut object_61 = array_59.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_61, item_60)?;
                object_61.finish();
            }
        }
        array_59.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_fleet_locations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateFleetLocationsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_62) = &input.fleet_id {
        object.key("FleetId").string(var_62);
    }
    if let Some(var_63) = &input.locations {
        let mut array_64 = object.key("Locations").start_array();
        for item_65 in var_63 {
            {
                let mut object_66 = array_64.value().start_object();
                crate::json_ser::serialize_structure_crate_model_location_configuration(
                    &mut object_66,
                    item_65,
                )?;
                object_66.finish();
            }
        }
        array_64.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_game_server_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGameServerGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_67) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_67);
    }
    if let Some(var_68) = &input.role_arn {
        object.key("RoleArn").string(var_68);
    }
    if let Some(var_69) = &input.min_size {
        object.key("MinSize").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_69).into()),
        );
    }
    if let Some(var_70) = &input.max_size {
        object.key("MaxSize").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_70).into()),
        );
    }
    if let Some(var_71) = &input.launch_template {
        let mut object_72 = object.key("LaunchTemplate").start_object();
        crate::json_ser::serialize_structure_crate_model_launch_template_specification(
            &mut object_72,
            var_71,
        )?;
        object_72.finish();
    }
    if let Some(var_73) = &input.instance_definitions {
        let mut array_74 = object.key("InstanceDefinitions").start_array();
        for item_75 in var_73 {
            {
                let mut object_76 = array_74.value().start_object();
                crate::json_ser::serialize_structure_crate_model_instance_definition(
                    &mut object_76,
                    item_75,
                )?;
                object_76.finish();
            }
        }
        array_74.finish();
    }
    if let Some(var_77) = &input.auto_scaling_policy {
        let mut object_78 = object.key("AutoScalingPolicy").start_object();
        crate::json_ser::serialize_structure_crate_model_game_server_group_auto_scaling_policy(
            &mut object_78,
            var_77,
        )?;
        object_78.finish();
    }
    if let Some(var_79) = &input.balancing_strategy {
        object.key("BalancingStrategy").string(var_79.as_str());
    }
    if let Some(var_80) = &input.game_server_protection_policy {
        object
            .key("GameServerProtectionPolicy")
            .string(var_80.as_str());
    }
    if let Some(var_81) = &input.vpc_subnets {
        let mut array_82 = object.key("VpcSubnets").start_array();
        for item_83 in var_81 {
            {
                array_82.value().string(item_83);
            }
        }
        array_82.finish();
    }
    if let Some(var_84) = &input.tags {
        let mut array_85 = object.key("Tags").start_array();
        for item_86 in var_84 {
            {
                let mut object_87 = array_85.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_87, item_86)?;
                object_87.finish();
            }
        }
        array_85.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_game_session_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGameSessionInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_88) = &input.fleet_id {
        object.key("FleetId").string(var_88);
    }
    if let Some(var_89) = &input.alias_id {
        object.key("AliasId").string(var_89);
    }
    if let Some(var_90) = &input.maximum_player_session_count {
        object.key("MaximumPlayerSessionCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_90).into()),
        );
    }
    if let Some(var_91) = &input.name {
        object.key("Name").string(var_91);
    }
    if let Some(var_92) = &input.game_properties {
        let mut array_93 = object.key("GameProperties").start_array();
        for item_94 in var_92 {
            {
                let mut object_95 = array_93.value().start_object();
                crate::json_ser::serialize_structure_crate_model_game_property(
                    &mut object_95,
                    item_94,
                )?;
                object_95.finish();
            }
        }
        array_93.finish();
    }
    if let Some(var_96) = &input.creator_id {
        object.key("CreatorId").string(var_96);
    }
    if let Some(var_97) = &input.game_session_id {
        object.key("GameSessionId").string(var_97);
    }
    if let Some(var_98) = &input.idempotency_token {
        object.key("IdempotencyToken").string(var_98);
    }
    if let Some(var_99) = &input.game_session_data {
        object.key("GameSessionData").string(var_99);
    }
    if let Some(var_100) = &input.location {
        object.key("Location").string(var_100);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_game_session_queue_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGameSessionQueueInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_101) = &input.name {
        object.key("Name").string(var_101);
    }
    if let Some(var_102) = &input.timeout_in_seconds {
        object.key("TimeoutInSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_102).into()),
        );
    }
    if let Some(var_103) = &input.player_latency_policies {
        let mut array_104 = object.key("PlayerLatencyPolicies").start_array();
        for item_105 in var_103 {
            {
                let mut object_106 = array_104.value().start_object();
                crate::json_ser::serialize_structure_crate_model_player_latency_policy(
                    &mut object_106,
                    item_105,
                )?;
                object_106.finish();
            }
        }
        array_104.finish();
    }
    if let Some(var_107) = &input.destinations {
        let mut array_108 = object.key("Destinations").start_array();
        for item_109 in var_107 {
            {
                let mut object_110 = array_108.value().start_object();
                crate::json_ser::serialize_structure_crate_model_game_session_queue_destination(
                    &mut object_110,
                    item_109,
                )?;
                object_110.finish();
            }
        }
        array_108.finish();
    }
    if let Some(var_111) = &input.filter_configuration {
        let mut object_112 = object.key("FilterConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_filter_configuration(
            &mut object_112,
            var_111,
        )?;
        object_112.finish();
    }
    if let Some(var_113) = &input.priority_configuration {
        let mut object_114 = object.key("PriorityConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_priority_configuration(
            &mut object_114,
            var_113,
        )?;
        object_114.finish();
    }
    if let Some(var_115) = &input.custom_event_data {
        object.key("CustomEventData").string(var_115);
    }
    if let Some(var_116) = &input.notification_target {
        object.key("NotificationTarget").string(var_116);
    }
    if let Some(var_117) = &input.tags {
        let mut array_118 = object.key("Tags").start_array();
        for item_119 in var_117 {
            {
                let mut object_120 = array_118.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_120, item_119)?;
                object_120.finish();
            }
        }
        array_118.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_matchmaking_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateMatchmakingConfigurationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_121) = &input.name {
        object.key("Name").string(var_121);
    }
    if let Some(var_122) = &input.description {
        object.key("Description").string(var_122);
    }
    if let Some(var_123) = &input.game_session_queue_arns {
        let mut array_124 = object.key("GameSessionQueueArns").start_array();
        for item_125 in var_123 {
            {
                array_124.value().string(item_125);
            }
        }
        array_124.finish();
    }
    if let Some(var_126) = &input.request_timeout_seconds {
        object.key("RequestTimeoutSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_126).into()),
        );
    }
    if let Some(var_127) = &input.acceptance_timeout_seconds {
        object.key("AcceptanceTimeoutSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_127).into()),
        );
    }
    if let Some(var_128) = &input.acceptance_required {
        object.key("AcceptanceRequired").boolean(*var_128);
    }
    if let Some(var_129) = &input.rule_set_name {
        object.key("RuleSetName").string(var_129);
    }
    if let Some(var_130) = &input.notification_target {
        object.key("NotificationTarget").string(var_130);
    }
    if let Some(var_131) = &input.additional_player_count {
        object.key("AdditionalPlayerCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_131).into()),
        );
    }
    if let Some(var_132) = &input.custom_event_data {
        object.key("CustomEventData").string(var_132);
    }
    if let Some(var_133) = &input.game_properties {
        let mut array_134 = object.key("GameProperties").start_array();
        for item_135 in var_133 {
            {
                let mut object_136 = array_134.value().start_object();
                crate::json_ser::serialize_structure_crate_model_game_property(
                    &mut object_136,
                    item_135,
                )?;
                object_136.finish();
            }
        }
        array_134.finish();
    }
    if let Some(var_137) = &input.game_session_data {
        object.key("GameSessionData").string(var_137);
    }
    if let Some(var_138) = &input.backfill_mode {
        object.key("BackfillMode").string(var_138.as_str());
    }
    if let Some(var_139) = &input.flex_match_mode {
        object.key("FlexMatchMode").string(var_139.as_str());
    }
    if let Some(var_140) = &input.tags {
        let mut array_141 = object.key("Tags").start_array();
        for item_142 in var_140 {
            {
                let mut object_143 = array_141.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_143, item_142)?;
                object_143.finish();
            }
        }
        array_141.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_matchmaking_rule_set_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateMatchmakingRuleSetInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_144) = &input.name {
        object.key("Name").string(var_144);
    }
    if let Some(var_145) = &input.rule_set_body {
        object.key("RuleSetBody").string(var_145);
    }
    if let Some(var_146) = &input.tags {
        let mut array_147 = object.key("Tags").start_array();
        for item_148 in var_146 {
            {
                let mut object_149 = array_147.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_149, item_148)?;
                object_149.finish();
            }
        }
        array_147.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_player_session_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreatePlayerSessionInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_150) = &input.game_session_id {
        object.key("GameSessionId").string(var_150);
    }
    if let Some(var_151) = &input.player_id {
        object.key("PlayerId").string(var_151);
    }
    if let Some(var_152) = &input.player_data {
        object.key("PlayerData").string(var_152);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_player_sessions_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreatePlayerSessionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_153) = &input.game_session_id {
        object.key("GameSessionId").string(var_153);
    }
    if let Some(var_154) = &input.player_ids {
        let mut array_155 = object.key("PlayerIds").start_array();
        for item_156 in var_154 {
            {
                array_155.value().string(item_156);
            }
        }
        array_155.finish();
    }
    if let Some(var_157) = &input.player_data_map {
        let mut object_158 = object.key("PlayerDataMap").start_object();
        for (key_159, value_160) in var_157 {
            {
                object_158.key(key_159).string(value_160);
            }
        }
        object_158.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_script_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateScriptInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_161) = &input.name {
        object.key("Name").string(var_161);
    }
    if let Some(var_162) = &input.version {
        object.key("Version").string(var_162);
    }
    if let Some(var_163) = &input.storage_location {
        let mut object_164 = object.key("StorageLocation").start_object();
        crate::json_ser::serialize_structure_crate_model_s3_location(&mut object_164, var_163)?;
        object_164.finish();
    }
    if let Some(var_165) = &input.zip_file {
        object
            .key("ZipFile")
            .string_unchecked(&aws_smithy_types::base64::encode(var_165));
    }
    if let Some(var_166) = &input.tags {
        let mut array_167 = object.key("Tags").start_array();
        for item_168 in var_166 {
            {
                let mut object_169 = array_167.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_169, item_168)?;
                object_169.finish();
            }
        }
        array_167.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_vpc_peering_authorization_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateVpcPeeringAuthorizationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_170) = &input.game_lift_aws_account_id {
        object.key("GameLiftAwsAccountId").string(var_170);
    }
    if let Some(var_171) = &input.peer_vpc_id {
        object.key("PeerVpcId").string(var_171);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_vpc_peering_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateVpcPeeringConnectionInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_172) = &input.fleet_id {
        object.key("FleetId").string(var_172);
    }
    if let Some(var_173) = &input.peer_vpc_aws_account_id {
        object.key("PeerVpcAwsAccountId").string(var_173);
    }
    if let Some(var_174) = &input.peer_vpc_id {
        object.key("PeerVpcId").string(var_174);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_alias_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteAliasInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_175) = &input.alias_id {
        object.key("AliasId").string(var_175);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_build_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteBuildInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_176) = &input.build_id {
        object.key("BuildId").string(var_176);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_fleet_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteFleetInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_177) = &input.fleet_id {
        object.key("FleetId").string(var_177);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_fleet_locations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteFleetLocationsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_178) = &input.fleet_id {
        object.key("FleetId").string(var_178);
    }
    if let Some(var_179) = &input.locations {
        let mut array_180 = object.key("Locations").start_array();
        for item_181 in var_179 {
            {
                array_180.value().string(item_181);
            }
        }
        array_180.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_game_server_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteGameServerGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_182) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_182);
    }
    if let Some(var_183) = &input.delete_option {
        object.key("DeleteOption").string(var_183.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_game_session_queue_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteGameSessionQueueInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_184) = &input.name {
        object.key("Name").string(var_184);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_matchmaking_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteMatchmakingConfigurationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_185) = &input.name {
        object.key("Name").string(var_185);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_matchmaking_rule_set_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteMatchmakingRuleSetInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_186) = &input.name {
        object.key("Name").string(var_186);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_scaling_policy_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteScalingPolicyInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_187) = &input.name {
        object.key("Name").string(var_187);
    }
    if let Some(var_188) = &input.fleet_id {
        object.key("FleetId").string(var_188);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_script_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteScriptInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_189) = &input.script_id {
        object.key("ScriptId").string(var_189);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_vpc_peering_authorization_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteVpcPeeringAuthorizationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_190) = &input.game_lift_aws_account_id {
        object.key("GameLiftAwsAccountId").string(var_190);
    }
    if let Some(var_191) = &input.peer_vpc_id {
        object.key("PeerVpcId").string(var_191);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_vpc_peering_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteVpcPeeringConnectionInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_192) = &input.fleet_id {
        object.key("FleetId").string(var_192);
    }
    if let Some(var_193) = &input.vpc_peering_connection_id {
        object.key("VpcPeeringConnectionId").string(var_193);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_deregister_game_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeregisterGameServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_194) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_194);
    }
    if let Some(var_195) = &input.game_server_id {
        object.key("GameServerId").string(var_195);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_alias_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeAliasInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_196) = &input.alias_id {
        object.key("AliasId").string(var_196);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_build_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeBuildInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_197) = &input.build_id {
        object.key("BuildId").string(var_197);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_ec2_instance_limits_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeEc2InstanceLimitsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_198) = &input.ec2_instance_type {
        object.key("EC2InstanceType").string(var_198.as_str());
    }
    if let Some(var_199) = &input.location {
        object.key("Location").string(var_199);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_200) = &input.fleet_ids {
        let mut array_201 = object.key("FleetIds").start_array();
        for item_202 in var_200 {
            {
                array_201.value().string(item_202);
            }
        }
        array_201.finish();
    }
    if let Some(var_203) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_203).into()),
        );
    }
    if let Some(var_204) = &input.next_token {
        object.key("NextToken").string(var_204);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_capacity_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetCapacityInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_205) = &input.fleet_ids {
        let mut array_206 = object.key("FleetIds").start_array();
        for item_207 in var_205 {
            {
                array_206.value().string(item_207);
            }
        }
        array_206.finish();
    }
    if let Some(var_208) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_208).into()),
        );
    }
    if let Some(var_209) = &input.next_token {
        object.key("NextToken").string(var_209);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_events_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetEventsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_210) = &input.fleet_id {
        object.key("FleetId").string(var_210);
    }
    if let Some(var_211) = &input.start_time {
        object
            .key("StartTime")
            .date_time(var_211, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_212) = &input.end_time {
        object
            .key("EndTime")
            .date_time(var_212, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_213) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_213).into()),
        );
    }
    if let Some(var_214) = &input.next_token {
        object.key("NextToken").string(var_214);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_location_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetLocationAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_215) = &input.fleet_id {
        object.key("FleetId").string(var_215);
    }
    if let Some(var_216) = &input.locations {
        let mut array_217 = object.key("Locations").start_array();
        for item_218 in var_216 {
            {
                array_217.value().string(item_218);
            }
        }
        array_217.finish();
    }
    if let Some(var_219) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_219).into()),
        );
    }
    if let Some(var_220) = &input.next_token {
        object.key("NextToken").string(var_220);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_location_capacity_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetLocationCapacityInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_221) = &input.fleet_id {
        object.key("FleetId").string(var_221);
    }
    if let Some(var_222) = &input.location {
        object.key("Location").string(var_222);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_location_utilization_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetLocationUtilizationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_223) = &input.fleet_id {
        object.key("FleetId").string(var_223);
    }
    if let Some(var_224) = &input.location {
        object.key("Location").string(var_224);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_port_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetPortSettingsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_225) = &input.fleet_id {
        object.key("FleetId").string(var_225);
    }
    if let Some(var_226) = &input.location {
        object.key("Location").string(var_226);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_fleet_utilization_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeFleetUtilizationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_227) = &input.fleet_ids {
        let mut array_228 = object.key("FleetIds").start_array();
        for item_229 in var_227 {
            {
                array_228.value().string(item_229);
            }
        }
        array_228.finish();
    }
    if let Some(var_230) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_230).into()),
        );
    }
    if let Some(var_231) = &input.next_token {
        object.key("NextToken").string(var_231);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_game_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGameServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_232) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_232);
    }
    if let Some(var_233) = &input.game_server_id {
        object.key("GameServerId").string(var_233);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_game_server_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGameServerGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_234) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_234);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_game_server_instances_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGameServerInstancesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_235) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_235);
    }
    if let Some(var_236) = &input.instance_ids {
        let mut array_237 = object.key("InstanceIds").start_array();
        for item_238 in var_236 {
            {
                array_237.value().string(item_238);
            }
        }
        array_237.finish();
    }
    if let Some(var_239) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_239).into()),
        );
    }
    if let Some(var_240) = &input.next_token {
        object.key("NextToken").string(var_240);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_game_session_details_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGameSessionDetailsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_241) = &input.fleet_id {
        object.key("FleetId").string(var_241);
    }
    if let Some(var_242) = &input.game_session_id {
        object.key("GameSessionId").string(var_242);
    }
    if let Some(var_243) = &input.alias_id {
        object.key("AliasId").string(var_243);
    }
    if let Some(var_244) = &input.location {
        object.key("Location").string(var_244);
    }
    if let Some(var_245) = &input.status_filter {
        object.key("StatusFilter").string(var_245);
    }
    if let Some(var_246) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_246).into()),
        );
    }
    if let Some(var_247) = &input.next_token {
        object.key("NextToken").string(var_247);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_game_session_placement_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGameSessionPlacementInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_248) = &input.placement_id {
        object.key("PlacementId").string(var_248);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_game_session_queues_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGameSessionQueuesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_249) = &input.names {
        let mut array_250 = object.key("Names").start_array();
        for item_251 in var_249 {
            {
                array_250.value().string(item_251);
            }
        }
        array_250.finish();
    }
    if let Some(var_252) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_252).into()),
        );
    }
    if let Some(var_253) = &input.next_token {
        object.key("NextToken").string(var_253);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_game_sessions_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGameSessionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_254) = &input.fleet_id {
        object.key("FleetId").string(var_254);
    }
    if let Some(var_255) = &input.game_session_id {
        object.key("GameSessionId").string(var_255);
    }
    if let Some(var_256) = &input.alias_id {
        object.key("AliasId").string(var_256);
    }
    if let Some(var_257) = &input.location {
        object.key("Location").string(var_257);
    }
    if let Some(var_258) = &input.status_filter {
        object.key("StatusFilter").string(var_258);
    }
    if let Some(var_259) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_259).into()),
        );
    }
    if let Some(var_260) = &input.next_token {
        object.key("NextToken").string(var_260);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_instances_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeInstancesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_261) = &input.fleet_id {
        object.key("FleetId").string(var_261);
    }
    if let Some(var_262) = &input.instance_id {
        object.key("InstanceId").string(var_262);
    }
    if let Some(var_263) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_263).into()),
        );
    }
    if let Some(var_264) = &input.next_token {
        object.key("NextToken").string(var_264);
    }
    if let Some(var_265) = &input.location {
        object.key("Location").string(var_265);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_matchmaking_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeMatchmakingInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_266) = &input.ticket_ids {
        let mut array_267 = object.key("TicketIds").start_array();
        for item_268 in var_266 {
            {
                array_267.value().string(item_268);
            }
        }
        array_267.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_matchmaking_configurations_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeMatchmakingConfigurationsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_269) = &input.names {
        let mut array_270 = object.key("Names").start_array();
        for item_271 in var_269 {
            {
                array_270.value().string(item_271);
            }
        }
        array_270.finish();
    }
    if let Some(var_272) = &input.rule_set_name {
        object.key("RuleSetName").string(var_272);
    }
    if let Some(var_273) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_273).into()),
        );
    }
    if let Some(var_274) = &input.next_token {
        object.key("NextToken").string(var_274);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_matchmaking_rule_sets_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeMatchmakingRuleSetsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_275) = &input.names {
        let mut array_276 = object.key("Names").start_array();
        for item_277 in var_275 {
            {
                array_276.value().string(item_277);
            }
        }
        array_276.finish();
    }
    if let Some(var_278) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_278).into()),
        );
    }
    if let Some(var_279) = &input.next_token {
        object.key("NextToken").string(var_279);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_player_sessions_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribePlayerSessionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_280) = &input.game_session_id {
        object.key("GameSessionId").string(var_280);
    }
    if let Some(var_281) = &input.player_id {
        object.key("PlayerId").string(var_281);
    }
    if let Some(var_282) = &input.player_session_id {
        object.key("PlayerSessionId").string(var_282);
    }
    if let Some(var_283) = &input.player_session_status_filter {
        object.key("PlayerSessionStatusFilter").string(var_283);
    }
    if let Some(var_284) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_284).into()),
        );
    }
    if let Some(var_285) = &input.next_token {
        object.key("NextToken").string(var_285);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_runtime_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeRuntimeConfigurationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_286) = &input.fleet_id {
        object.key("FleetId").string(var_286);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_scaling_policies_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeScalingPoliciesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_287) = &input.fleet_id {
        object.key("FleetId").string(var_287);
    }
    if let Some(var_288) = &input.status_filter {
        object.key("StatusFilter").string(var_288.as_str());
    }
    if let Some(var_289) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_289).into()),
        );
    }
    if let Some(var_290) = &input.next_token {
        object.key("NextToken").string(var_290);
    }
    if let Some(var_291) = &input.location {
        object.key("Location").string(var_291);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_script_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeScriptInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_292) = &input.script_id {
        object.key("ScriptId").string(var_292);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_vpc_peering_connections_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeVpcPeeringConnectionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_293) = &input.fleet_id {
        object.key("FleetId").string(var_293);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_game_session_log_url_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetGameSessionLogUrlInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_294) = &input.game_session_id {
        object.key("GameSessionId").string(var_294);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_instance_access_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetInstanceAccessInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_295) = &input.fleet_id {
        object.key("FleetId").string(var_295);
    }
    if let Some(var_296) = &input.instance_id {
        object.key("InstanceId").string(var_296);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_aliases_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListAliasesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_297) = &input.routing_strategy_type {
        object.key("RoutingStrategyType").string(var_297.as_str());
    }
    if let Some(var_298) = &input.name {
        object.key("Name").string(var_298);
    }
    if let Some(var_299) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_299).into()),
        );
    }
    if let Some(var_300) = &input.next_token {
        object.key("NextToken").string(var_300);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_builds_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListBuildsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_301) = &input.status {
        object.key("Status").string(var_301.as_str());
    }
    if let Some(var_302) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_302).into()),
        );
    }
    if let Some(var_303) = &input.next_token {
        object.key("NextToken").string(var_303);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_fleets_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListFleetsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_304) = &input.build_id {
        object.key("BuildId").string(var_304);
    }
    if let Some(var_305) = &input.script_id {
        object.key("ScriptId").string(var_305);
    }
    if let Some(var_306) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_306).into()),
        );
    }
    if let Some(var_307) = &input.next_token {
        object.key("NextToken").string(var_307);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_game_server_groups_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListGameServerGroupsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_308) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_308).into()),
        );
    }
    if let Some(var_309) = &input.next_token {
        object.key("NextToken").string(var_309);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_game_servers_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListGameServersInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_310) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_310);
    }
    if let Some(var_311) = &input.sort_order {
        object.key("SortOrder").string(var_311.as_str());
    }
    if let Some(var_312) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_312).into()),
        );
    }
    if let Some(var_313) = &input.next_token {
        object.key("NextToken").string(var_313);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_scripts_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListScriptsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_314) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_314).into()),
        );
    }
    if let Some(var_315) = &input.next_token {
        object.key("NextToken").string(var_315);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_tags_for_resource_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListTagsForResourceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_316) = &input.resource_arn {
        object.key("ResourceARN").string(var_316);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_put_scaling_policy_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::PutScalingPolicyInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_317) = &input.name {
        object.key("Name").string(var_317);
    }
    if let Some(var_318) = &input.fleet_id {
        object.key("FleetId").string(var_318);
    }
    if input.scaling_adjustment != 0 {
        object.key("ScalingAdjustment").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.scaling_adjustment).into()),
        );
    }
    if let Some(var_319) = &input.scaling_adjustment_type {
        object.key("ScalingAdjustmentType").string(var_319.as_str());
    }
    if input.threshold != 0.0 {
        object.key("Threshold").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((input.threshold).into()),
        );
    }
    if let Some(var_320) = &input.comparison_operator {
        object.key("ComparisonOperator").string(var_320.as_str());
    }
    if let Some(var_321) = &input.evaluation_periods {
        object.key("EvaluationPeriods").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_321).into()),
        );
    }
    if let Some(var_322) = &input.metric_name {
        object.key("MetricName").string(var_322.as_str());
    }
    if let Some(var_323) = &input.policy_type {
        object.key("PolicyType").string(var_323.as_str());
    }
    if let Some(var_324) = &input.target_configuration {
        let mut object_325 = object.key("TargetConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_target_configuration(
            &mut object_325,
            var_324,
        )?;
        object_325.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_register_game_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RegisterGameServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_326) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_326);
    }
    if let Some(var_327) = &input.game_server_id {
        object.key("GameServerId").string(var_327);
    }
    if let Some(var_328) = &input.instance_id {
        object.key("InstanceId").string(var_328);
    }
    if let Some(var_329) = &input.connection_info {
        object.key("ConnectionInfo").string(var_329);
    }
    if let Some(var_330) = &input.game_server_data {
        object.key("GameServerData").string(var_330);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_request_upload_credentials_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RequestUploadCredentialsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_331) = &input.build_id {
        object.key("BuildId").string(var_331);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_resolve_alias_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ResolveAliasInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_332) = &input.alias_id {
        object.key("AliasId").string(var_332);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_resume_game_server_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ResumeGameServerGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_333) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_333);
    }
    if let Some(var_334) = &input.resume_actions {
        let mut array_335 = object.key("ResumeActions").start_array();
        for item_336 in var_334 {
            {
                array_335.value().string(item_336.as_str());
            }
        }
        array_335.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_search_game_sessions_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SearchGameSessionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_337) = &input.fleet_id {
        object.key("FleetId").string(var_337);
    }
    if let Some(var_338) = &input.alias_id {
        object.key("AliasId").string(var_338);
    }
    if let Some(var_339) = &input.location {
        object.key("Location").string(var_339);
    }
    if let Some(var_340) = &input.filter_expression {
        object.key("FilterExpression").string(var_340);
    }
    if let Some(var_341) = &input.sort_expression {
        object.key("SortExpression").string(var_341);
    }
    if let Some(var_342) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_342).into()),
        );
    }
    if let Some(var_343) = &input.next_token {
        object.key("NextToken").string(var_343);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_fleet_actions_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartFleetActionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_344) = &input.fleet_id {
        object.key("FleetId").string(var_344);
    }
    if let Some(var_345) = &input.actions {
        let mut array_346 = object.key("Actions").start_array();
        for item_347 in var_345 {
            {
                array_346.value().string(item_347.as_str());
            }
        }
        array_346.finish();
    }
    if let Some(var_348) = &input.location {
        object.key("Location").string(var_348);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_game_session_placement_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartGameSessionPlacementInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_349) = &input.placement_id {
        object.key("PlacementId").string(var_349);
    }
    if let Some(var_350) = &input.game_session_queue_name {
        object.key("GameSessionQueueName").string(var_350);
    }
    if let Some(var_351) = &input.game_properties {
        let mut array_352 = object.key("GameProperties").start_array();
        for item_353 in var_351 {
            {
                let mut object_354 = array_352.value().start_object();
                crate::json_ser::serialize_structure_crate_model_game_property(
                    &mut object_354,
                    item_353,
                )?;
                object_354.finish();
            }
        }
        array_352.finish();
    }
    if let Some(var_355) = &input.maximum_player_session_count {
        object.key("MaximumPlayerSessionCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_355).into()),
        );
    }
    if let Some(var_356) = &input.game_session_name {
        object.key("GameSessionName").string(var_356);
    }
    if let Some(var_357) = &input.player_latencies {
        let mut array_358 = object.key("PlayerLatencies").start_array();
        for item_359 in var_357 {
            {
                let mut object_360 = array_358.value().start_object();
                crate::json_ser::serialize_structure_crate_model_player_latency(
                    &mut object_360,
                    item_359,
                )?;
                object_360.finish();
            }
        }
        array_358.finish();
    }
    if let Some(var_361) = &input.desired_player_sessions {
        let mut array_362 = object.key("DesiredPlayerSessions").start_array();
        for item_363 in var_361 {
            {
                let mut object_364 = array_362.value().start_object();
                crate::json_ser::serialize_structure_crate_model_desired_player_session(
                    &mut object_364,
                    item_363,
                )?;
                object_364.finish();
            }
        }
        array_362.finish();
    }
    if let Some(var_365) = &input.game_session_data {
        object.key("GameSessionData").string(var_365);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_match_backfill_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartMatchBackfillInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_366) = &input.ticket_id {
        object.key("TicketId").string(var_366);
    }
    if let Some(var_367) = &input.configuration_name {
        object.key("ConfigurationName").string(var_367);
    }
    if let Some(var_368) = &input.game_session_arn {
        object.key("GameSessionArn").string(var_368);
    }
    if let Some(var_369) = &input.players {
        let mut array_370 = object.key("Players").start_array();
        for item_371 in var_369 {
            {
                let mut object_372 = array_370.value().start_object();
                crate::json_ser::serialize_structure_crate_model_player(&mut object_372, item_371)?;
                object_372.finish();
            }
        }
        array_370.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_matchmaking_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartMatchmakingInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_373) = &input.ticket_id {
        object.key("TicketId").string(var_373);
    }
    if let Some(var_374) = &input.configuration_name {
        object.key("ConfigurationName").string(var_374);
    }
    if let Some(var_375) = &input.players {
        let mut array_376 = object.key("Players").start_array();
        for item_377 in var_375 {
            {
                let mut object_378 = array_376.value().start_object();
                crate::json_ser::serialize_structure_crate_model_player(&mut object_378, item_377)?;
                object_378.finish();
            }
        }
        array_376.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_fleet_actions_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopFleetActionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_379) = &input.fleet_id {
        object.key("FleetId").string(var_379);
    }
    if let Some(var_380) = &input.actions {
        let mut array_381 = object.key("Actions").start_array();
        for item_382 in var_380 {
            {
                array_381.value().string(item_382.as_str());
            }
        }
        array_381.finish();
    }
    if let Some(var_383) = &input.location {
        object.key("Location").string(var_383);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_game_session_placement_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopGameSessionPlacementInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_384) = &input.placement_id {
        object.key("PlacementId").string(var_384);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_matchmaking_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopMatchmakingInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_385) = &input.ticket_id {
        object.key("TicketId").string(var_385);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_suspend_game_server_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SuspendGameServerGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_386) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_386);
    }
    if let Some(var_387) = &input.suspend_actions {
        let mut array_388 = object.key("SuspendActions").start_array();
        for item_389 in var_387 {
            {
                array_388.value().string(item_389.as_str());
            }
        }
        array_388.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_tag_resource_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::TagResourceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_390) = &input.resource_arn {
        object.key("ResourceARN").string(var_390);
    }
    if let Some(var_391) = &input.tags {
        let mut array_392 = object.key("Tags").start_array();
        for item_393 in var_391 {
            {
                let mut object_394 = array_392.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_394, item_393)?;
                object_394.finish();
            }
        }
        array_392.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_untag_resource_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UntagResourceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_395) = &input.resource_arn {
        object.key("ResourceARN").string(var_395);
    }
    if let Some(var_396) = &input.tag_keys {
        let mut array_397 = object.key("TagKeys").start_array();
        for item_398 in var_396 {
            {
                array_397.value().string(item_398);
            }
        }
        array_397.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_alias_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateAliasInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_399) = &input.alias_id {
        object.key("AliasId").string(var_399);
    }
    if let Some(var_400) = &input.name {
        object.key("Name").string(var_400);
    }
    if let Some(var_401) = &input.description {
        object.key("Description").string(var_401);
    }
    if let Some(var_402) = &input.routing_strategy {
        let mut object_403 = object.key("RoutingStrategy").start_object();
        crate::json_ser::serialize_structure_crate_model_routing_strategy(
            &mut object_403,
            var_402,
        )?;
        object_403.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_build_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateBuildInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_404) = &input.build_id {
        object.key("BuildId").string(var_404);
    }
    if let Some(var_405) = &input.name {
        object.key("Name").string(var_405);
    }
    if let Some(var_406) = &input.version {
        object.key("Version").string(var_406);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_fleet_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFleetAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_407) = &input.fleet_id {
        object.key("FleetId").string(var_407);
    }
    if let Some(var_408) = &input.name {
        object.key("Name").string(var_408);
    }
    if let Some(var_409) = &input.description {
        object.key("Description").string(var_409);
    }
    if let Some(var_410) = &input.new_game_session_protection_policy {
        object
            .key("NewGameSessionProtectionPolicy")
            .string(var_410.as_str());
    }
    if let Some(var_411) = &input.resource_creation_limit_policy {
        let mut object_412 = object.key("ResourceCreationLimitPolicy").start_object();
        crate::json_ser::serialize_structure_crate_model_resource_creation_limit_policy(
            &mut object_412,
            var_411,
        )?;
        object_412.finish();
    }
    if let Some(var_413) = &input.metric_groups {
        let mut array_414 = object.key("MetricGroups").start_array();
        for item_415 in var_413 {
            {
                array_414.value().string(item_415);
            }
        }
        array_414.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_fleet_capacity_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFleetCapacityInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_416) = &input.fleet_id {
        object.key("FleetId").string(var_416);
    }
    if let Some(var_417) = &input.desired_instances {
        object.key("DesiredInstances").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_417).into()),
        );
    }
    if let Some(var_418) = &input.min_size {
        object.key("MinSize").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_418).into()),
        );
    }
    if let Some(var_419) = &input.max_size {
        object.key("MaxSize").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_419).into()),
        );
    }
    if let Some(var_420) = &input.location {
        object.key("Location").string(var_420);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_fleet_port_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFleetPortSettingsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_421) = &input.fleet_id {
        object.key("FleetId").string(var_421);
    }
    if let Some(var_422) = &input.inbound_permission_authorizations {
        let mut array_423 = object.key("InboundPermissionAuthorizations").start_array();
        for item_424 in var_422 {
            {
                let mut object_425 = array_423.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ip_permission(
                    &mut object_425,
                    item_424,
                )?;
                object_425.finish();
            }
        }
        array_423.finish();
    }
    if let Some(var_426) = &input.inbound_permission_revocations {
        let mut array_427 = object.key("InboundPermissionRevocations").start_array();
        for item_428 in var_426 {
            {
                let mut object_429 = array_427.value().start_object();
                crate::json_ser::serialize_structure_crate_model_ip_permission(
                    &mut object_429,
                    item_428,
                )?;
                object_429.finish();
            }
        }
        array_427.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_game_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGameServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_430) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_430);
    }
    if let Some(var_431) = &input.game_server_id {
        object.key("GameServerId").string(var_431);
    }
    if let Some(var_432) = &input.game_server_data {
        object.key("GameServerData").string(var_432);
    }
    if let Some(var_433) = &input.utilization_status {
        object.key("UtilizationStatus").string(var_433.as_str());
    }
    if let Some(var_434) = &input.health_check {
        object.key("HealthCheck").string(var_434.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_game_server_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGameServerGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_435) = &input.game_server_group_name {
        object.key("GameServerGroupName").string(var_435);
    }
    if let Some(var_436) = &input.role_arn {
        object.key("RoleArn").string(var_436);
    }
    if let Some(var_437) = &input.instance_definitions {
        let mut array_438 = object.key("InstanceDefinitions").start_array();
        for item_439 in var_437 {
            {
                let mut object_440 = array_438.value().start_object();
                crate::json_ser::serialize_structure_crate_model_instance_definition(
                    &mut object_440,
                    item_439,
                )?;
                object_440.finish();
            }
        }
        array_438.finish();
    }
    if let Some(var_441) = &input.game_server_protection_policy {
        object
            .key("GameServerProtectionPolicy")
            .string(var_441.as_str());
    }
    if let Some(var_442) = &input.balancing_strategy {
        object.key("BalancingStrategy").string(var_442.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_game_session_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGameSessionInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_443) = &input.game_session_id {
        object.key("GameSessionId").string(var_443);
    }
    if let Some(var_444) = &input.maximum_player_session_count {
        object.key("MaximumPlayerSessionCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_444).into()),
        );
    }
    if let Some(var_445) = &input.name {
        object.key("Name").string(var_445);
    }
    if let Some(var_446) = &input.player_session_creation_policy {
        object
            .key("PlayerSessionCreationPolicy")
            .string(var_446.as_str());
    }
    if let Some(var_447) = &input.protection_policy {
        object.key("ProtectionPolicy").string(var_447.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_game_session_queue_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGameSessionQueueInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_448) = &input.name {
        object.key("Name").string(var_448);
    }
    if let Some(var_449) = &input.timeout_in_seconds {
        object.key("TimeoutInSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_449).into()),
        );
    }
    if let Some(var_450) = &input.player_latency_policies {
        let mut array_451 = object.key("PlayerLatencyPolicies").start_array();
        for item_452 in var_450 {
            {
                let mut object_453 = array_451.value().start_object();
                crate::json_ser::serialize_structure_crate_model_player_latency_policy(
                    &mut object_453,
                    item_452,
                )?;
                object_453.finish();
            }
        }
        array_451.finish();
    }
    if let Some(var_454) = &input.destinations {
        let mut array_455 = object.key("Destinations").start_array();
        for item_456 in var_454 {
            {
                let mut object_457 = array_455.value().start_object();
                crate::json_ser::serialize_structure_crate_model_game_session_queue_destination(
                    &mut object_457,
                    item_456,
                )?;
                object_457.finish();
            }
        }
        array_455.finish();
    }
    if let Some(var_458) = &input.filter_configuration {
        let mut object_459 = object.key("FilterConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_filter_configuration(
            &mut object_459,
            var_458,
        )?;
        object_459.finish();
    }
    if let Some(var_460) = &input.priority_configuration {
        let mut object_461 = object.key("PriorityConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_priority_configuration(
            &mut object_461,
            var_460,
        )?;
        object_461.finish();
    }
    if let Some(var_462) = &input.custom_event_data {
        object.key("CustomEventData").string(var_462);
    }
    if let Some(var_463) = &input.notification_target {
        object.key("NotificationTarget").string(var_463);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_matchmaking_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateMatchmakingConfigurationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_464) = &input.name {
        object.key("Name").string(var_464);
    }
    if let Some(var_465) = &input.description {
        object.key("Description").string(var_465);
    }
    if let Some(var_466) = &input.game_session_queue_arns {
        let mut array_467 = object.key("GameSessionQueueArns").start_array();
        for item_468 in var_466 {
            {
                array_467.value().string(item_468);
            }
        }
        array_467.finish();
    }
    if let Some(var_469) = &input.request_timeout_seconds {
        object.key("RequestTimeoutSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_469).into()),
        );
    }
    if let Some(var_470) = &input.acceptance_timeout_seconds {
        object.key("AcceptanceTimeoutSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_470).into()),
        );
    }
    if let Some(var_471) = &input.acceptance_required {
        object.key("AcceptanceRequired").boolean(*var_471);
    }
    if let Some(var_472) = &input.rule_set_name {
        object.key("RuleSetName").string(var_472);
    }
    if let Some(var_473) = &input.notification_target {
        object.key("NotificationTarget").string(var_473);
    }
    if let Some(var_474) = &input.additional_player_count {
        object.key("AdditionalPlayerCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_474).into()),
        );
    }
    if let Some(var_475) = &input.custom_event_data {
        object.key("CustomEventData").string(var_475);
    }
    if let Some(var_476) = &input.game_properties {
        let mut array_477 = object.key("GameProperties").start_array();
        for item_478 in var_476 {
            {
                let mut object_479 = array_477.value().start_object();
                crate::json_ser::serialize_structure_crate_model_game_property(
                    &mut object_479,
                    item_478,
                )?;
                object_479.finish();
            }
        }
        array_477.finish();
    }
    if let Some(var_480) = &input.game_session_data {
        object.key("GameSessionData").string(var_480);
    }
    if let Some(var_481) = &input.backfill_mode {
        object.key("BackfillMode").string(var_481.as_str());
    }
    if let Some(var_482) = &input.flex_match_mode {
        object.key("FlexMatchMode").string(var_482.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_runtime_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateRuntimeConfigurationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_483) = &input.fleet_id {
        object.key("FleetId").string(var_483);
    }
    if let Some(var_484) = &input.runtime_configuration {
        let mut object_485 = object.key("RuntimeConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_runtime_configuration(
            &mut object_485,
            var_484,
        )?;
        object_485.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_script_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateScriptInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_486) = &input.script_id {
        object.key("ScriptId").string(var_486);
    }
    if let Some(var_487) = &input.name {
        object.key("Name").string(var_487);
    }
    if let Some(var_488) = &input.version {
        object.key("Version").string(var_488);
    }
    if let Some(var_489) = &input.storage_location {
        let mut object_490 = object.key("StorageLocation").start_object();
        crate::json_ser::serialize_structure_crate_model_s3_location(&mut object_490, var_489)?;
        object_490.finish();
    }
    if let Some(var_491) = &input.zip_file {
        object
            .key("ZipFile")
            .string_unchecked(&aws_smithy_types::base64::encode(var_491));
    }
    Ok(())
}

pub fn serialize_structure_crate_input_validate_matchmaking_rule_set_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ValidateMatchmakingRuleSetInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_492) = &input.rule_set_body {
        object.key("RuleSetBody").string(var_492);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_routing_strategy(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RoutingStrategy,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_493) = &input.r#type {
        object.key("Type").string(var_493.as_str());
    }
    if let Some(var_494) = &input.fleet_id {
        object.key("FleetId").string(var_494);
    }
    if let Some(var_495) = &input.message {
        object.key("Message").string(var_495);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_tag(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Tag,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_496) = &input.key {
        object.key("Key").string(var_496);
    }
    if let Some(var_497) = &input.value {
        object.key("Value").string(var_497);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_s3_location(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::S3Location,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_498) = &input.bucket {
        object.key("Bucket").string(var_498);
    }
    if let Some(var_499) = &input.key {
        object.key("Key").string(var_499);
    }
    if let Some(var_500) = &input.role_arn {
        object.key("RoleArn").string(var_500);
    }
    if let Some(var_501) = &input.object_version {
        object.key("ObjectVersion").string(var_501);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_ip_permission(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::IpPermission,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_502) = &input.from_port {
        object.key("FromPort").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_502).into()),
        );
    }
    if let Some(var_503) = &input.to_port {
        object.key("ToPort").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_503).into()),
        );
    }
    if let Some(var_504) = &input.ip_range {
        object.key("IpRange").string(var_504);
    }
    if let Some(var_505) = &input.protocol {
        object.key("Protocol").string(var_505.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_runtime_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RuntimeConfiguration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_506) = &input.server_processes {
        let mut array_507 = object.key("ServerProcesses").start_array();
        for item_508 in var_506 {
            {
                let mut object_509 = array_507.value().start_object();
                crate::json_ser::serialize_structure_crate_model_server_process(
                    &mut object_509,
                    item_508,
                )?;
                object_509.finish();
            }
        }
        array_507.finish();
    }
    if let Some(var_510) = &input.max_concurrent_game_session_activations {
        object.key("MaxConcurrentGameSessionActivations").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_510).into()),
        );
    }
    if let Some(var_511) = &input.game_session_activation_timeout_seconds {
        object.key("GameSessionActivationTimeoutSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_511).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_resource_creation_limit_policy(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ResourceCreationLimitPolicy,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_512) = &input.new_game_sessions_per_creator {
        object.key("NewGameSessionsPerCreator").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_512).into()),
        );
    }
    if let Some(var_513) = &input.policy_period_in_minutes {
        object.key("PolicyPeriodInMinutes").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_513).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_certificate_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CertificateConfiguration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_514) = &input.certificate_type {
        object.key("CertificateType").string(var_514.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_location_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::LocationConfiguration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_515) = &input.location {
        object.key("Location").string(var_515);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_launch_template_specification(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::LaunchTemplateSpecification,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_516) = &input.launch_template_id {
        object.key("LaunchTemplateId").string(var_516);
    }
    if let Some(var_517) = &input.launch_template_name {
        object.key("LaunchTemplateName").string(var_517);
    }
    if let Some(var_518) = &input.version {
        object.key("Version").string(var_518);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_instance_definition(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::InstanceDefinition,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_519) = &input.instance_type {
        object.key("InstanceType").string(var_519.as_str());
    }
    if let Some(var_520) = &input.weighted_capacity {
        object.key("WeightedCapacity").string(var_520);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_game_server_group_auto_scaling_policy(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::GameServerGroupAutoScalingPolicy,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_521) = &input.estimated_instance_warmup {
        object.key("EstimatedInstanceWarmup").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_521).into()),
        );
    }
    if let Some(var_522) = &input.target_tracking_configuration {
        let mut object_523 = object.key("TargetTrackingConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_target_tracking_configuration(
            &mut object_523,
            var_522,
        )?;
        object_523.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_game_property(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::GameProperty,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_524) = &input.key {
        object.key("Key").string(var_524);
    }
    if let Some(var_525) = &input.value {
        object.key("Value").string(var_525);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_player_latency_policy(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::PlayerLatencyPolicy,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_526) = &input.maximum_individual_player_latency_milliseconds {
        object
            .key("MaximumIndividualPlayerLatencyMilliseconds")
            .number(
                #[allow(clippy::useless_conversion)]
                aws_smithy_types::Number::NegInt((*var_526).into()),
            );
    }
    if let Some(var_527) = &input.policy_duration_seconds {
        object.key("PolicyDurationSeconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_527).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_game_session_queue_destination(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::GameSessionQueueDestination,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_528) = &input.destination_arn {
        object.key("DestinationArn").string(var_528);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_filter_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::FilterConfiguration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_529) = &input.allowed_locations {
        let mut array_530 = object.key("AllowedLocations").start_array();
        for item_531 in var_529 {
            {
                array_530.value().string(item_531);
            }
        }
        array_530.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_priority_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::PriorityConfiguration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_532) = &input.priority_order {
        let mut array_533 = object.key("PriorityOrder").start_array();
        for item_534 in var_532 {
            {
                array_533.value().string(item_534.as_str());
            }
        }
        array_533.finish();
    }
    if let Some(var_535) = &input.location_order {
        let mut array_536 = object.key("LocationOrder").start_array();
        for item_537 in var_535 {
            {
                array_536.value().string(item_537);
            }
        }
        array_536.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_target_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::TargetConfiguration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    {
        object.key("TargetValue").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((input.target_value).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_player_latency(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::PlayerLatency,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_538) = &input.player_id {
        object.key("PlayerId").string(var_538);
    }
    if let Some(var_539) = &input.region_identifier {
        object.key("RegionIdentifier").string(var_539);
    }
    if input.latency_in_milliseconds != 0.0 {
        object.key("LatencyInMilliseconds").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((input.latency_in_milliseconds).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_desired_player_session(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DesiredPlayerSession,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_540) = &input.player_id {
        object.key("PlayerId").string(var_540);
    }
    if let Some(var_541) = &input.player_data {
        object.key("PlayerData").string(var_541);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_player(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Player,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_542) = &input.player_id {
        object.key("PlayerId").string(var_542);
    }
    if let Some(var_543) = &input.player_attributes {
        let mut object_544 = object.key("PlayerAttributes").start_object();
        for (key_545, value_546) in var_543 {
            {
                let mut object_547 = object_544.key(key_545).start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_value(
                    &mut object_547,
                    value_546,
                )?;
                object_547.finish();
            }
        }
        object_544.finish();
    }
    if let Some(var_548) = &input.team {
        object.key("Team").string(var_548);
    }
    if let Some(var_549) = &input.latency_in_ms {
        let mut object_550 = object.key("LatencyInMs").start_object();
        for (key_551, value_552) in var_549 {
            {
                object_550.key(key_551).number(
                    #[allow(clippy::useless_conversion)]
                    aws_smithy_types::Number::NegInt((*value_552).into()),
                );
            }
        }
        object_550.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_server_process(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ServerProcess,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_553) = &input.launch_path {
        object.key("LaunchPath").string(var_553);
    }
    if let Some(var_554) = &input.parameters {
        object.key("Parameters").string(var_554);
    }
    if let Some(var_555) = &input.concurrent_executions {
        object.key("ConcurrentExecutions").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_555).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_target_tracking_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::TargetTrackingConfiguration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_556) = &input.target_value {
        object.key("TargetValue").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_556).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_attribute_value(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AttributeValue,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_557) = &input.s {
        object.key("S").string(var_557);
    }
    if let Some(var_558) = &input.n {
        object.key("N").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::Float((*var_558).into()),
        );
    }
    if let Some(var_559) = &input.sl {
        let mut array_560 = object.key("SL").start_array();
        for item_561 in var_559 {
            {
                array_560.value().string(item_561);
            }
        }
        array_560.finish();
    }
    if let Some(var_562) = &input.sdm {
        let mut object_563 = object.key("SDM").start_object();
        for (key_564, value_565) in var_562 {
            {
                object_563.key(key_564).number(
                    #[allow(clippy::useless_conversion)]
                    aws_smithy_types::Number::Float((*value_565).into()),
                );
            }
        }
        object_563.finish();
    }
    Ok(())
}
