// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_add_custom_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AddCustomAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_1) = &input.user_pool_id {
        object.key("UserPoolId").string(var_1);
    }
    if let Some(var_2) = &input.custom_attributes {
        let mut array_3 = object.key("CustomAttributes").start_array();
        for item_4 in var_2 {
            {
                let mut object_5 = array_3.value().start_object();
                crate::json_ser::serialize_structure_crate_model_schema_attribute_type(
                    &mut object_5,
                    item_4,
                )?;
                object_5.finish();
            }
        }
        array_3.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_add_user_to_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminAddUserToGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_6) = &input.user_pool_id {
        object.key("UserPoolId").string(var_6);
    }
    if let Some(var_7) = &input.username {
        object.key("Username").string(var_7);
    }
    if let Some(var_8) = &input.group_name {
        object.key("GroupName").string(var_8);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_confirm_sign_up_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminConfirmSignUpInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_9) = &input.user_pool_id {
        object.key("UserPoolId").string(var_9);
    }
    if let Some(var_10) = &input.username {
        object.key("Username").string(var_10);
    }
    if let Some(var_11) = &input.client_metadata {
        let mut object_12 = object.key("ClientMetadata").start_object();
        for (key_13, value_14) in var_11 {
            {
                object_12.key(key_13).string(value_14);
            }
        }
        object_12.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_create_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminCreateUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_15) = &input.user_pool_id {
        object.key("UserPoolId").string(var_15);
    }
    if let Some(var_16) = &input.username {
        object.key("Username").string(var_16);
    }
    if let Some(var_17) = &input.user_attributes {
        let mut array_18 = object.key("UserAttributes").start_array();
        for item_19 in var_17 {
            {
                let mut object_20 = array_18.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_type(
                    &mut object_20,
                    item_19,
                )?;
                object_20.finish();
            }
        }
        array_18.finish();
    }
    if let Some(var_21) = &input.validation_data {
        let mut array_22 = object.key("ValidationData").start_array();
        for item_23 in var_21 {
            {
                let mut object_24 = array_22.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_type(
                    &mut object_24,
                    item_23,
                )?;
                object_24.finish();
            }
        }
        array_22.finish();
    }
    if let Some(var_25) = &input.temporary_password {
        object.key("TemporaryPassword").string(var_25);
    }
    if input.force_alias_creation {
        object
            .key("ForceAliasCreation")
            .boolean(input.force_alias_creation);
    }
    if let Some(var_26) = &input.message_action {
        object.key("MessageAction").string(var_26.as_str());
    }
    if let Some(var_27) = &input.desired_delivery_mediums {
        let mut array_28 = object.key("DesiredDeliveryMediums").start_array();
        for item_29 in var_27 {
            {
                array_28.value().string(item_29.as_str());
            }
        }
        array_28.finish();
    }
    if let Some(var_30) = &input.client_metadata {
        let mut object_31 = object.key("ClientMetadata").start_object();
        for (key_32, value_33) in var_30 {
            {
                object_31.key(key_32).string(value_33);
            }
        }
        object_31.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_delete_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminDeleteUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_34) = &input.user_pool_id {
        object.key("UserPoolId").string(var_34);
    }
    if let Some(var_35) = &input.username {
        object.key("Username").string(var_35);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_delete_user_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminDeleteUserAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_36) = &input.user_pool_id {
        object.key("UserPoolId").string(var_36);
    }
    if let Some(var_37) = &input.username {
        object.key("Username").string(var_37);
    }
    if let Some(var_38) = &input.user_attribute_names {
        let mut array_39 = object.key("UserAttributeNames").start_array();
        for item_40 in var_38 {
            {
                array_39.value().string(item_40);
            }
        }
        array_39.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_disable_provider_for_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminDisableProviderForUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_41) = &input.user_pool_id {
        object.key("UserPoolId").string(var_41);
    }
    if let Some(var_42) = &input.user {
        let mut object_43 = object.key("User").start_object();
        crate::json_ser::serialize_structure_crate_model_provider_user_identifier_type(
            &mut object_43,
            var_42,
        )?;
        object_43.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_disable_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminDisableUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_44) = &input.user_pool_id {
        object.key("UserPoolId").string(var_44);
    }
    if let Some(var_45) = &input.username {
        object.key("Username").string(var_45);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_enable_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminEnableUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_46) = &input.user_pool_id {
        object.key("UserPoolId").string(var_46);
    }
    if let Some(var_47) = &input.username {
        object.key("Username").string(var_47);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_forget_device_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminForgetDeviceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_48) = &input.user_pool_id {
        object.key("UserPoolId").string(var_48);
    }
    if let Some(var_49) = &input.username {
        object.key("Username").string(var_49);
    }
    if let Some(var_50) = &input.device_key {
        object.key("DeviceKey").string(var_50);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_get_device_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminGetDeviceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_51) = &input.device_key {
        object.key("DeviceKey").string(var_51);
    }
    if let Some(var_52) = &input.user_pool_id {
        object.key("UserPoolId").string(var_52);
    }
    if let Some(var_53) = &input.username {
        object.key("Username").string(var_53);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_get_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminGetUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_54) = &input.user_pool_id {
        object.key("UserPoolId").string(var_54);
    }
    if let Some(var_55) = &input.username {
        object.key("Username").string(var_55);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_initiate_auth_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminInitiateAuthInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_56) = &input.user_pool_id {
        object.key("UserPoolId").string(var_56);
    }
    if let Some(var_57) = &input.client_id {
        object.key("ClientId").string(var_57);
    }
    if let Some(var_58) = &input.auth_flow {
        object.key("AuthFlow").string(var_58.as_str());
    }
    if let Some(var_59) = &input.auth_parameters {
        let mut object_60 = object.key("AuthParameters").start_object();
        for (key_61, value_62) in var_59 {
            {
                object_60.key(key_61).string(value_62);
            }
        }
        object_60.finish();
    }
    if let Some(var_63) = &input.client_metadata {
        let mut object_64 = object.key("ClientMetadata").start_object();
        for (key_65, value_66) in var_63 {
            {
                object_64.key(key_65).string(value_66);
            }
        }
        object_64.finish();
    }
    if let Some(var_67) = &input.analytics_metadata {
        let mut object_68 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_68,
            var_67,
        )?;
        object_68.finish();
    }
    if let Some(var_69) = &input.context_data {
        let mut object_70 = object.key("ContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_context_data_type(&mut object_70, var_69)?;
        object_70.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_link_provider_for_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminLinkProviderForUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_71) = &input.user_pool_id {
        object.key("UserPoolId").string(var_71);
    }
    if let Some(var_72) = &input.destination_user {
        let mut object_73 = object.key("DestinationUser").start_object();
        crate::json_ser::serialize_structure_crate_model_provider_user_identifier_type(
            &mut object_73,
            var_72,
        )?;
        object_73.finish();
    }
    if let Some(var_74) = &input.source_user {
        let mut object_75 = object.key("SourceUser").start_object();
        crate::json_ser::serialize_structure_crate_model_provider_user_identifier_type(
            &mut object_75,
            var_74,
        )?;
        object_75.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_list_devices_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminListDevicesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_76) = &input.user_pool_id {
        object.key("UserPoolId").string(var_76);
    }
    if let Some(var_77) = &input.username {
        object.key("Username").string(var_77);
    }
    if let Some(var_78) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_78).into()),
        );
    }
    if let Some(var_79) = &input.pagination_token {
        object.key("PaginationToken").string(var_79);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_list_groups_for_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminListGroupsForUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_80) = &input.username {
        object.key("Username").string(var_80);
    }
    if let Some(var_81) = &input.user_pool_id {
        object.key("UserPoolId").string(var_81);
    }
    if let Some(var_82) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_82).into()),
        );
    }
    if let Some(var_83) = &input.next_token {
        object.key("NextToken").string(var_83);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_list_user_auth_events_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminListUserAuthEventsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_84) = &input.user_pool_id {
        object.key("UserPoolId").string(var_84);
    }
    if let Some(var_85) = &input.username {
        object.key("Username").string(var_85);
    }
    if let Some(var_86) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_86).into()),
        );
    }
    if let Some(var_87) = &input.next_token {
        object.key("NextToken").string(var_87);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_remove_user_from_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminRemoveUserFromGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_88) = &input.user_pool_id {
        object.key("UserPoolId").string(var_88);
    }
    if let Some(var_89) = &input.username {
        object.key("Username").string(var_89);
    }
    if let Some(var_90) = &input.group_name {
        object.key("GroupName").string(var_90);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_reset_user_password_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminResetUserPasswordInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_91) = &input.user_pool_id {
        object.key("UserPoolId").string(var_91);
    }
    if let Some(var_92) = &input.username {
        object.key("Username").string(var_92);
    }
    if let Some(var_93) = &input.client_metadata {
        let mut object_94 = object.key("ClientMetadata").start_object();
        for (key_95, value_96) in var_93 {
            {
                object_94.key(key_95).string(value_96);
            }
        }
        object_94.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_respond_to_auth_challenge_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminRespondToAuthChallengeInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_97) = &input.user_pool_id {
        object.key("UserPoolId").string(var_97);
    }
    if let Some(var_98) = &input.client_id {
        object.key("ClientId").string(var_98);
    }
    if let Some(var_99) = &input.challenge_name {
        object.key("ChallengeName").string(var_99.as_str());
    }
    if let Some(var_100) = &input.challenge_responses {
        let mut object_101 = object.key("ChallengeResponses").start_object();
        for (key_102, value_103) in var_100 {
            {
                object_101.key(key_102).string(value_103);
            }
        }
        object_101.finish();
    }
    if let Some(var_104) = &input.session {
        object.key("Session").string(var_104);
    }
    if let Some(var_105) = &input.analytics_metadata {
        let mut object_106 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_106,
            var_105,
        )?;
        object_106.finish();
    }
    if let Some(var_107) = &input.context_data {
        let mut object_108 = object.key("ContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_context_data_type(
            &mut object_108,
            var_107,
        )?;
        object_108.finish();
    }
    if let Some(var_109) = &input.client_metadata {
        let mut object_110 = object.key("ClientMetadata").start_object();
        for (key_111, value_112) in var_109 {
            {
                object_110.key(key_111).string(value_112);
            }
        }
        object_110.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_set_user_mfa_preference_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminSetUserMfaPreferenceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_113) = &input.sms_mfa_settings {
        let mut object_114 = object.key("SMSMfaSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_sms_mfa_settings_type(
            &mut object_114,
            var_113,
        )?;
        object_114.finish();
    }
    if let Some(var_115) = &input.software_token_mfa_settings {
        let mut object_116 = object.key("SoftwareTokenMfaSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_software_token_mfa_settings_type(
            &mut object_116,
            var_115,
        )?;
        object_116.finish();
    }
    if let Some(var_117) = &input.username {
        object.key("Username").string(var_117);
    }
    if let Some(var_118) = &input.user_pool_id {
        object.key("UserPoolId").string(var_118);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_set_user_password_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminSetUserPasswordInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_119) = &input.user_pool_id {
        object.key("UserPoolId").string(var_119);
    }
    if let Some(var_120) = &input.username {
        object.key("Username").string(var_120);
    }
    if let Some(var_121) = &input.password {
        object.key("Password").string(var_121);
    }
    if input.permanent {
        object.key("Permanent").boolean(input.permanent);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_set_user_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminSetUserSettingsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_122) = &input.user_pool_id {
        object.key("UserPoolId").string(var_122);
    }
    if let Some(var_123) = &input.username {
        object.key("Username").string(var_123);
    }
    if let Some(var_124) = &input.mfa_options {
        let mut array_125 = object.key("MFAOptions").start_array();
        for item_126 in var_124 {
            {
                let mut object_127 = array_125.value().start_object();
                crate::json_ser::serialize_structure_crate_model_mfa_option_type(
                    &mut object_127,
                    item_126,
                )?;
                object_127.finish();
            }
        }
        array_125.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_update_auth_event_feedback_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminUpdateAuthEventFeedbackInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_128) = &input.user_pool_id {
        object.key("UserPoolId").string(var_128);
    }
    if let Some(var_129) = &input.username {
        object.key("Username").string(var_129);
    }
    if let Some(var_130) = &input.event_id {
        object.key("EventId").string(var_130);
    }
    if let Some(var_131) = &input.feedback_value {
        object.key("FeedbackValue").string(var_131.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_update_device_status_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminUpdateDeviceStatusInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_132) = &input.user_pool_id {
        object.key("UserPoolId").string(var_132);
    }
    if let Some(var_133) = &input.username {
        object.key("Username").string(var_133);
    }
    if let Some(var_134) = &input.device_key {
        object.key("DeviceKey").string(var_134);
    }
    if let Some(var_135) = &input.device_remembered_status {
        object
            .key("DeviceRememberedStatus")
            .string(var_135.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_update_user_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminUpdateUserAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_136) = &input.user_pool_id {
        object.key("UserPoolId").string(var_136);
    }
    if let Some(var_137) = &input.username {
        object.key("Username").string(var_137);
    }
    if let Some(var_138) = &input.user_attributes {
        let mut array_139 = object.key("UserAttributes").start_array();
        for item_140 in var_138 {
            {
                let mut object_141 = array_139.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_type(
                    &mut object_141,
                    item_140,
                )?;
                object_141.finish();
            }
        }
        array_139.finish();
    }
    if let Some(var_142) = &input.client_metadata {
        let mut object_143 = object.key("ClientMetadata").start_object();
        for (key_144, value_145) in var_142 {
            {
                object_143.key(key_144).string(value_145);
            }
        }
        object_143.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_admin_user_global_sign_out_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AdminUserGlobalSignOutInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_146) = &input.user_pool_id {
        object.key("UserPoolId").string(var_146);
    }
    if let Some(var_147) = &input.username {
        object.key("Username").string(var_147);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_associate_software_token_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateSoftwareTokenInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_148) = &input.access_token {
        object.key("AccessToken").string(var_148);
    }
    if let Some(var_149) = &input.session {
        object.key("Session").string(var_149);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_change_password_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ChangePasswordInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_150) = &input.previous_password {
        object.key("PreviousPassword").string(var_150);
    }
    if let Some(var_151) = &input.proposed_password {
        object.key("ProposedPassword").string(var_151);
    }
    if let Some(var_152) = &input.access_token {
        object.key("AccessToken").string(var_152);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_confirm_device_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ConfirmDeviceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_153) = &input.access_token {
        object.key("AccessToken").string(var_153);
    }
    if let Some(var_154) = &input.device_key {
        object.key("DeviceKey").string(var_154);
    }
    if let Some(var_155) = &input.device_secret_verifier_config {
        let mut object_156 = object.key("DeviceSecretVerifierConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_device_secret_verifier_config_type(
            &mut object_156,
            var_155,
        )?;
        object_156.finish();
    }
    if let Some(var_157) = &input.device_name {
        object.key("DeviceName").string(var_157);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_confirm_forgot_password_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ConfirmForgotPasswordInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_158) = &input.client_id {
        object.key("ClientId").string(var_158);
    }
    if let Some(var_159) = &input.secret_hash {
        object.key("SecretHash").string(var_159);
    }
    if let Some(var_160) = &input.username {
        object.key("Username").string(var_160);
    }
    if let Some(var_161) = &input.confirmation_code {
        object.key("ConfirmationCode").string(var_161);
    }
    if let Some(var_162) = &input.password {
        object.key("Password").string(var_162);
    }
    if let Some(var_163) = &input.analytics_metadata {
        let mut object_164 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_164,
            var_163,
        )?;
        object_164.finish();
    }
    if let Some(var_165) = &input.user_context_data {
        let mut object_166 = object.key("UserContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_user_context_data_type(
            &mut object_166,
            var_165,
        )?;
        object_166.finish();
    }
    if let Some(var_167) = &input.client_metadata {
        let mut object_168 = object.key("ClientMetadata").start_object();
        for (key_169, value_170) in var_167 {
            {
                object_168.key(key_169).string(value_170);
            }
        }
        object_168.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_confirm_sign_up_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ConfirmSignUpInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_171) = &input.client_id {
        object.key("ClientId").string(var_171);
    }
    if let Some(var_172) = &input.secret_hash {
        object.key("SecretHash").string(var_172);
    }
    if let Some(var_173) = &input.username {
        object.key("Username").string(var_173);
    }
    if let Some(var_174) = &input.confirmation_code {
        object.key("ConfirmationCode").string(var_174);
    }
    if input.force_alias_creation {
        object
            .key("ForceAliasCreation")
            .boolean(input.force_alias_creation);
    }
    if let Some(var_175) = &input.analytics_metadata {
        let mut object_176 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_176,
            var_175,
        )?;
        object_176.finish();
    }
    if let Some(var_177) = &input.user_context_data {
        let mut object_178 = object.key("UserContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_user_context_data_type(
            &mut object_178,
            var_177,
        )?;
        object_178.finish();
    }
    if let Some(var_179) = &input.client_metadata {
        let mut object_180 = object.key("ClientMetadata").start_object();
        for (key_181, value_182) in var_179 {
            {
                object_180.key(key_181).string(value_182);
            }
        }
        object_180.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_183) = &input.group_name {
        object.key("GroupName").string(var_183);
    }
    if let Some(var_184) = &input.user_pool_id {
        object.key("UserPoolId").string(var_184);
    }
    if let Some(var_185) = &input.description {
        object.key("Description").string(var_185);
    }
    if let Some(var_186) = &input.role_arn {
        object.key("RoleArn").string(var_186);
    }
    if let Some(var_187) = &input.precedence {
        object.key("Precedence").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_187).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_identity_provider_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateIdentityProviderInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_188) = &input.user_pool_id {
        object.key("UserPoolId").string(var_188);
    }
    if let Some(var_189) = &input.provider_name {
        object.key("ProviderName").string(var_189);
    }
    if let Some(var_190) = &input.provider_type {
        object.key("ProviderType").string(var_190.as_str());
    }
    if let Some(var_191) = &input.provider_details {
        let mut object_192 = object.key("ProviderDetails").start_object();
        for (key_193, value_194) in var_191 {
            {
                object_192.key(key_193).string(value_194);
            }
        }
        object_192.finish();
    }
    if let Some(var_195) = &input.attribute_mapping {
        let mut object_196 = object.key("AttributeMapping").start_object();
        for (key_197, value_198) in var_195 {
            {
                object_196.key(key_197).string(value_198);
            }
        }
        object_196.finish();
    }
    if let Some(var_199) = &input.idp_identifiers {
        let mut array_200 = object.key("IdpIdentifiers").start_array();
        for item_201 in var_199 {
            {
                array_200.value().string(item_201);
            }
        }
        array_200.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_resource_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateResourceServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_202) = &input.user_pool_id {
        object.key("UserPoolId").string(var_202);
    }
    if let Some(var_203) = &input.identifier {
        object.key("Identifier").string(var_203);
    }
    if let Some(var_204) = &input.name {
        object.key("Name").string(var_204);
    }
    if let Some(var_205) = &input.scopes {
        let mut array_206 = object.key("Scopes").start_array();
        for item_207 in var_205 {
            {
                let mut object_208 = array_206.value().start_object();
                crate::json_ser::serialize_structure_crate_model_resource_server_scope_type(
                    &mut object_208,
                    item_207,
                )?;
                object_208.finish();
            }
        }
        array_206.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_user_import_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUserImportJobInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_209) = &input.job_name {
        object.key("JobName").string(var_209);
    }
    if let Some(var_210) = &input.user_pool_id {
        object.key("UserPoolId").string(var_210);
    }
    if let Some(var_211) = &input.cloud_watch_logs_role_arn {
        object.key("CloudWatchLogsRoleArn").string(var_211);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_user_pool_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUserPoolInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_212) = &input.pool_name {
        object.key("PoolName").string(var_212);
    }
    if let Some(var_213) = &input.policies {
        let mut object_214 = object.key("Policies").start_object();
        crate::json_ser::serialize_structure_crate_model_user_pool_policy_type(
            &mut object_214,
            var_213,
        )?;
        object_214.finish();
    }
    if let Some(var_215) = &input.lambda_config {
        let mut object_216 = object.key("LambdaConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_lambda_config_type(
            &mut object_216,
            var_215,
        )?;
        object_216.finish();
    }
    if let Some(var_217) = &input.auto_verified_attributes {
        let mut array_218 = object.key("AutoVerifiedAttributes").start_array();
        for item_219 in var_217 {
            {
                array_218.value().string(item_219.as_str());
            }
        }
        array_218.finish();
    }
    if let Some(var_220) = &input.alias_attributes {
        let mut array_221 = object.key("AliasAttributes").start_array();
        for item_222 in var_220 {
            {
                array_221.value().string(item_222.as_str());
            }
        }
        array_221.finish();
    }
    if let Some(var_223) = &input.username_attributes {
        let mut array_224 = object.key("UsernameAttributes").start_array();
        for item_225 in var_223 {
            {
                array_224.value().string(item_225.as_str());
            }
        }
        array_224.finish();
    }
    if let Some(var_226) = &input.sms_verification_message {
        object.key("SmsVerificationMessage").string(var_226);
    }
    if let Some(var_227) = &input.email_verification_message {
        object.key("EmailVerificationMessage").string(var_227);
    }
    if let Some(var_228) = &input.email_verification_subject {
        object.key("EmailVerificationSubject").string(var_228);
    }
    if let Some(var_229) = &input.verification_message_template {
        let mut object_230 = object.key("VerificationMessageTemplate").start_object();
        crate::json_ser::serialize_structure_crate_model_verification_message_template_type(
            &mut object_230,
            var_229,
        )?;
        object_230.finish();
    }
    if let Some(var_231) = &input.sms_authentication_message {
        object.key("SmsAuthenticationMessage").string(var_231);
    }
    if let Some(var_232) = &input.mfa_configuration {
        object.key("MfaConfiguration").string(var_232.as_str());
    }
    if let Some(var_233) = &input.device_configuration {
        let mut object_234 = object.key("DeviceConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_device_configuration_type(
            &mut object_234,
            var_233,
        )?;
        object_234.finish();
    }
    if let Some(var_235) = &input.email_configuration {
        let mut object_236 = object.key("EmailConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_email_configuration_type(
            &mut object_236,
            var_235,
        )?;
        object_236.finish();
    }
    if let Some(var_237) = &input.sms_configuration {
        let mut object_238 = object.key("SmsConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_sms_configuration_type(
            &mut object_238,
            var_237,
        )?;
        object_238.finish();
    }
    if let Some(var_239) = &input.user_pool_tags {
        let mut object_240 = object.key("UserPoolTags").start_object();
        for (key_241, value_242) in var_239 {
            {
                object_240.key(key_241).string(value_242);
            }
        }
        object_240.finish();
    }
    if let Some(var_243) = &input.admin_create_user_config {
        let mut object_244 = object.key("AdminCreateUserConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_admin_create_user_config_type(
            &mut object_244,
            var_243,
        )?;
        object_244.finish();
    }
    if let Some(var_245) = &input.schema {
        let mut array_246 = object.key("Schema").start_array();
        for item_247 in var_245 {
            {
                let mut object_248 = array_246.value().start_object();
                crate::json_ser::serialize_structure_crate_model_schema_attribute_type(
                    &mut object_248,
                    item_247,
                )?;
                object_248.finish();
            }
        }
        array_246.finish();
    }
    if let Some(var_249) = &input.user_pool_add_ons {
        let mut object_250 = object.key("UserPoolAddOns").start_object();
        crate::json_ser::serialize_structure_crate_model_user_pool_add_ons_type(
            &mut object_250,
            var_249,
        )?;
        object_250.finish();
    }
    if let Some(var_251) = &input.username_configuration {
        let mut object_252 = object.key("UsernameConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_username_configuration_type(
            &mut object_252,
            var_251,
        )?;
        object_252.finish();
    }
    if let Some(var_253) = &input.account_recovery_setting {
        let mut object_254 = object.key("AccountRecoverySetting").start_object();
        crate::json_ser::serialize_structure_crate_model_account_recovery_setting_type(
            &mut object_254,
            var_253,
        )?;
        object_254.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_user_pool_client_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUserPoolClientInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_255) = &input.user_pool_id {
        object.key("UserPoolId").string(var_255);
    }
    if let Some(var_256) = &input.client_name {
        object.key("ClientName").string(var_256);
    }
    if input.generate_secret {
        object.key("GenerateSecret").boolean(input.generate_secret);
    }
    if input.refresh_token_validity != 0 {
        object.key("RefreshTokenValidity").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.refresh_token_validity).into()),
        );
    }
    if let Some(var_257) = &input.access_token_validity {
        object.key("AccessTokenValidity").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_257).into()),
        );
    }
    if let Some(var_258) = &input.id_token_validity {
        object.key("IdTokenValidity").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_258).into()),
        );
    }
    if let Some(var_259) = &input.token_validity_units {
        let mut object_260 = object.key("TokenValidityUnits").start_object();
        crate::json_ser::serialize_structure_crate_model_token_validity_units_type(
            &mut object_260,
            var_259,
        )?;
        object_260.finish();
    }
    if let Some(var_261) = &input.read_attributes {
        let mut array_262 = object.key("ReadAttributes").start_array();
        for item_263 in var_261 {
            {
                array_262.value().string(item_263);
            }
        }
        array_262.finish();
    }
    if let Some(var_264) = &input.write_attributes {
        let mut array_265 = object.key("WriteAttributes").start_array();
        for item_266 in var_264 {
            {
                array_265.value().string(item_266);
            }
        }
        array_265.finish();
    }
    if let Some(var_267) = &input.explicit_auth_flows {
        let mut array_268 = object.key("ExplicitAuthFlows").start_array();
        for item_269 in var_267 {
            {
                array_268.value().string(item_269.as_str());
            }
        }
        array_268.finish();
    }
    if let Some(var_270) = &input.supported_identity_providers {
        let mut array_271 = object.key("SupportedIdentityProviders").start_array();
        for item_272 in var_270 {
            {
                array_271.value().string(item_272);
            }
        }
        array_271.finish();
    }
    if let Some(var_273) = &input.callback_ur_ls {
        let mut array_274 = object.key("CallbackURLs").start_array();
        for item_275 in var_273 {
            {
                array_274.value().string(item_275);
            }
        }
        array_274.finish();
    }
    if let Some(var_276) = &input.logout_ur_ls {
        let mut array_277 = object.key("LogoutURLs").start_array();
        for item_278 in var_276 {
            {
                array_277.value().string(item_278);
            }
        }
        array_277.finish();
    }
    if let Some(var_279) = &input.default_redirect_uri {
        object.key("DefaultRedirectURI").string(var_279);
    }
    if let Some(var_280) = &input.allowed_o_auth_flows {
        let mut array_281 = object.key("AllowedOAuthFlows").start_array();
        for item_282 in var_280 {
            {
                array_281.value().string(item_282.as_str());
            }
        }
        array_281.finish();
    }
    if let Some(var_283) = &input.allowed_o_auth_scopes {
        let mut array_284 = object.key("AllowedOAuthScopes").start_array();
        for item_285 in var_283 {
            {
                array_284.value().string(item_285);
            }
        }
        array_284.finish();
    }
    if input.allowed_o_auth_flows_user_pool_client {
        object
            .key("AllowedOAuthFlowsUserPoolClient")
            .boolean(input.allowed_o_auth_flows_user_pool_client);
    }
    if let Some(var_286) = &input.analytics_configuration {
        let mut object_287 = object.key("AnalyticsConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_configuration_type(
            &mut object_287,
            var_286,
        )?;
        object_287.finish();
    }
    if let Some(var_288) = &input.prevent_user_existence_errors {
        object
            .key("PreventUserExistenceErrors")
            .string(var_288.as_str());
    }
    if let Some(var_289) = &input.enable_token_revocation {
        object.key("EnableTokenRevocation").boolean(*var_289);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_user_pool_domain_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUserPoolDomainInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_290) = &input.domain {
        object.key("Domain").string(var_290);
    }
    if let Some(var_291) = &input.user_pool_id {
        object.key("UserPoolId").string(var_291);
    }
    if let Some(var_292) = &input.custom_domain_config {
        let mut object_293 = object.key("CustomDomainConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_custom_domain_config_type(
            &mut object_293,
            var_292,
        )?;
        object_293.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_294) = &input.group_name {
        object.key("GroupName").string(var_294);
    }
    if let Some(var_295) = &input.user_pool_id {
        object.key("UserPoolId").string(var_295);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_identity_provider_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteIdentityProviderInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_296) = &input.user_pool_id {
        object.key("UserPoolId").string(var_296);
    }
    if let Some(var_297) = &input.provider_name {
        object.key("ProviderName").string(var_297);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_resource_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteResourceServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_298) = &input.user_pool_id {
        object.key("UserPoolId").string(var_298);
    }
    if let Some(var_299) = &input.identifier {
        object.key("Identifier").string(var_299);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_300) = &input.access_token {
        object.key("AccessToken").string(var_300);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_user_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteUserAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_301) = &input.user_attribute_names {
        let mut array_302 = object.key("UserAttributeNames").start_array();
        for item_303 in var_301 {
            {
                array_302.value().string(item_303);
            }
        }
        array_302.finish();
    }
    if let Some(var_304) = &input.access_token {
        object.key("AccessToken").string(var_304);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_user_pool_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteUserPoolInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_305) = &input.user_pool_id {
        object.key("UserPoolId").string(var_305);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_user_pool_client_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteUserPoolClientInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_306) = &input.user_pool_id {
        object.key("UserPoolId").string(var_306);
    }
    if let Some(var_307) = &input.client_id {
        object.key("ClientId").string(var_307);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_user_pool_domain_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteUserPoolDomainInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_308) = &input.domain {
        object.key("Domain").string(var_308);
    }
    if let Some(var_309) = &input.user_pool_id {
        object.key("UserPoolId").string(var_309);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_identity_provider_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeIdentityProviderInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_310) = &input.user_pool_id {
        object.key("UserPoolId").string(var_310);
    }
    if let Some(var_311) = &input.provider_name {
        object.key("ProviderName").string(var_311);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_resource_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeResourceServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_312) = &input.user_pool_id {
        object.key("UserPoolId").string(var_312);
    }
    if let Some(var_313) = &input.identifier {
        object.key("Identifier").string(var_313);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_risk_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeRiskConfigurationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_314) = &input.user_pool_id {
        object.key("UserPoolId").string(var_314);
    }
    if let Some(var_315) = &input.client_id {
        object.key("ClientId").string(var_315);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_user_import_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeUserImportJobInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_316) = &input.user_pool_id {
        object.key("UserPoolId").string(var_316);
    }
    if let Some(var_317) = &input.job_id {
        object.key("JobId").string(var_317);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_user_pool_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeUserPoolInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_318) = &input.user_pool_id {
        object.key("UserPoolId").string(var_318);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_user_pool_client_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeUserPoolClientInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_319) = &input.user_pool_id {
        object.key("UserPoolId").string(var_319);
    }
    if let Some(var_320) = &input.client_id {
        object.key("ClientId").string(var_320);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_user_pool_domain_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeUserPoolDomainInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_321) = &input.domain {
        object.key("Domain").string(var_321);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_forget_device_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ForgetDeviceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_322) = &input.access_token {
        object.key("AccessToken").string(var_322);
    }
    if let Some(var_323) = &input.device_key {
        object.key("DeviceKey").string(var_323);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_forgot_password_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ForgotPasswordInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_324) = &input.client_id {
        object.key("ClientId").string(var_324);
    }
    if let Some(var_325) = &input.secret_hash {
        object.key("SecretHash").string(var_325);
    }
    if let Some(var_326) = &input.user_context_data {
        let mut object_327 = object.key("UserContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_user_context_data_type(
            &mut object_327,
            var_326,
        )?;
        object_327.finish();
    }
    if let Some(var_328) = &input.username {
        object.key("Username").string(var_328);
    }
    if let Some(var_329) = &input.analytics_metadata {
        let mut object_330 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_330,
            var_329,
        )?;
        object_330.finish();
    }
    if let Some(var_331) = &input.client_metadata {
        let mut object_332 = object.key("ClientMetadata").start_object();
        for (key_333, value_334) in var_331 {
            {
                object_332.key(key_333).string(value_334);
            }
        }
        object_332.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_csv_header_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetCsvHeaderInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_335) = &input.user_pool_id {
        object.key("UserPoolId").string(var_335);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_device_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetDeviceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_336) = &input.device_key {
        object.key("DeviceKey").string(var_336);
    }
    if let Some(var_337) = &input.access_token {
        object.key("AccessToken").string(var_337);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_338) = &input.group_name {
        object.key("GroupName").string(var_338);
    }
    if let Some(var_339) = &input.user_pool_id {
        object.key("UserPoolId").string(var_339);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_identity_provider_by_identifier_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetIdentityProviderByIdentifierInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_340) = &input.user_pool_id {
        object.key("UserPoolId").string(var_340);
    }
    if let Some(var_341) = &input.idp_identifier {
        object.key("IdpIdentifier").string(var_341);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_signing_certificate_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetSigningCertificateInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_342) = &input.user_pool_id {
        object.key("UserPoolId").string(var_342);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_ui_customization_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetUiCustomizationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_343) = &input.user_pool_id {
        object.key("UserPoolId").string(var_343);
    }
    if let Some(var_344) = &input.client_id {
        object.key("ClientId").string(var_344);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetUserInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_345) = &input.access_token {
        object.key("AccessToken").string(var_345);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_user_attribute_verification_code_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetUserAttributeVerificationCodeInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_346) = &input.access_token {
        object.key("AccessToken").string(var_346);
    }
    if let Some(var_347) = &input.attribute_name {
        object.key("AttributeName").string(var_347);
    }
    if let Some(var_348) = &input.client_metadata {
        let mut object_349 = object.key("ClientMetadata").start_object();
        for (key_350, value_351) in var_348 {
            {
                object_349.key(key_350).string(value_351);
            }
        }
        object_349.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_user_pool_mfa_config_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetUserPoolMfaConfigInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_352) = &input.user_pool_id {
        object.key("UserPoolId").string(var_352);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_global_sign_out_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GlobalSignOutInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_353) = &input.access_token {
        object.key("AccessToken").string(var_353);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_initiate_auth_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::InitiateAuthInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_354) = &input.auth_flow {
        object.key("AuthFlow").string(var_354.as_str());
    }
    if let Some(var_355) = &input.auth_parameters {
        let mut object_356 = object.key("AuthParameters").start_object();
        for (key_357, value_358) in var_355 {
            {
                object_356.key(key_357).string(value_358);
            }
        }
        object_356.finish();
    }
    if let Some(var_359) = &input.client_metadata {
        let mut object_360 = object.key("ClientMetadata").start_object();
        for (key_361, value_362) in var_359 {
            {
                object_360.key(key_361).string(value_362);
            }
        }
        object_360.finish();
    }
    if let Some(var_363) = &input.client_id {
        object.key("ClientId").string(var_363);
    }
    if let Some(var_364) = &input.analytics_metadata {
        let mut object_365 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_365,
            var_364,
        )?;
        object_365.finish();
    }
    if let Some(var_366) = &input.user_context_data {
        let mut object_367 = object.key("UserContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_user_context_data_type(
            &mut object_367,
            var_366,
        )?;
        object_367.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_devices_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListDevicesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_368) = &input.access_token {
        object.key("AccessToken").string(var_368);
    }
    if let Some(var_369) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_369).into()),
        );
    }
    if let Some(var_370) = &input.pagination_token {
        object.key("PaginationToken").string(var_370);
    }
    Ok(())
}

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

pub fn serialize_structure_crate_input_list_identity_providers_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListIdentityProvidersInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_374) = &input.user_pool_id {
        object.key("UserPoolId").string(var_374);
    }
    if let Some(var_375) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_375).into()),
        );
    }
    if let Some(var_376) = &input.next_token {
        object.key("NextToken").string(var_376);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_resource_servers_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListResourceServersInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_377) = &input.user_pool_id {
        object.key("UserPoolId").string(var_377);
    }
    if input.max_results != 0 {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_378) = &input.next_token {
        object.key("NextToken").string(var_378);
    }
    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_379) = &input.resource_arn {
        object.key("ResourceArn").string(var_379);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_user_import_jobs_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListUserImportJobsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_380) = &input.user_pool_id {
        object.key("UserPoolId").string(var_380);
    }
    {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_381) = &input.pagination_token {
        object.key("PaginationToken").string(var_381);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_user_pool_clients_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListUserPoolClientsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_382) = &input.user_pool_id {
        object.key("UserPoolId").string(var_382);
    }
    if input.max_results != 0 {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_383) = &input.next_token {
        object.key("NextToken").string(var_383);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_user_pools_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListUserPoolsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_384) = &input.next_token {
        object.key("NextToken").string(var_384);
    }
    {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_users_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListUsersInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_385) = &input.user_pool_id {
        object.key("UserPoolId").string(var_385);
    }
    if let Some(var_386) = &input.attributes_to_get {
        let mut array_387 = object.key("AttributesToGet").start_array();
        for item_388 in var_386 {
            {
                array_387.value().string(item_388);
            }
        }
        array_387.finish();
    }
    if let Some(var_389) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_389).into()),
        );
    }
    if let Some(var_390) = &input.pagination_token {
        object.key("PaginationToken").string(var_390);
    }
    if let Some(var_391) = &input.filter {
        object.key("Filter").string(var_391);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_users_in_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListUsersInGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_392) = &input.user_pool_id {
        object.key("UserPoolId").string(var_392);
    }
    if let Some(var_393) = &input.group_name {
        object.key("GroupName").string(var_393);
    }
    if let Some(var_394) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_394).into()),
        );
    }
    if let Some(var_395) = &input.next_token {
        object.key("NextToken").string(var_395);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_resend_confirmation_code_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ResendConfirmationCodeInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_396) = &input.client_id {
        object.key("ClientId").string(var_396);
    }
    if let Some(var_397) = &input.secret_hash {
        object.key("SecretHash").string(var_397);
    }
    if let Some(var_398) = &input.user_context_data {
        let mut object_399 = object.key("UserContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_user_context_data_type(
            &mut object_399,
            var_398,
        )?;
        object_399.finish();
    }
    if let Some(var_400) = &input.username {
        object.key("Username").string(var_400);
    }
    if let Some(var_401) = &input.analytics_metadata {
        let mut object_402 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_402,
            var_401,
        )?;
        object_402.finish();
    }
    if let Some(var_403) = &input.client_metadata {
        let mut object_404 = object.key("ClientMetadata").start_object();
        for (key_405, value_406) in var_403 {
            {
                object_404.key(key_405).string(value_406);
            }
        }
        object_404.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_respond_to_auth_challenge_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RespondToAuthChallengeInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_407) = &input.client_id {
        object.key("ClientId").string(var_407);
    }
    if let Some(var_408) = &input.challenge_name {
        object.key("ChallengeName").string(var_408.as_str());
    }
    if let Some(var_409) = &input.session {
        object.key("Session").string(var_409);
    }
    if let Some(var_410) = &input.challenge_responses {
        let mut object_411 = object.key("ChallengeResponses").start_object();
        for (key_412, value_413) in var_410 {
            {
                object_411.key(key_412).string(value_413);
            }
        }
        object_411.finish();
    }
    if let Some(var_414) = &input.analytics_metadata {
        let mut object_415 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_415,
            var_414,
        )?;
        object_415.finish();
    }
    if let Some(var_416) = &input.user_context_data {
        let mut object_417 = object.key("UserContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_user_context_data_type(
            &mut object_417,
            var_416,
        )?;
        object_417.finish();
    }
    if let Some(var_418) = &input.client_metadata {
        let mut object_419 = object.key("ClientMetadata").start_object();
        for (key_420, value_421) in var_418 {
            {
                object_419.key(key_420).string(value_421);
            }
        }
        object_419.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_revoke_token_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RevokeTokenInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_422) = &input.token {
        object.key("Token").string(var_422);
    }
    if let Some(var_423) = &input.client_id {
        object.key("ClientId").string(var_423);
    }
    if let Some(var_424) = &input.client_secret {
        object.key("ClientSecret").string(var_424);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_set_risk_configuration_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SetRiskConfigurationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_425) = &input.user_pool_id {
        object.key("UserPoolId").string(var_425);
    }
    if let Some(var_426) = &input.client_id {
        object.key("ClientId").string(var_426);
    }
    if let Some(var_427) = &input.compromised_credentials_risk_configuration {
        let mut object_428 = object
            .key("CompromisedCredentialsRiskConfiguration")
            .start_object();
        crate::json_ser::serialize_structure_crate_model_compromised_credentials_risk_configuration_type(&mut object_428, var_427)?;
        object_428.finish();
    }
    if let Some(var_429) = &input.account_takeover_risk_configuration {
        let mut object_430 = object
            .key("AccountTakeoverRiskConfiguration")
            .start_object();
        crate::json_ser::serialize_structure_crate_model_account_takeover_risk_configuration_type(
            &mut object_430,
            var_429,
        )?;
        object_430.finish();
    }
    if let Some(var_431) = &input.risk_exception_configuration {
        let mut object_432 = object.key("RiskExceptionConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_risk_exception_configuration_type(
            &mut object_432,
            var_431,
        )?;
        object_432.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_set_ui_customization_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SetUiCustomizationInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_433) = &input.user_pool_id {
        object.key("UserPoolId").string(var_433);
    }
    if let Some(var_434) = &input.client_id {
        object.key("ClientId").string(var_434);
    }
    if let Some(var_435) = &input.css {
        object.key("CSS").string(var_435);
    }
    if let Some(var_436) = &input.image_file {
        object
            .key("ImageFile")
            .string_unchecked(&aws_smithy_types::base64::encode(var_436));
    }
    Ok(())
}

pub fn serialize_structure_crate_input_set_user_mfa_preference_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SetUserMfaPreferenceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_437) = &input.sms_mfa_settings {
        let mut object_438 = object.key("SMSMfaSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_sms_mfa_settings_type(
            &mut object_438,
            var_437,
        )?;
        object_438.finish();
    }
    if let Some(var_439) = &input.software_token_mfa_settings {
        let mut object_440 = object.key("SoftwareTokenMfaSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_software_token_mfa_settings_type(
            &mut object_440,
            var_439,
        )?;
        object_440.finish();
    }
    if let Some(var_441) = &input.access_token {
        object.key("AccessToken").string(var_441);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_set_user_pool_mfa_config_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SetUserPoolMfaConfigInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_442) = &input.user_pool_id {
        object.key("UserPoolId").string(var_442);
    }
    if let Some(var_443) = &input.sms_mfa_configuration {
        let mut object_444 = object.key("SmsMfaConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_sms_mfa_config_type(
            &mut object_444,
            var_443,
        )?;
        object_444.finish();
    }
    if let Some(var_445) = &input.software_token_mfa_configuration {
        let mut object_446 = object.key("SoftwareTokenMfaConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_software_token_mfa_config_type(
            &mut object_446,
            var_445,
        )?;
        object_446.finish();
    }
    if let Some(var_447) = &input.mfa_configuration {
        object.key("MfaConfiguration").string(var_447.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_set_user_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SetUserSettingsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_448) = &input.access_token {
        object.key("AccessToken").string(var_448);
    }
    if let Some(var_449) = &input.mfa_options {
        let mut array_450 = object.key("MFAOptions").start_array();
        for item_451 in var_449 {
            {
                let mut object_452 = array_450.value().start_object();
                crate::json_ser::serialize_structure_crate_model_mfa_option_type(
                    &mut object_452,
                    item_451,
                )?;
                object_452.finish();
            }
        }
        array_450.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_sign_up_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SignUpInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_453) = &input.client_id {
        object.key("ClientId").string(var_453);
    }
    if let Some(var_454) = &input.secret_hash {
        object.key("SecretHash").string(var_454);
    }
    if let Some(var_455) = &input.username {
        object.key("Username").string(var_455);
    }
    if let Some(var_456) = &input.password {
        object.key("Password").string(var_456);
    }
    if let Some(var_457) = &input.user_attributes {
        let mut array_458 = object.key("UserAttributes").start_array();
        for item_459 in var_457 {
            {
                let mut object_460 = array_458.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_type(
                    &mut object_460,
                    item_459,
                )?;
                object_460.finish();
            }
        }
        array_458.finish();
    }
    if let Some(var_461) = &input.validation_data {
        let mut array_462 = object.key("ValidationData").start_array();
        for item_463 in var_461 {
            {
                let mut object_464 = array_462.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_type(
                    &mut object_464,
                    item_463,
                )?;
                object_464.finish();
            }
        }
        array_462.finish();
    }
    if let Some(var_465) = &input.analytics_metadata {
        let mut object_466 = object.key("AnalyticsMetadata").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_metadata_type(
            &mut object_466,
            var_465,
        )?;
        object_466.finish();
    }
    if let Some(var_467) = &input.user_context_data {
        let mut object_468 = object.key("UserContextData").start_object();
        crate::json_ser::serialize_structure_crate_model_user_context_data_type(
            &mut object_468,
            var_467,
        )?;
        object_468.finish();
    }
    if let Some(var_469) = &input.client_metadata {
        let mut object_470 = object.key("ClientMetadata").start_object();
        for (key_471, value_472) in var_469 {
            {
                object_470.key(key_471).string(value_472);
            }
        }
        object_470.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_user_import_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartUserImportJobInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_473) = &input.user_pool_id {
        object.key("UserPoolId").string(var_473);
    }
    if let Some(var_474) = &input.job_id {
        object.key("JobId").string(var_474);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_user_import_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopUserImportJobInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_475) = &input.user_pool_id {
        object.key("UserPoolId").string(var_475);
    }
    if let Some(var_476) = &input.job_id {
        object.key("JobId").string(var_476);
    }
    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_477) = &input.resource_arn {
        object.key("ResourceArn").string(var_477);
    }
    if let Some(var_478) = &input.tags {
        let mut object_479 = object.key("Tags").start_object();
        for (key_480, value_481) in var_478 {
            {
                object_479.key(key_480).string(value_481);
            }
        }
        object_479.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_482) = &input.resource_arn {
        object.key("ResourceArn").string(var_482);
    }
    if let Some(var_483) = &input.tag_keys {
        let mut array_484 = object.key("TagKeys").start_array();
        for item_485 in var_483 {
            {
                array_484.value().string(item_485);
            }
        }
        array_484.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_auth_event_feedback_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateAuthEventFeedbackInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_486) = &input.user_pool_id {
        object.key("UserPoolId").string(var_486);
    }
    if let Some(var_487) = &input.username {
        object.key("Username").string(var_487);
    }
    if let Some(var_488) = &input.event_id {
        object.key("EventId").string(var_488);
    }
    if let Some(var_489) = &input.feedback_token {
        object.key("FeedbackToken").string(var_489);
    }
    if let Some(var_490) = &input.feedback_value {
        object.key("FeedbackValue").string(var_490.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_device_status_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateDeviceStatusInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_491) = &input.access_token {
        object.key("AccessToken").string(var_491);
    }
    if let Some(var_492) = &input.device_key {
        object.key("DeviceKey").string(var_492);
    }
    if let Some(var_493) = &input.device_remembered_status {
        object
            .key("DeviceRememberedStatus")
            .string(var_493.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGroupInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_494) = &input.group_name {
        object.key("GroupName").string(var_494);
    }
    if let Some(var_495) = &input.user_pool_id {
        object.key("UserPoolId").string(var_495);
    }
    if let Some(var_496) = &input.description {
        object.key("Description").string(var_496);
    }
    if let Some(var_497) = &input.role_arn {
        object.key("RoleArn").string(var_497);
    }
    if let Some(var_498) = &input.precedence {
        object.key("Precedence").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_498).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_identity_provider_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateIdentityProviderInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_499) = &input.user_pool_id {
        object.key("UserPoolId").string(var_499);
    }
    if let Some(var_500) = &input.provider_name {
        object.key("ProviderName").string(var_500);
    }
    if let Some(var_501) = &input.provider_details {
        let mut object_502 = object.key("ProviderDetails").start_object();
        for (key_503, value_504) in var_501 {
            {
                object_502.key(key_503).string(value_504);
            }
        }
        object_502.finish();
    }
    if let Some(var_505) = &input.attribute_mapping {
        let mut object_506 = object.key("AttributeMapping").start_object();
        for (key_507, value_508) in var_505 {
            {
                object_506.key(key_507).string(value_508);
            }
        }
        object_506.finish();
    }
    if let Some(var_509) = &input.idp_identifiers {
        let mut array_510 = object.key("IdpIdentifiers").start_array();
        for item_511 in var_509 {
            {
                array_510.value().string(item_511);
            }
        }
        array_510.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_resource_server_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateResourceServerInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_512) = &input.user_pool_id {
        object.key("UserPoolId").string(var_512);
    }
    if let Some(var_513) = &input.identifier {
        object.key("Identifier").string(var_513);
    }
    if let Some(var_514) = &input.name {
        object.key("Name").string(var_514);
    }
    if let Some(var_515) = &input.scopes {
        let mut array_516 = object.key("Scopes").start_array();
        for item_517 in var_515 {
            {
                let mut object_518 = array_516.value().start_object();
                crate::json_ser::serialize_structure_crate_model_resource_server_scope_type(
                    &mut object_518,
                    item_517,
                )?;
                object_518.finish();
            }
        }
        array_516.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_user_attributes_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateUserAttributesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_519) = &input.user_attributes {
        let mut array_520 = object.key("UserAttributes").start_array();
        for item_521 in var_519 {
            {
                let mut object_522 = array_520.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_type(
                    &mut object_522,
                    item_521,
                )?;
                object_522.finish();
            }
        }
        array_520.finish();
    }
    if let Some(var_523) = &input.access_token {
        object.key("AccessToken").string(var_523);
    }
    if let Some(var_524) = &input.client_metadata {
        let mut object_525 = object.key("ClientMetadata").start_object();
        for (key_526, value_527) in var_524 {
            {
                object_525.key(key_526).string(value_527);
            }
        }
        object_525.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_user_pool_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateUserPoolInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_528) = &input.user_pool_id {
        object.key("UserPoolId").string(var_528);
    }
    if let Some(var_529) = &input.policies {
        let mut object_530 = object.key("Policies").start_object();
        crate::json_ser::serialize_structure_crate_model_user_pool_policy_type(
            &mut object_530,
            var_529,
        )?;
        object_530.finish();
    }
    if let Some(var_531) = &input.lambda_config {
        let mut object_532 = object.key("LambdaConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_lambda_config_type(
            &mut object_532,
            var_531,
        )?;
        object_532.finish();
    }
    if let Some(var_533) = &input.auto_verified_attributes {
        let mut array_534 = object.key("AutoVerifiedAttributes").start_array();
        for item_535 in var_533 {
            {
                array_534.value().string(item_535.as_str());
            }
        }
        array_534.finish();
    }
    if let Some(var_536) = &input.sms_verification_message {
        object.key("SmsVerificationMessage").string(var_536);
    }
    if let Some(var_537) = &input.email_verification_message {
        object.key("EmailVerificationMessage").string(var_537);
    }
    if let Some(var_538) = &input.email_verification_subject {
        object.key("EmailVerificationSubject").string(var_538);
    }
    if let Some(var_539) = &input.verification_message_template {
        let mut object_540 = object.key("VerificationMessageTemplate").start_object();
        crate::json_ser::serialize_structure_crate_model_verification_message_template_type(
            &mut object_540,
            var_539,
        )?;
        object_540.finish();
    }
    if let Some(var_541) = &input.sms_authentication_message {
        object.key("SmsAuthenticationMessage").string(var_541);
    }
    if let Some(var_542) = &input.mfa_configuration {
        object.key("MfaConfiguration").string(var_542.as_str());
    }
    if let Some(var_543) = &input.device_configuration {
        let mut object_544 = object.key("DeviceConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_device_configuration_type(
            &mut object_544,
            var_543,
        )?;
        object_544.finish();
    }
    if let Some(var_545) = &input.email_configuration {
        let mut object_546 = object.key("EmailConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_email_configuration_type(
            &mut object_546,
            var_545,
        )?;
        object_546.finish();
    }
    if let Some(var_547) = &input.sms_configuration {
        let mut object_548 = object.key("SmsConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_sms_configuration_type(
            &mut object_548,
            var_547,
        )?;
        object_548.finish();
    }
    if let Some(var_549) = &input.user_pool_tags {
        let mut object_550 = object.key("UserPoolTags").start_object();
        for (key_551, value_552) in var_549 {
            {
                object_550.key(key_551).string(value_552);
            }
        }
        object_550.finish();
    }
    if let Some(var_553) = &input.admin_create_user_config {
        let mut object_554 = object.key("AdminCreateUserConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_admin_create_user_config_type(
            &mut object_554,
            var_553,
        )?;
        object_554.finish();
    }
    if let Some(var_555) = &input.user_pool_add_ons {
        let mut object_556 = object.key("UserPoolAddOns").start_object();
        crate::json_ser::serialize_structure_crate_model_user_pool_add_ons_type(
            &mut object_556,
            var_555,
        )?;
        object_556.finish();
    }
    if let Some(var_557) = &input.account_recovery_setting {
        let mut object_558 = object.key("AccountRecoverySetting").start_object();
        crate::json_ser::serialize_structure_crate_model_account_recovery_setting_type(
            &mut object_558,
            var_557,
        )?;
        object_558.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_user_pool_client_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateUserPoolClientInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_559) = &input.user_pool_id {
        object.key("UserPoolId").string(var_559);
    }
    if let Some(var_560) = &input.client_id {
        object.key("ClientId").string(var_560);
    }
    if let Some(var_561) = &input.client_name {
        object.key("ClientName").string(var_561);
    }
    if input.refresh_token_validity != 0 {
        object.key("RefreshTokenValidity").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.refresh_token_validity).into()),
        );
    }
    if let Some(var_562) = &input.access_token_validity {
        object.key("AccessTokenValidity").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_562).into()),
        );
    }
    if let Some(var_563) = &input.id_token_validity {
        object.key("IdTokenValidity").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_563).into()),
        );
    }
    if let Some(var_564) = &input.token_validity_units {
        let mut object_565 = object.key("TokenValidityUnits").start_object();
        crate::json_ser::serialize_structure_crate_model_token_validity_units_type(
            &mut object_565,
            var_564,
        )?;
        object_565.finish();
    }
    if let Some(var_566) = &input.read_attributes {
        let mut array_567 = object.key("ReadAttributes").start_array();
        for item_568 in var_566 {
            {
                array_567.value().string(item_568);
            }
        }
        array_567.finish();
    }
    if let Some(var_569) = &input.write_attributes {
        let mut array_570 = object.key("WriteAttributes").start_array();
        for item_571 in var_569 {
            {
                array_570.value().string(item_571);
            }
        }
        array_570.finish();
    }
    if let Some(var_572) = &input.explicit_auth_flows {
        let mut array_573 = object.key("ExplicitAuthFlows").start_array();
        for item_574 in var_572 {
            {
                array_573.value().string(item_574.as_str());
            }
        }
        array_573.finish();
    }
    if let Some(var_575) = &input.supported_identity_providers {
        let mut array_576 = object.key("SupportedIdentityProviders").start_array();
        for item_577 in var_575 {
            {
                array_576.value().string(item_577);
            }
        }
        array_576.finish();
    }
    if let Some(var_578) = &input.callback_ur_ls {
        let mut array_579 = object.key("CallbackURLs").start_array();
        for item_580 in var_578 {
            {
                array_579.value().string(item_580);
            }
        }
        array_579.finish();
    }
    if let Some(var_581) = &input.logout_ur_ls {
        let mut array_582 = object.key("LogoutURLs").start_array();
        for item_583 in var_581 {
            {
                array_582.value().string(item_583);
            }
        }
        array_582.finish();
    }
    if let Some(var_584) = &input.default_redirect_uri {
        object.key("DefaultRedirectURI").string(var_584);
    }
    if let Some(var_585) = &input.allowed_o_auth_flows {
        let mut array_586 = object.key("AllowedOAuthFlows").start_array();
        for item_587 in var_585 {
            {
                array_586.value().string(item_587.as_str());
            }
        }
        array_586.finish();
    }
    if let Some(var_588) = &input.allowed_o_auth_scopes {
        let mut array_589 = object.key("AllowedOAuthScopes").start_array();
        for item_590 in var_588 {
            {
                array_589.value().string(item_590);
            }
        }
        array_589.finish();
    }
    if input.allowed_o_auth_flows_user_pool_client {
        object
            .key("AllowedOAuthFlowsUserPoolClient")
            .boolean(input.allowed_o_auth_flows_user_pool_client);
    }
    if let Some(var_591) = &input.analytics_configuration {
        let mut object_592 = object.key("AnalyticsConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_analytics_configuration_type(
            &mut object_592,
            var_591,
        )?;
        object_592.finish();
    }
    if let Some(var_593) = &input.prevent_user_existence_errors {
        object
            .key("PreventUserExistenceErrors")
            .string(var_593.as_str());
    }
    if let Some(var_594) = &input.enable_token_revocation {
        object.key("EnableTokenRevocation").boolean(*var_594);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_user_pool_domain_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateUserPoolDomainInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_595) = &input.domain {
        object.key("Domain").string(var_595);
    }
    if let Some(var_596) = &input.user_pool_id {
        object.key("UserPoolId").string(var_596);
    }
    if let Some(var_597) = &input.custom_domain_config {
        let mut object_598 = object.key("CustomDomainConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_custom_domain_config_type(
            &mut object_598,
            var_597,
        )?;
        object_598.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_verify_software_token_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::VerifySoftwareTokenInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_599) = &input.access_token {
        object.key("AccessToken").string(var_599);
    }
    if let Some(var_600) = &input.session {
        object.key("Session").string(var_600);
    }
    if let Some(var_601) = &input.user_code {
        object.key("UserCode").string(var_601);
    }
    if let Some(var_602) = &input.friendly_device_name {
        object.key("FriendlyDeviceName").string(var_602);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_verify_user_attribute_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::VerifyUserAttributeInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_603) = &input.access_token {
        object.key("AccessToken").string(var_603);
    }
    if let Some(var_604) = &input.attribute_name {
        object.key("AttributeName").string(var_604);
    }
    if let Some(var_605) = &input.code {
        object.key("Code").string(var_605);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_schema_attribute_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SchemaAttributeType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_606) = &input.name {
        object.key("Name").string(var_606);
    }
    if let Some(var_607) = &input.attribute_data_type {
        object.key("AttributeDataType").string(var_607.as_str());
    }
    if let Some(var_608) = &input.developer_only_attribute {
        object.key("DeveloperOnlyAttribute").boolean(*var_608);
    }
    if let Some(var_609) = &input.mutable {
        object.key("Mutable").boolean(*var_609);
    }
    if let Some(var_610) = &input.required {
        object.key("Required").boolean(*var_610);
    }
    if let Some(var_611) = &input.number_attribute_constraints {
        let mut object_612 = object.key("NumberAttributeConstraints").start_object();
        crate::json_ser::serialize_structure_crate_model_number_attribute_constraints_type(
            &mut object_612,
            var_611,
        )?;
        object_612.finish();
    }
    if let Some(var_613) = &input.string_attribute_constraints {
        let mut object_614 = object.key("StringAttributeConstraints").start_object();
        crate::json_ser::serialize_structure_crate_model_string_attribute_constraints_type(
            &mut object_614,
            var_613,
        )?;
        object_614.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_attribute_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AttributeType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_615) = &input.name {
        object.key("Name").string(var_615);
    }
    if let Some(var_616) = &input.value {
        object.key("Value").string(var_616);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_provider_user_identifier_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ProviderUserIdentifierType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_617) = &input.provider_name {
        object.key("ProviderName").string(var_617);
    }
    if let Some(var_618) = &input.provider_attribute_name {
        object.key("ProviderAttributeName").string(var_618);
    }
    if let Some(var_619) = &input.provider_attribute_value {
        object.key("ProviderAttributeValue").string(var_619);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_analytics_metadata_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AnalyticsMetadataType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_620) = &input.analytics_endpoint_id {
        object.key("AnalyticsEndpointId").string(var_620);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_context_data_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ContextDataType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_621) = &input.ip_address {
        object.key("IpAddress").string(var_621);
    }
    if let Some(var_622) = &input.server_name {
        object.key("ServerName").string(var_622);
    }
    if let Some(var_623) = &input.server_path {
        object.key("ServerPath").string(var_623);
    }
    if let Some(var_624) = &input.http_headers {
        let mut array_625 = object.key("HttpHeaders").start_array();
        for item_626 in var_624 {
            {
                let mut object_627 = array_625.value().start_object();
                crate::json_ser::serialize_structure_crate_model_http_header(
                    &mut object_627,
                    item_626,
                )?;
                object_627.finish();
            }
        }
        array_625.finish();
    }
    if let Some(var_628) = &input.encoded_data {
        object.key("EncodedData").string(var_628);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_sms_mfa_settings_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SmsMfaSettingsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.enabled {
        object.key("Enabled").boolean(input.enabled);
    }
    if input.preferred_mfa {
        object.key("PreferredMfa").boolean(input.preferred_mfa);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_software_token_mfa_settings_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SoftwareTokenMfaSettingsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.enabled {
        object.key("Enabled").boolean(input.enabled);
    }
    if input.preferred_mfa {
        object.key("PreferredMfa").boolean(input.preferred_mfa);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_mfa_option_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::MfaOptionType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_629) = &input.delivery_medium {
        object.key("DeliveryMedium").string(var_629.as_str());
    }
    if let Some(var_630) = &input.attribute_name {
        object.key("AttributeName").string(var_630);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_device_secret_verifier_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DeviceSecretVerifierConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_631) = &input.password_verifier {
        object.key("PasswordVerifier").string(var_631);
    }
    if let Some(var_632) = &input.salt {
        object.key("Salt").string(var_632);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_user_context_data_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UserContextDataType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_633) = &input.encoded_data {
        object.key("EncodedData").string(var_633);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_resource_server_scope_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ResourceServerScopeType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_634) = &input.scope_name {
        object.key("ScopeName").string(var_634);
    }
    if let Some(var_635) = &input.scope_description {
        object.key("ScopeDescription").string(var_635);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_user_pool_policy_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UserPoolPolicyType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_636) = &input.password_policy {
        let mut object_637 = object.key("PasswordPolicy").start_object();
        crate::json_ser::serialize_structure_crate_model_password_policy_type(
            &mut object_637,
            var_636,
        )?;
        object_637.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_lambda_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::LambdaConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_638) = &input.pre_sign_up {
        object.key("PreSignUp").string(var_638);
    }
    if let Some(var_639) = &input.custom_message {
        object.key("CustomMessage").string(var_639);
    }
    if let Some(var_640) = &input.post_confirmation {
        object.key("PostConfirmation").string(var_640);
    }
    if let Some(var_641) = &input.pre_authentication {
        object.key("PreAuthentication").string(var_641);
    }
    if let Some(var_642) = &input.post_authentication {
        object.key("PostAuthentication").string(var_642);
    }
    if let Some(var_643) = &input.define_auth_challenge {
        object.key("DefineAuthChallenge").string(var_643);
    }
    if let Some(var_644) = &input.create_auth_challenge {
        object.key("CreateAuthChallenge").string(var_644);
    }
    if let Some(var_645) = &input.verify_auth_challenge_response {
        object.key("VerifyAuthChallengeResponse").string(var_645);
    }
    if let Some(var_646) = &input.pre_token_generation {
        object.key("PreTokenGeneration").string(var_646);
    }
    if let Some(var_647) = &input.user_migration {
        object.key("UserMigration").string(var_647);
    }
    if let Some(var_648) = &input.custom_sms_sender {
        let mut object_649 = object.key("CustomSMSSender").start_object();
        crate::json_ser::serialize_structure_crate_model_custom_sms_lambda_version_config_type(
            &mut object_649,
            var_648,
        )?;
        object_649.finish();
    }
    if let Some(var_650) = &input.custom_email_sender {
        let mut object_651 = object.key("CustomEmailSender").start_object();
        crate::json_ser::serialize_structure_crate_model_custom_email_lambda_version_config_type(
            &mut object_651,
            var_650,
        )?;
        object_651.finish();
    }
    if let Some(var_652) = &input.kms_key_id {
        object.key("KMSKeyID").string(var_652);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_verification_message_template_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::VerificationMessageTemplateType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_653) = &input.sms_message {
        object.key("SmsMessage").string(var_653);
    }
    if let Some(var_654) = &input.email_message {
        object.key("EmailMessage").string(var_654);
    }
    if let Some(var_655) = &input.email_subject {
        object.key("EmailSubject").string(var_655);
    }
    if let Some(var_656) = &input.email_message_by_link {
        object.key("EmailMessageByLink").string(var_656);
    }
    if let Some(var_657) = &input.email_subject_by_link {
        object.key("EmailSubjectByLink").string(var_657);
    }
    if let Some(var_658) = &input.default_email_option {
        object.key("DefaultEmailOption").string(var_658.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_device_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DeviceConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.challenge_required_on_new_device {
        object
            .key("ChallengeRequiredOnNewDevice")
            .boolean(input.challenge_required_on_new_device);
    }
    if input.device_only_remembered_on_user_prompt {
        object
            .key("DeviceOnlyRememberedOnUserPrompt")
            .boolean(input.device_only_remembered_on_user_prompt);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_email_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::EmailConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_659) = &input.source_arn {
        object.key("SourceArn").string(var_659);
    }
    if let Some(var_660) = &input.reply_to_email_address {
        object.key("ReplyToEmailAddress").string(var_660);
    }
    if let Some(var_661) = &input.email_sending_account {
        object.key("EmailSendingAccount").string(var_661.as_str());
    }
    if let Some(var_662) = &input.from {
        object.key("From").string(var_662);
    }
    if let Some(var_663) = &input.configuration_set {
        object.key("ConfigurationSet").string(var_663);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_sms_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SmsConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_664) = &input.sns_caller_arn {
        object.key("SnsCallerArn").string(var_664);
    }
    if let Some(var_665) = &input.external_id {
        object.key("ExternalId").string(var_665);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_admin_create_user_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AdminCreateUserConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.allow_admin_create_user_only {
        object
            .key("AllowAdminCreateUserOnly")
            .boolean(input.allow_admin_create_user_only);
    }
    if input.unused_account_validity_days != 0 {
        object.key("UnusedAccountValidityDays").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.unused_account_validity_days).into()),
        );
    }
    if let Some(var_666) = &input.invite_message_template {
        let mut object_667 = object.key("InviteMessageTemplate").start_object();
        crate::json_ser::serialize_structure_crate_model_message_template_type(
            &mut object_667,
            var_666,
        )?;
        object_667.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_user_pool_add_ons_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UserPoolAddOnsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_668) = &input.advanced_security_mode {
        object.key("AdvancedSecurityMode").string(var_668.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_username_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UsernameConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_669) = &input.case_sensitive {
        object.key("CaseSensitive").boolean(*var_669);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_account_recovery_setting_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AccountRecoverySettingType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_670) = &input.recovery_mechanisms {
        let mut array_671 = object.key("RecoveryMechanisms").start_array();
        for item_672 in var_670 {
            {
                let mut object_673 = array_671.value().start_object();
                crate::json_ser::serialize_structure_crate_model_recovery_option_type(
                    &mut object_673,
                    item_672,
                )?;
                object_673.finish();
            }
        }
        array_671.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_token_validity_units_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::TokenValidityUnitsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_674) = &input.access_token {
        object.key("AccessToken").string(var_674.as_str());
    }
    if let Some(var_675) = &input.id_token {
        object.key("IdToken").string(var_675.as_str());
    }
    if let Some(var_676) = &input.refresh_token {
        object.key("RefreshToken").string(var_676.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_analytics_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AnalyticsConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_677) = &input.application_id {
        object.key("ApplicationId").string(var_677);
    }
    if let Some(var_678) = &input.application_arn {
        object.key("ApplicationArn").string(var_678);
    }
    if let Some(var_679) = &input.role_arn {
        object.key("RoleArn").string(var_679);
    }
    if let Some(var_680) = &input.external_id {
        object.key("ExternalId").string(var_680);
    }
    if input.user_data_shared {
        object.key("UserDataShared").boolean(input.user_data_shared);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_custom_domain_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CustomDomainConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_681) = &input.certificate_arn {
        object.key("CertificateArn").string(var_681);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_compromised_credentials_risk_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CompromisedCredentialsRiskConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_682) = &input.event_filter {
        let mut array_683 = object.key("EventFilter").start_array();
        for item_684 in var_682 {
            {
                array_683.value().string(item_684.as_str());
            }
        }
        array_683.finish();
    }
    if let Some(var_685) = &input.actions {
        let mut object_686 = object.key("Actions").start_object();
        crate::json_ser::serialize_structure_crate_model_compromised_credentials_actions_type(
            &mut object_686,
            var_685,
        )?;
        object_686.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_account_takeover_risk_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AccountTakeoverRiskConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_687) = &input.notify_configuration {
        let mut object_688 = object.key("NotifyConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_notify_configuration_type(
            &mut object_688,
            var_687,
        )?;
        object_688.finish();
    }
    if let Some(var_689) = &input.actions {
        let mut object_690 = object.key("Actions").start_object();
        crate::json_ser::serialize_structure_crate_model_account_takeover_actions_type(
            &mut object_690,
            var_689,
        )?;
        object_690.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_risk_exception_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RiskExceptionConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_691) = &input.blocked_ip_range_list {
        let mut array_692 = object.key("BlockedIPRangeList").start_array();
        for item_693 in var_691 {
            {
                array_692.value().string(item_693);
            }
        }
        array_692.finish();
    }
    if let Some(var_694) = &input.skipped_ip_range_list {
        let mut array_695 = object.key("SkippedIPRangeList").start_array();
        for item_696 in var_694 {
            {
                array_695.value().string(item_696);
            }
        }
        array_695.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_sms_mfa_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SmsMfaConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_697) = &input.sms_authentication_message {
        object.key("SmsAuthenticationMessage").string(var_697);
    }
    if let Some(var_698) = &input.sms_configuration {
        let mut object_699 = object.key("SmsConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_sms_configuration_type(
            &mut object_699,
            var_698,
        )?;
        object_699.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_software_token_mfa_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SoftwareTokenMfaConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.enabled {
        object.key("Enabled").boolean(input.enabled);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_number_attribute_constraints_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NumberAttributeConstraintsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_700) = &input.min_value {
        object.key("MinValue").string(var_700);
    }
    if let Some(var_701) = &input.max_value {
        object.key("MaxValue").string(var_701);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_string_attribute_constraints_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::StringAttributeConstraintsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_702) = &input.min_length {
        object.key("MinLength").string(var_702);
    }
    if let Some(var_703) = &input.max_length {
        object.key("MaxLength").string(var_703);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_http_header(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::HttpHeader,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_704) = &input.header_name {
        object.key("headerName").string(var_704);
    }
    if let Some(var_705) = &input.header_value {
        object.key("headerValue").string(var_705);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_password_policy_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::PasswordPolicyType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.minimum_length != 0 {
        object.key("MinimumLength").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.minimum_length).into()),
        );
    }
    if input.require_uppercase {
        object
            .key("RequireUppercase")
            .boolean(input.require_uppercase);
    }
    if input.require_lowercase {
        object
            .key("RequireLowercase")
            .boolean(input.require_lowercase);
    }
    if input.require_numbers {
        object.key("RequireNumbers").boolean(input.require_numbers);
    }
    if input.require_symbols {
        object.key("RequireSymbols").boolean(input.require_symbols);
    }
    if input.temporary_password_validity_days != 0 {
        object.key("TemporaryPasswordValidityDays").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.temporary_password_validity_days).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_custom_sms_lambda_version_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CustomSmsLambdaVersionConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_706) = &input.lambda_version {
        object.key("LambdaVersion").string(var_706.as_str());
    }
    if let Some(var_707) = &input.lambda_arn {
        object.key("LambdaArn").string(var_707);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_custom_email_lambda_version_config_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CustomEmailLambdaVersionConfigType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_708) = &input.lambda_version {
        object.key("LambdaVersion").string(var_708.as_str());
    }
    if let Some(var_709) = &input.lambda_arn {
        object.key("LambdaArn").string(var_709);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_message_template_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::MessageTemplateType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_710) = &input.sms_message {
        object.key("SMSMessage").string(var_710);
    }
    if let Some(var_711) = &input.email_message {
        object.key("EmailMessage").string(var_711);
    }
    if let Some(var_712) = &input.email_subject {
        object.key("EmailSubject").string(var_712);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_recovery_option_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RecoveryOptionType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    {
        object.key("Priority").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.priority).into()),
        );
    }
    if let Some(var_713) = &input.name {
        object.key("Name").string(var_713.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_compromised_credentials_actions_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CompromisedCredentialsActionsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_714) = &input.event_action {
        object.key("EventAction").string(var_714.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_notify_configuration_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NotifyConfigurationType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_715) = &input.from {
        object.key("From").string(var_715);
    }
    if let Some(var_716) = &input.reply_to {
        object.key("ReplyTo").string(var_716);
    }
    if let Some(var_717) = &input.source_arn {
        object.key("SourceArn").string(var_717);
    }
    if let Some(var_718) = &input.block_email {
        let mut object_719 = object.key("BlockEmail").start_object();
        crate::json_ser::serialize_structure_crate_model_notify_email_type(
            &mut object_719,
            var_718,
        )?;
        object_719.finish();
    }
    if let Some(var_720) = &input.no_action_email {
        let mut object_721 = object.key("NoActionEmail").start_object();
        crate::json_ser::serialize_structure_crate_model_notify_email_type(
            &mut object_721,
            var_720,
        )?;
        object_721.finish();
    }
    if let Some(var_722) = &input.mfa_email {
        let mut object_723 = object.key("MfaEmail").start_object();
        crate::json_ser::serialize_structure_crate_model_notify_email_type(
            &mut object_723,
            var_722,
        )?;
        object_723.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_account_takeover_actions_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AccountTakeoverActionsType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_724) = &input.low_action {
        let mut object_725 = object.key("LowAction").start_object();
        crate::json_ser::serialize_structure_crate_model_account_takeover_action_type(
            &mut object_725,
            var_724,
        )?;
        object_725.finish();
    }
    if let Some(var_726) = &input.medium_action {
        let mut object_727 = object.key("MediumAction").start_object();
        crate::json_ser::serialize_structure_crate_model_account_takeover_action_type(
            &mut object_727,
            var_726,
        )?;
        object_727.finish();
    }
    if let Some(var_728) = &input.high_action {
        let mut object_729 = object.key("HighAction").start_object();
        crate::json_ser::serialize_structure_crate_model_account_takeover_action_type(
            &mut object_729,
            var_728,
        )?;
        object_729.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_notify_email_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NotifyEmailType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_730) = &input.subject {
        object.key("Subject").string(var_730);
    }
    if let Some(var_731) = &input.html_body {
        object.key("HtmlBody").string(var_731);
    }
    if let Some(var_732) = &input.text_body {
        object.key("TextBody").string(var_732);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_account_takeover_action_type(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AccountTakeoverActionType,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    {
        object.key("Notify").boolean(input.notify);
    }
    if let Some(var_733) = &input.event_action {
        object.key("EventAction").string(var_733.as_str());
    }
    Ok(())
}
