aws-sdk-s3 0.24.0

AWS SDK for Amazon Simple Storage Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_member_com_amazonaws_s3_synthetic_complete_multipart_upload_input_multipart_upload(
    input: &crate::model::CompletedMultipartUpload,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("CompleteMultipartUpload")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_completed_multipart_upload(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_create_bucket_input_create_bucket_configuration(
    input: &crate::model::CreateBucketConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("CreateBucketConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_create_bucket_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_delete_objects_input_delete(
    input: &crate::model::Delete,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("Delete")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_delete(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_accelerate_configuration_input_accelerate_configuration(
    input: &crate::model::AccelerateConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("AccelerateConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_accelerate_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_acl_input_access_control_policy(
    input: &crate::model::AccessControlPolicy,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("AccessControlPolicy")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_access_control_policy(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_analytics_configuration_input_analytics_configuration(
    input: &crate::model::AnalyticsConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("AnalyticsConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_analytics_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_cors_input_cors_configuration(
    input: &crate::model::CorsConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("CORSConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_cors_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_encryption_input_server_side_encryption_configuration(
    input: &crate::model::ServerSideEncryptionConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("ServerSideEncryptionConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_server_side_encryption_configuration(
            input, root,
        )?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_intelligent_tiering_configuration_input_intelligent_tiering_configuration(
    input: &crate::model::IntelligentTieringConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("IntelligentTieringConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_intelligent_tiering_configuration(
            input, root,
        )?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_inventory_configuration_input_inventory_configuration(
    input: &crate::model::InventoryConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("InventoryConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_inventory_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_lifecycle_configuration_input_lifecycle_configuration(
    input: &crate::model::BucketLifecycleConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("LifecycleConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_bucket_lifecycle_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_logging_input_bucket_logging_status(
    input: &crate::model::BucketLoggingStatus,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("BucketLoggingStatus")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_bucket_logging_status(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_metrics_configuration_input_metrics_configuration(
    input: &crate::model::MetricsConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("MetricsConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_metrics_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_notification_configuration_input_notification_configuration(
    input: &crate::model::NotificationConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("NotificationConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_notification_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_ownership_controls_input_ownership_controls(
    input: &crate::model::OwnershipControls,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("OwnershipControls")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_ownership_controls(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_replication_input_replication_configuration(
    input: &crate::model::ReplicationConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("ReplicationConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_replication_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_request_payment_input_request_payment_configuration(
    input: &crate::model::RequestPaymentConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("RequestPaymentConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_request_payment_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_tagging_input_tagging(
    input: &crate::model::Tagging,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("Tagging")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_tagging(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_versioning_input_versioning_configuration(
    input: &crate::model::VersioningConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("VersioningConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_versioning_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_bucket_website_input_website_configuration(
    input: &crate::model::WebsiteConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("WebsiteConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_website_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_object_acl_input_access_control_policy(
    input: &crate::model::AccessControlPolicy,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("AccessControlPolicy")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_access_control_policy(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_object_legal_hold_input_legal_hold(
    input: &crate::model::ObjectLockLegalHold,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("LegalHold")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_object_lock_legal_hold(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_object_lock_configuration_input_object_lock_configuration(
    input: &crate::model::ObjectLockConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("ObjectLockConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_object_lock_configuration(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_object_retention_input_retention(
    input: &crate::model::ObjectLockRetention,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("Retention")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_object_lock_retention(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_object_tagging_input_tagging(
    input: &crate::model::Tagging,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("Tagging")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_tagging(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_put_public_access_block_input_public_access_block_configuration(
    input: &crate::model::PublicAccessBlockConfiguration,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("PublicAccessBlockConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_public_access_block_configuration(
            input, root,
        )?
    }
    Ok(out.into_bytes())
}

pub fn serialize_member_com_amazonaws_s3_synthetic_restore_object_input_restore_request(
    input: &crate::model::RestoreRequest,
) -> std::result::Result<std::vec::Vec<u8>, aws_smithy_http::operation::error::SerializationError> {
    let mut out = String::new();
    {
        let mut writer = aws_smithy_xml::encode::XmlWriter::new(&mut out);
        #[allow(unused_mut)]
        let mut root = writer
            .start_el("RestoreRequest")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_crate_model_restore_request(input, root)?
    }
    Ok(out.into_bytes())
}

pub fn serialize_structure_crate_input_select_object_content_input(
    input: &crate::input::SelectObjectContentInput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_1) = &input.expression {
        let mut inner_writer = scope.start_el("Expression").finish();
        inner_writer.data(var_1.as_str());
    }
    if let Some(var_2) = &input.expression_type {
        let mut inner_writer = scope.start_el("ExpressionType").finish();
        inner_writer.data(var_2.as_str());
    }
    if let Some(var_3) = &input.input_serialization {
        let inner_writer = scope.start_el("InputSerialization");
        crate::xml_ser::serialize_structure_crate_model_input_serialization(var_3, inner_writer)?
    }
    if let Some(var_4) = &input.output_serialization {
        let inner_writer = scope.start_el("OutputSerialization");
        crate::xml_ser::serialize_structure_crate_model_output_serialization(var_4, inner_writer)?
    }
    if let Some(var_5) = &input.request_progress {
        let inner_writer = scope.start_el("RequestProgress");
        crate::xml_ser::serialize_structure_crate_model_request_progress(var_5, inner_writer)?
    }
    if let Some(var_6) = &input.scan_range {
        let inner_writer = scope.start_el("ScanRange");
        crate::xml_ser::serialize_structure_crate_model_scan_range(var_6, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_completed_multipart_upload(
    input: &crate::model::CompletedMultipartUpload,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_7) = &input.parts {
        for list_item_8 in var_7 {
            {
                let inner_writer = scope.start_el("Part");
                crate::xml_ser::serialize_structure_crate_model_completed_part(
                    list_item_8,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_create_bucket_configuration(
    input: &crate::model::CreateBucketConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_9) = &input.location_constraint {
        let mut inner_writer = scope.start_el("LocationConstraint").finish();
        inner_writer.data(var_9.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_delete(
    input: &crate::model::Delete,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_10) = &input.objects {
        for list_item_11 in var_10 {
            {
                let inner_writer = scope.start_el("Object");
                crate::xml_ser::serialize_structure_crate_model_object_identifier(
                    list_item_11,
                    inner_writer,
                )?
            }
        }
    }
    if input.quiet {
        let mut inner_writer = scope.start_el("Quiet").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.quiet).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_accelerate_configuration(
    input: &crate::model::AccelerateConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_12) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_12.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_access_control_policy(
    input: &crate::model::AccessControlPolicy,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_13) = &input.grants {
        let mut inner_writer = scope.start_el("AccessControlList").finish();
        for list_item_14 in var_13 {
            {
                let inner_writer = inner_writer.start_el("Grant");
                crate::xml_ser::serialize_structure_crate_model_grant(list_item_14, inner_writer)?
            }
        }
    }
    if let Some(var_15) = &input.owner {
        let inner_writer = scope.start_el("Owner");
        crate::xml_ser::serialize_structure_crate_model_owner(var_15, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_analytics_configuration(
    input: &crate::model::AnalyticsConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_16) = &input.id {
        let mut inner_writer = scope.start_el("Id").finish();
        inner_writer.data(var_16.as_str());
    }
    if let Some(var_17) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_union_crate_model_analytics_filter(var_17, inner_writer)?
    }
    if let Some(var_18) = &input.storage_class_analysis {
        let inner_writer = scope.start_el("StorageClassAnalysis");
        crate::xml_ser::serialize_structure_crate_model_storage_class_analysis(
            var_18,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_cors_configuration(
    input: &crate::model::CorsConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_19) = &input.cors_rules {
        for list_item_20 in var_19 {
            {
                let inner_writer = scope.start_el("CORSRule");
                crate::xml_ser::serialize_structure_crate_model_cors_rule(
                    list_item_20,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_server_side_encryption_configuration(
    input: &crate::model::ServerSideEncryptionConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_21) = &input.rules {
        for list_item_22 in var_21 {
            {
                let inner_writer = scope.start_el("Rule");
                crate::xml_ser::serialize_structure_crate_model_server_side_encryption_rule(
                    list_item_22,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_intelligent_tiering_configuration(
    input: &crate::model::IntelligentTieringConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_23) = &input.id {
        let mut inner_writer = scope.start_el("Id").finish();
        inner_writer.data(var_23.as_str());
    }
    if let Some(var_24) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_structure_crate_model_intelligent_tiering_filter(
            var_24,
            inner_writer,
        )?
    }
    if let Some(var_25) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_25.as_str());
    }
    if let Some(var_26) = &input.tierings {
        for list_item_27 in var_26 {
            {
                let inner_writer = scope.start_el("Tiering");
                crate::xml_ser::serialize_structure_crate_model_tiering(list_item_27, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_inventory_configuration(
    input: &crate::model::InventoryConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_28) = &input.destination {
        let inner_writer = scope.start_el("Destination");
        crate::xml_ser::serialize_structure_crate_model_inventory_destination(var_28, inner_writer)?
    }
    {
        let mut inner_writer = scope.start_el("IsEnabled").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.is_enabled).encode());
    }
    if let Some(var_29) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_structure_crate_model_inventory_filter(var_29, inner_writer)?
    }
    if let Some(var_30) = &input.id {
        let mut inner_writer = scope.start_el("Id").finish();
        inner_writer.data(var_30.as_str());
    }
    if let Some(var_31) = &input.included_object_versions {
        let mut inner_writer = scope.start_el("IncludedObjectVersions").finish();
        inner_writer.data(var_31.as_str());
    }
    if let Some(var_32) = &input.optional_fields {
        let mut inner_writer = scope.start_el("OptionalFields").finish();
        for list_item_33 in var_32 {
            {
                let mut inner_writer = inner_writer.start_el("Field").finish();
                inner_writer.data(list_item_33.as_str());
            }
        }
    }
    if let Some(var_34) = &input.schedule {
        let inner_writer = scope.start_el("Schedule");
        crate::xml_ser::serialize_structure_crate_model_inventory_schedule(var_34, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_bucket_lifecycle_configuration(
    input: &crate::model::BucketLifecycleConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_35) = &input.rules {
        for list_item_36 in var_35 {
            {
                let inner_writer = scope.start_el("Rule");
                crate::xml_ser::serialize_structure_crate_model_lifecycle_rule(
                    list_item_36,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_bucket_logging_status(
    input: &crate::model::BucketLoggingStatus,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_37) = &input.logging_enabled {
        let inner_writer = scope.start_el("LoggingEnabled");
        crate::xml_ser::serialize_structure_crate_model_logging_enabled(var_37, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_metrics_configuration(
    input: &crate::model::MetricsConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_38) = &input.id {
        let mut inner_writer = scope.start_el("Id").finish();
        inner_writer.data(var_38.as_str());
    }
    if let Some(var_39) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_union_crate_model_metrics_filter(var_39, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_notification_configuration(
    input: &crate::model::NotificationConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_40) = &input.topic_configurations {
        for list_item_41 in var_40 {
            {
                let inner_writer = scope.start_el("TopicConfiguration");
                crate::xml_ser::serialize_structure_crate_model_topic_configuration(
                    list_item_41,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_42) = &input.queue_configurations {
        for list_item_43 in var_42 {
            {
                let inner_writer = scope.start_el("QueueConfiguration");
                crate::xml_ser::serialize_structure_crate_model_queue_configuration(
                    list_item_43,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_44) = &input.lambda_function_configurations {
        for list_item_45 in var_44 {
            {
                let inner_writer = scope.start_el("CloudFunctionConfiguration");
                crate::xml_ser::serialize_structure_crate_model_lambda_function_configuration(
                    list_item_45,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(_var_46) = &input.event_bridge_configuration {
        scope.start_el("EventBridgeConfiguration").finish();
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_ownership_controls(
    input: &crate::model::OwnershipControls,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_47) = &input.rules {
        for list_item_48 in var_47 {
            {
                let inner_writer = scope.start_el("Rule");
                crate::xml_ser::serialize_structure_crate_model_ownership_controls_rule(
                    list_item_48,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_replication_configuration(
    input: &crate::model::ReplicationConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_49) = &input.role {
        let mut inner_writer = scope.start_el("Role").finish();
        inner_writer.data(var_49.as_str());
    }
    if let Some(var_50) = &input.rules {
        for list_item_51 in var_50 {
            {
                let inner_writer = scope.start_el("Rule");
                crate::xml_ser::serialize_structure_crate_model_replication_rule(
                    list_item_51,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_request_payment_configuration(
    input: &crate::model::RequestPaymentConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_52) = &input.payer {
        let mut inner_writer = scope.start_el("Payer").finish();
        inner_writer.data(var_52.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_tagging(
    input: &crate::model::Tagging,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_53) = &input.tag_set {
        let mut inner_writer = scope.start_el("TagSet").finish();
        for list_item_54 in var_53 {
            {
                let inner_writer = inner_writer.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_54, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_versioning_configuration(
    input: &crate::model::VersioningConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_55) = &input.mfa_delete {
        let mut inner_writer = scope.start_el("MfaDelete").finish();
        inner_writer.data(var_55.as_str());
    }
    if let Some(var_56) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_56.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_website_configuration(
    input: &crate::model::WebsiteConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_57) = &input.error_document {
        let inner_writer = scope.start_el("ErrorDocument");
        crate::xml_ser::serialize_structure_crate_model_error_document(var_57, inner_writer)?
    }
    if let Some(var_58) = &input.index_document {
        let inner_writer = scope.start_el("IndexDocument");
        crate::xml_ser::serialize_structure_crate_model_index_document(var_58, inner_writer)?
    }
    if let Some(var_59) = &input.redirect_all_requests_to {
        let inner_writer = scope.start_el("RedirectAllRequestsTo");
        crate::xml_ser::serialize_structure_crate_model_redirect_all_requests_to(
            var_59,
            inner_writer,
        )?
    }
    if let Some(var_60) = &input.routing_rules {
        let mut inner_writer = scope.start_el("RoutingRules").finish();
        for list_item_61 in var_60 {
            {
                let inner_writer = inner_writer.start_el("RoutingRule");
                crate::xml_ser::serialize_structure_crate_model_routing_rule(
                    list_item_61,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_object_lock_legal_hold(
    input: &crate::model::ObjectLockLegalHold,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_62) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_62.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_object_lock_configuration(
    input: &crate::model::ObjectLockConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_63) = &input.object_lock_enabled {
        let mut inner_writer = scope.start_el("ObjectLockEnabled").finish();
        inner_writer.data(var_63.as_str());
    }
    if let Some(var_64) = &input.rule {
        let inner_writer = scope.start_el("Rule");
        crate::xml_ser::serialize_structure_crate_model_object_lock_rule(var_64, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_object_lock_retention(
    input: &crate::model::ObjectLockRetention,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_65) = &input.mode {
        let mut inner_writer = scope.start_el("Mode").finish();
        inner_writer.data(var_65.as_str());
    }
    if let Some(var_66) = &input.retain_until_date {
        let mut inner_writer = scope.start_el("RetainUntilDate").finish();
        inner_writer.data(
            var_66
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_public_access_block_configuration(
    input: &crate::model::PublicAccessBlockConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.block_public_acls {
        let mut inner_writer = scope.start_el("BlockPublicAcls").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.block_public_acls).encode());
    }
    if input.ignore_public_acls {
        let mut inner_writer = scope.start_el("IgnorePublicAcls").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.ignore_public_acls).encode());
    }
    if input.block_public_policy {
        let mut inner_writer = scope.start_el("BlockPublicPolicy").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.block_public_policy).encode());
    }
    if input.restrict_public_buckets {
        let mut inner_writer = scope.start_el("RestrictPublicBuckets").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.restrict_public_buckets).encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_restore_request(
    input: &crate::model::RestoreRequest,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.days != 0 {
        let mut inner_writer = scope.start_el("Days").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.days).encode());
    }
    if let Some(var_67) = &input.glacier_job_parameters {
        let inner_writer = scope.start_el("GlacierJobParameters");
        crate::xml_ser::serialize_structure_crate_model_glacier_job_parameters(
            var_67,
            inner_writer,
        )?
    }
    if let Some(var_68) = &input.r#type {
        let mut inner_writer = scope.start_el("Type").finish();
        inner_writer.data(var_68.as_str());
    }
    if let Some(var_69) = &input.tier {
        let mut inner_writer = scope.start_el("Tier").finish();
        inner_writer.data(var_69.as_str());
    }
    if let Some(var_70) = &input.description {
        let mut inner_writer = scope.start_el("Description").finish();
        inner_writer.data(var_70.as_str());
    }
    if let Some(var_71) = &input.select_parameters {
        let inner_writer = scope.start_el("SelectParameters");
        crate::xml_ser::serialize_structure_crate_model_select_parameters(var_71, inner_writer)?
    }
    if let Some(var_72) = &input.output_location {
        let inner_writer = scope.start_el("OutputLocation");
        crate::xml_ser::serialize_structure_crate_model_output_location(var_72, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_input_serialization(
    input: &crate::model::InputSerialization,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_73) = &input.csv {
        let inner_writer = scope.start_el("CSV");
        crate::xml_ser::serialize_structure_crate_model_csv_input(var_73, inner_writer)?
    }
    if let Some(var_74) = &input.compression_type {
        let mut inner_writer = scope.start_el("CompressionType").finish();
        inner_writer.data(var_74.as_str());
    }
    if let Some(var_75) = &input.json {
        let inner_writer = scope.start_el("JSON");
        crate::xml_ser::serialize_structure_crate_model_json_input(var_75, inner_writer)?
    }
    if let Some(_var_76) = &input.parquet {
        scope.start_el("Parquet").finish();
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_output_serialization(
    input: &crate::model::OutputSerialization,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_77) = &input.csv {
        let inner_writer = scope.start_el("CSV");
        crate::xml_ser::serialize_structure_crate_model_csv_output(var_77, inner_writer)?
    }
    if let Some(var_78) = &input.json {
        let inner_writer = scope.start_el("JSON");
        crate::xml_ser::serialize_structure_crate_model_json_output(var_78, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_request_progress(
    input: &crate::model::RequestProgress,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.enabled {
        let mut inner_writer = scope.start_el("Enabled").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.enabled).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_scan_range(
    input: &crate::model::ScanRange,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.start != 0 {
        let mut inner_writer = scope.start_el("Start").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.start).encode());
    }
    if input.end != 0 {
        let mut inner_writer = scope.start_el("End").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.end).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_completed_part(
    input: &crate::model::CompletedPart,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_79) = &input.e_tag {
        let mut inner_writer = scope.start_el("ETag").finish();
        inner_writer.data(var_79.as_str());
    }
    if let Some(var_80) = &input.checksum_crc32 {
        let mut inner_writer = scope.start_el("ChecksumCRC32").finish();
        inner_writer.data(var_80.as_str());
    }
    if let Some(var_81) = &input.checksum_crc32_c {
        let mut inner_writer = scope.start_el("ChecksumCRC32C").finish();
        inner_writer.data(var_81.as_str());
    }
    if let Some(var_82) = &input.checksum_sha1 {
        let mut inner_writer = scope.start_el("ChecksumSHA1").finish();
        inner_writer.data(var_82.as_str());
    }
    if let Some(var_83) = &input.checksum_sha256 {
        let mut inner_writer = scope.start_el("ChecksumSHA256").finish();
        inner_writer.data(var_83.as_str());
    }
    if input.part_number != 0 {
        let mut inner_writer = scope.start_el("PartNumber").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.part_number).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_object_identifier(
    input: &crate::model::ObjectIdentifier,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_84) = &input.key {
        let mut inner_writer = scope.start_el("Key").finish();
        inner_writer.data(var_84.as_str());
    }
    if let Some(var_85) = &input.version_id {
        let mut inner_writer = scope.start_el("VersionId").finish();
        inner_writer.data(var_85.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_grant(
    input: &crate::model::Grant,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_86) = &input.grantee {
        let inner_writer = scope
            .start_el("Grantee")
            .write_ns("http://www.w3.org/2001/XMLSchema-instance", Some("xsi"));
        crate::xml_ser::serialize_structure_crate_model_grantee(var_86, inner_writer)?
    }
    if let Some(var_87) = &input.permission {
        let mut inner_writer = scope.start_el("Permission").finish();
        inner_writer.data(var_87.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_owner(
    input: &crate::model::Owner,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_88) = &input.display_name {
        let mut inner_writer = scope.start_el("DisplayName").finish();
        inner_writer.data(var_88.as_str());
    }
    if let Some(var_89) = &input.id {
        let mut inner_writer = scope.start_el("ID").finish();
        inner_writer.data(var_89.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_union_crate_model_analytics_filter(
    input: &crate::model::AnalyticsFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::AnalyticsFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer.start_el("Prefix").finish();
            inner_writer.data(inner.as_str());
        }
        crate::model::AnalyticsFilter::Tag(inner) => {
            let inner_writer = scope_writer.start_el("Tag");
            crate::xml_ser::serialize_structure_crate_model_tag(inner, inner_writer)?
        }
        crate::model::AnalyticsFilter::And(inner) => {
            let inner_writer = scope_writer.start_el("And");
            crate::xml_ser::serialize_structure_crate_model_analytics_and_operator(
                inner,
                inner_writer,
            )?
        }
        crate::model::AnalyticsFilter::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "AnalyticsFilter",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_storage_class_analysis(
    input: &crate::model::StorageClassAnalysis,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_90) = &input.data_export {
        let inner_writer = scope.start_el("DataExport");
        crate::xml_ser::serialize_structure_crate_model_storage_class_analysis_data_export(
            var_90,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_cors_rule(
    input: &crate::model::CorsRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_91) = &input.id {
        let mut inner_writer = scope.start_el("ID").finish();
        inner_writer.data(var_91.as_str());
    }
    if let Some(var_92) = &input.allowed_headers {
        for list_item_93 in var_92 {
            {
                let mut inner_writer = scope.start_el("AllowedHeader").finish();
                inner_writer.data(list_item_93.as_str());
            }
        }
    }
    if let Some(var_94) = &input.allowed_methods {
        for list_item_95 in var_94 {
            {
                let mut inner_writer = scope.start_el("AllowedMethod").finish();
                inner_writer.data(list_item_95.as_str());
            }
        }
    }
    if let Some(var_96) = &input.allowed_origins {
        for list_item_97 in var_96 {
            {
                let mut inner_writer = scope.start_el("AllowedOrigin").finish();
                inner_writer.data(list_item_97.as_str());
            }
        }
    }
    if let Some(var_98) = &input.expose_headers {
        for list_item_99 in var_98 {
            {
                let mut inner_writer = scope.start_el("ExposeHeader").finish();
                inner_writer.data(list_item_99.as_str());
            }
        }
    }
    if input.max_age_seconds != 0 {
        let mut inner_writer = scope.start_el("MaxAgeSeconds").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.max_age_seconds).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_server_side_encryption_rule(
    input: &crate::model::ServerSideEncryptionRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_100) = &input.apply_server_side_encryption_by_default {
        let inner_writer = scope.start_el("ApplyServerSideEncryptionByDefault");
        crate::xml_ser::serialize_structure_crate_model_server_side_encryption_by_default(
            var_100,
            inner_writer,
        )?
    }
    if input.bucket_key_enabled {
        let mut inner_writer = scope.start_el("BucketKeyEnabled").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.bucket_key_enabled).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_intelligent_tiering_filter(
    input: &crate::model::IntelligentTieringFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_101) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_101.as_str());
    }
    if let Some(var_102) = &input.tag {
        let inner_writer = scope.start_el("Tag");
        crate::xml_ser::serialize_structure_crate_model_tag(var_102, inner_writer)?
    }
    if let Some(var_103) = &input.and {
        let inner_writer = scope.start_el("And");
        crate::xml_ser::serialize_structure_crate_model_intelligent_tiering_and_operator(
            var_103,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_tiering(
    input: &crate::model::Tiering,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope.start_el("Days").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.days).encode());
    }
    if let Some(var_104) = &input.access_tier {
        let mut inner_writer = scope.start_el("AccessTier").finish();
        inner_writer.data(var_104.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_inventory_destination(
    input: &crate::model::InventoryDestination,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_105) = &input.s3_bucket_destination {
        let inner_writer = scope.start_el("S3BucketDestination");
        crate::xml_ser::serialize_structure_crate_model_inventory_s3_bucket_destination(
            var_105,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_inventory_filter(
    input: &crate::model::InventoryFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_106) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_106.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_inventory_schedule(
    input: &crate::model::InventorySchedule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_107) = &input.frequency {
        let mut inner_writer = scope.start_el("Frequency").finish();
        inner_writer.data(var_107.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_lifecycle_rule(
    input: &crate::model::LifecycleRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_108) = &input.expiration {
        let inner_writer = scope.start_el("Expiration");
        crate::xml_ser::serialize_structure_crate_model_lifecycle_expiration(var_108, inner_writer)?
    }
    if let Some(var_109) = &input.id {
        let mut inner_writer = scope.start_el("ID").finish();
        inner_writer.data(var_109.as_str());
    }
    if let Some(var_110) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_110.as_str());
    }
    if let Some(var_111) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_union_crate_model_lifecycle_rule_filter(var_111, inner_writer)?
    }
    if let Some(var_112) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_112.as_str());
    }
    if let Some(var_113) = &input.transitions {
        for list_item_114 in var_113 {
            {
                let inner_writer = scope.start_el("Transition");
                crate::xml_ser::serialize_structure_crate_model_transition(
                    list_item_114,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_115) = &input.noncurrent_version_transitions {
        for list_item_116 in var_115 {
            {
                let inner_writer = scope.start_el("NoncurrentVersionTransition");
                crate::xml_ser::serialize_structure_crate_model_noncurrent_version_transition(
                    list_item_116,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_117) = &input.noncurrent_version_expiration {
        let inner_writer = scope.start_el("NoncurrentVersionExpiration");
        crate::xml_ser::serialize_structure_crate_model_noncurrent_version_expiration(
            var_117,
            inner_writer,
        )?
    }
    if let Some(var_118) = &input.abort_incomplete_multipart_upload {
        let inner_writer = scope.start_el("AbortIncompleteMultipartUpload");
        crate::xml_ser::serialize_structure_crate_model_abort_incomplete_multipart_upload(
            var_118,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_logging_enabled(
    input: &crate::model::LoggingEnabled,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_119) = &input.target_bucket {
        let mut inner_writer = scope.start_el("TargetBucket").finish();
        inner_writer.data(var_119.as_str());
    }
    if let Some(var_120) = &input.target_grants {
        let mut inner_writer = scope.start_el("TargetGrants").finish();
        for list_item_121 in var_120 {
            {
                let inner_writer = inner_writer.start_el("Grant");
                crate::xml_ser::serialize_structure_crate_model_target_grant(
                    list_item_121,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_122) = &input.target_prefix {
        let mut inner_writer = scope.start_el("TargetPrefix").finish();
        inner_writer.data(var_122.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_union_crate_model_metrics_filter(
    input: &crate::model::MetricsFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::MetricsFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer.start_el("Prefix").finish();
            inner_writer.data(inner.as_str());
        }
        crate::model::MetricsFilter::Tag(inner) => {
            let inner_writer = scope_writer.start_el("Tag");
            crate::xml_ser::serialize_structure_crate_model_tag(inner, inner_writer)?
        }
        crate::model::MetricsFilter::AccessPointArn(inner) => {
            let mut inner_writer = scope_writer.start_el("AccessPointArn").finish();
            inner_writer.data(inner.as_str());
        }
        crate::model::MetricsFilter::And(inner) => {
            let inner_writer = scope_writer.start_el("And");
            crate::xml_ser::serialize_structure_crate_model_metrics_and_operator(
                inner,
                inner_writer,
            )?
        }
        crate::model::MetricsFilter::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "MetricsFilter",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_topic_configuration(
    input: &crate::model::TopicConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_123) = &input.id {
        let mut inner_writer = scope.start_el("Id").finish();
        inner_writer.data(var_123.as_str());
    }
    if let Some(var_124) = &input.topic_arn {
        let mut inner_writer = scope.start_el("Topic").finish();
        inner_writer.data(var_124.as_str());
    }
    if let Some(var_125) = &input.events {
        for list_item_126 in var_125 {
            {
                let mut inner_writer = scope.start_el("Event").finish();
                inner_writer.data(list_item_126.as_str());
            }
        }
    }
    if let Some(var_127) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_structure_crate_model_notification_configuration_filter(
            var_127,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_queue_configuration(
    input: &crate::model::QueueConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_128) = &input.id {
        let mut inner_writer = scope.start_el("Id").finish();
        inner_writer.data(var_128.as_str());
    }
    if let Some(var_129) = &input.queue_arn {
        let mut inner_writer = scope.start_el("Queue").finish();
        inner_writer.data(var_129.as_str());
    }
    if let Some(var_130) = &input.events {
        for list_item_131 in var_130 {
            {
                let mut inner_writer = scope.start_el("Event").finish();
                inner_writer.data(list_item_131.as_str());
            }
        }
    }
    if let Some(var_132) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_structure_crate_model_notification_configuration_filter(
            var_132,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_lambda_function_configuration(
    input: &crate::model::LambdaFunctionConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_133) = &input.id {
        let mut inner_writer = scope.start_el("Id").finish();
        inner_writer.data(var_133.as_str());
    }
    if let Some(var_134) = &input.lambda_function_arn {
        let mut inner_writer = scope.start_el("CloudFunction").finish();
        inner_writer.data(var_134.as_str());
    }
    if let Some(var_135) = &input.events {
        for list_item_136 in var_135 {
            {
                let mut inner_writer = scope.start_el("Event").finish();
                inner_writer.data(list_item_136.as_str());
            }
        }
    }
    if let Some(var_137) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_structure_crate_model_notification_configuration_filter(
            var_137,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_ownership_controls_rule(
    input: &crate::model::OwnershipControlsRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_138) = &input.object_ownership {
        let mut inner_writer = scope.start_el("ObjectOwnership").finish();
        inner_writer.data(var_138.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_replication_rule(
    input: &crate::model::ReplicationRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_139) = &input.id {
        let mut inner_writer = scope.start_el("ID").finish();
        inner_writer.data(var_139.as_str());
    }
    if input.priority != 0 {
        let mut inner_writer = scope.start_el("Priority").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.priority).encode());
    }
    if let Some(var_140) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_140.as_str());
    }
    if let Some(var_141) = &input.filter {
        let inner_writer = scope.start_el("Filter");
        crate::xml_ser::serialize_union_crate_model_replication_rule_filter(var_141, inner_writer)?
    }
    if let Some(var_142) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_142.as_str());
    }
    if let Some(var_143) = &input.source_selection_criteria {
        let inner_writer = scope.start_el("SourceSelectionCriteria");
        crate::xml_ser::serialize_structure_crate_model_source_selection_criteria(
            var_143,
            inner_writer,
        )?
    }
    if let Some(var_144) = &input.existing_object_replication {
        let inner_writer = scope.start_el("ExistingObjectReplication");
        crate::xml_ser::serialize_structure_crate_model_existing_object_replication(
            var_144,
            inner_writer,
        )?
    }
    if let Some(var_145) = &input.destination {
        let inner_writer = scope.start_el("Destination");
        crate::xml_ser::serialize_structure_crate_model_destination(var_145, inner_writer)?
    }
    if let Some(var_146) = &input.delete_marker_replication {
        let inner_writer = scope.start_el("DeleteMarkerReplication");
        crate::xml_ser::serialize_structure_crate_model_delete_marker_replication(
            var_146,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_tag(
    input: &crate::model::Tag,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_147) = &input.key {
        let mut inner_writer = scope.start_el("Key").finish();
        inner_writer.data(var_147.as_str());
    }
    if let Some(var_148) = &input.value {
        let mut inner_writer = scope.start_el("Value").finish();
        inner_writer.data(var_148.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_error_document(
    input: &crate::model::ErrorDocument,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_149) = &input.key {
        let mut inner_writer = scope.start_el("Key").finish();
        inner_writer.data(var_149.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_index_document(
    input: &crate::model::IndexDocument,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_150) = &input.suffix {
        let mut inner_writer = scope.start_el("Suffix").finish();
        inner_writer.data(var_150.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_redirect_all_requests_to(
    input: &crate::model::RedirectAllRequestsTo,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_151) = &input.host_name {
        let mut inner_writer = scope.start_el("HostName").finish();
        inner_writer.data(var_151.as_str());
    }
    if let Some(var_152) = &input.protocol {
        let mut inner_writer = scope.start_el("Protocol").finish();
        inner_writer.data(var_152.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_routing_rule(
    input: &crate::model::RoutingRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_153) = &input.condition {
        let inner_writer = scope.start_el("Condition");
        crate::xml_ser::serialize_structure_crate_model_condition(var_153, inner_writer)?
    }
    if let Some(var_154) = &input.redirect {
        let inner_writer = scope.start_el("Redirect");
        crate::xml_ser::serialize_structure_crate_model_redirect(var_154, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_object_lock_rule(
    input: &crate::model::ObjectLockRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_155) = &input.default_retention {
        let inner_writer = scope.start_el("DefaultRetention");
        crate::xml_ser::serialize_structure_crate_model_default_retention(var_155, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_glacier_job_parameters(
    input: &crate::model::GlacierJobParameters,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_156) = &input.tier {
        let mut inner_writer = scope.start_el("Tier").finish();
        inner_writer.data(var_156.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_select_parameters(
    input: &crate::model::SelectParameters,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_157) = &input.input_serialization {
        let inner_writer = scope.start_el("InputSerialization");
        crate::xml_ser::serialize_structure_crate_model_input_serialization(var_157, inner_writer)?
    }
    if let Some(var_158) = &input.expression_type {
        let mut inner_writer = scope.start_el("ExpressionType").finish();
        inner_writer.data(var_158.as_str());
    }
    if let Some(var_159) = &input.expression {
        let mut inner_writer = scope.start_el("Expression").finish();
        inner_writer.data(var_159.as_str());
    }
    if let Some(var_160) = &input.output_serialization {
        let inner_writer = scope.start_el("OutputSerialization");
        crate::xml_ser::serialize_structure_crate_model_output_serialization(var_160, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_output_location(
    input: &crate::model::OutputLocation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_161) = &input.s3 {
        let inner_writer = scope.start_el("S3");
        crate::xml_ser::serialize_structure_crate_model_s3_location(var_161, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_csv_input(
    input: &crate::model::CsvInput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_162) = &input.file_header_info {
        let mut inner_writer = scope.start_el("FileHeaderInfo").finish();
        inner_writer.data(var_162.as_str());
    }
    if let Some(var_163) = &input.comments {
        let mut inner_writer = scope.start_el("Comments").finish();
        inner_writer.data(var_163.as_str());
    }
    if let Some(var_164) = &input.quote_escape_character {
        let mut inner_writer = scope.start_el("QuoteEscapeCharacter").finish();
        inner_writer.data(var_164.as_str());
    }
    if let Some(var_165) = &input.record_delimiter {
        let mut inner_writer = scope.start_el("RecordDelimiter").finish();
        inner_writer.data(var_165.as_str());
    }
    if let Some(var_166) = &input.field_delimiter {
        let mut inner_writer = scope.start_el("FieldDelimiter").finish();
        inner_writer.data(var_166.as_str());
    }
    if let Some(var_167) = &input.quote_character {
        let mut inner_writer = scope.start_el("QuoteCharacter").finish();
        inner_writer.data(var_167.as_str());
    }
    if input.allow_quoted_record_delimiter {
        let mut inner_writer = scope.start_el("AllowQuotedRecordDelimiter").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.allow_quoted_record_delimiter)
                .encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_json_input(
    input: &crate::model::JsonInput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_168) = &input.r#type {
        let mut inner_writer = scope.start_el("Type").finish();
        inner_writer.data(var_168.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_csv_output(
    input: &crate::model::CsvOutput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_169) = &input.quote_fields {
        let mut inner_writer = scope.start_el("QuoteFields").finish();
        inner_writer.data(var_169.as_str());
    }
    if let Some(var_170) = &input.quote_escape_character {
        let mut inner_writer = scope.start_el("QuoteEscapeCharacter").finish();
        inner_writer.data(var_170.as_str());
    }
    if let Some(var_171) = &input.record_delimiter {
        let mut inner_writer = scope.start_el("RecordDelimiter").finish();
        inner_writer.data(var_171.as_str());
    }
    if let Some(var_172) = &input.field_delimiter {
        let mut inner_writer = scope.start_el("FieldDelimiter").finish();
        inner_writer.data(var_172.as_str());
    }
    if let Some(var_173) = &input.quote_character {
        let mut inner_writer = scope.start_el("QuoteCharacter").finish();
        inner_writer.data(var_173.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_json_output(
    input: &crate::model::JsonOutput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_174) = &input.record_delimiter {
        let mut inner_writer = scope.start_el("RecordDelimiter").finish();
        inner_writer.data(var_174.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_grantee(
    input: &crate::model::Grantee,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut writer = writer;
    if let Some(var_175) = &input.r#type {
        writer.write_attribute("xsi:type", var_175.as_str());
    }
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_176) = &input.display_name {
        let mut inner_writer = scope.start_el("DisplayName").finish();
        inner_writer.data(var_176.as_str());
    }
    if let Some(var_177) = &input.email_address {
        let mut inner_writer = scope.start_el("EmailAddress").finish();
        inner_writer.data(var_177.as_str());
    }
    if let Some(var_178) = &input.id {
        let mut inner_writer = scope.start_el("ID").finish();
        inner_writer.data(var_178.as_str());
    }
    if let Some(var_179) = &input.uri {
        let mut inner_writer = scope.start_el("URI").finish();
        inner_writer.data(var_179.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_analytics_and_operator(
    input: &crate::model::AnalyticsAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_180) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_180.as_str());
    }
    if let Some(var_181) = &input.tags {
        for list_item_182 in var_181 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_182, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_storage_class_analysis_data_export(
    input: &crate::model::StorageClassAnalysisDataExport,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_183) = &input.output_schema_version {
        let mut inner_writer = scope.start_el("OutputSchemaVersion").finish();
        inner_writer.data(var_183.as_str());
    }
    if let Some(var_184) = &input.destination {
        let inner_writer = scope.start_el("Destination");
        crate::xml_ser::serialize_structure_crate_model_analytics_export_destination(
            var_184,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_server_side_encryption_by_default(
    input: &crate::model::ServerSideEncryptionByDefault,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_185) = &input.sse_algorithm {
        let mut inner_writer = scope.start_el("SSEAlgorithm").finish();
        inner_writer.data(var_185.as_str());
    }
    if let Some(var_186) = &input.kms_master_key_id {
        let mut inner_writer = scope.start_el("KMSMasterKeyID").finish();
        inner_writer.data(var_186.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_intelligent_tiering_and_operator(
    input: &crate::model::IntelligentTieringAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_187) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_187.as_str());
    }
    if let Some(var_188) = &input.tags {
        for list_item_189 in var_188 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_189, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_inventory_s3_bucket_destination(
    input: &crate::model::InventoryS3BucketDestination,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_190) = &input.account_id {
        let mut inner_writer = scope.start_el("AccountId").finish();
        inner_writer.data(var_190.as_str());
    }
    if let Some(var_191) = &input.bucket {
        let mut inner_writer = scope.start_el("Bucket").finish();
        inner_writer.data(var_191.as_str());
    }
    if let Some(var_192) = &input.format {
        let mut inner_writer = scope.start_el("Format").finish();
        inner_writer.data(var_192.as_str());
    }
    if let Some(var_193) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_193.as_str());
    }
    if let Some(var_194) = &input.encryption {
        let inner_writer = scope.start_el("Encryption");
        crate::xml_ser::serialize_structure_crate_model_inventory_encryption(var_194, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_lifecycle_expiration(
    input: &crate::model::LifecycleExpiration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_195) = &input.date {
        let mut inner_writer = scope.start_el("Date").finish();
        inner_writer.data(
            var_195
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if input.days != 0 {
        let mut inner_writer = scope.start_el("Days").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.days).encode());
    }
    if input.expired_object_delete_marker {
        let mut inner_writer = scope.start_el("ExpiredObjectDeleteMarker").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.expired_object_delete_marker).encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_union_crate_model_lifecycle_rule_filter(
    input: &crate::model::LifecycleRuleFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::LifecycleRuleFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer.start_el("Prefix").finish();
            inner_writer.data(inner.as_str());
        }
        crate::model::LifecycleRuleFilter::Tag(inner) => {
            let inner_writer = scope_writer.start_el("Tag");
            crate::xml_ser::serialize_structure_crate_model_tag(inner, inner_writer)?
        }
        crate::model::LifecycleRuleFilter::ObjectSizeGreaterThan(inner) => {
            let mut inner_writer = scope_writer.start_el("ObjectSizeGreaterThan").finish();
            inner_writer.data(aws_smithy_types::primitive::Encoder::from(*inner).encode());
        }
        crate::model::LifecycleRuleFilter::ObjectSizeLessThan(inner) => {
            let mut inner_writer = scope_writer.start_el("ObjectSizeLessThan").finish();
            inner_writer.data(aws_smithy_types::primitive::Encoder::from(*inner).encode());
        }
        crate::model::LifecycleRuleFilter::And(inner) => {
            let inner_writer = scope_writer.start_el("And");
            crate::xml_ser::serialize_structure_crate_model_lifecycle_rule_and_operator(
                inner,
                inner_writer,
            )?
        }
        crate::model::LifecycleRuleFilter::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "LifecycleRuleFilter",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_transition(
    input: &crate::model::Transition,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_196) = &input.date {
        let mut inner_writer = scope.start_el("Date").finish();
        inner_writer.data(
            var_196
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if input.days != 0 {
        let mut inner_writer = scope.start_el("Days").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.days).encode());
    }
    if let Some(var_197) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_197.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_noncurrent_version_transition(
    input: &crate::model::NoncurrentVersionTransition,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.noncurrent_days != 0 {
        let mut inner_writer = scope.start_el("NoncurrentDays").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.noncurrent_days).encode());
    }
    if let Some(var_198) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_198.as_str());
    }
    if input.newer_noncurrent_versions != 0 {
        let mut inner_writer = scope.start_el("NewerNoncurrentVersions").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.newer_noncurrent_versions).encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_noncurrent_version_expiration(
    input: &crate::model::NoncurrentVersionExpiration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.noncurrent_days != 0 {
        let mut inner_writer = scope.start_el("NoncurrentDays").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.noncurrent_days).encode());
    }
    if input.newer_noncurrent_versions != 0 {
        let mut inner_writer = scope.start_el("NewerNoncurrentVersions").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.newer_noncurrent_versions).encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_abort_incomplete_multipart_upload(
    input: &crate::model::AbortIncompleteMultipartUpload,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.days_after_initiation != 0 {
        let mut inner_writer = scope.start_el("DaysAfterInitiation").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.days_after_initiation).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_target_grant(
    input: &crate::model::TargetGrant,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_199) = &input.grantee {
        let inner_writer = scope
            .start_el("Grantee")
            .write_ns("http://www.w3.org/2001/XMLSchema-instance", Some("xsi"));
        crate::xml_ser::serialize_structure_crate_model_grantee(var_199, inner_writer)?
    }
    if let Some(var_200) = &input.permission {
        let mut inner_writer = scope.start_el("Permission").finish();
        inner_writer.data(var_200.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_metrics_and_operator(
    input: &crate::model::MetricsAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_201) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_201.as_str());
    }
    if let Some(var_202) = &input.tags {
        for list_item_203 in var_202 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_203, inner_writer)?
            }
        }
    }
    if let Some(var_204) = &input.access_point_arn {
        let mut inner_writer = scope.start_el("AccessPointArn").finish();
        inner_writer.data(var_204.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_notification_configuration_filter(
    input: &crate::model::NotificationConfigurationFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_205) = &input.key {
        let inner_writer = scope.start_el("S3Key");
        crate::xml_ser::serialize_structure_crate_model_s3_key_filter(var_205, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_union_crate_model_replication_rule_filter(
    input: &crate::model::ReplicationRuleFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::ReplicationRuleFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer.start_el("Prefix").finish();
            inner_writer.data(inner.as_str());
        }
        crate::model::ReplicationRuleFilter::Tag(inner) => {
            let inner_writer = scope_writer.start_el("Tag");
            crate::xml_ser::serialize_structure_crate_model_tag(inner, inner_writer)?
        }
        crate::model::ReplicationRuleFilter::And(inner) => {
            let inner_writer = scope_writer.start_el("And");
            crate::xml_ser::serialize_structure_crate_model_replication_rule_and_operator(
                inner,
                inner_writer,
            )?
        }
        crate::model::ReplicationRuleFilter::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "ReplicationRuleFilter",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_source_selection_criteria(
    input: &crate::model::SourceSelectionCriteria,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_206) = &input.sse_kms_encrypted_objects {
        let inner_writer = scope.start_el("SseKmsEncryptedObjects");
        crate::xml_ser::serialize_structure_crate_model_sse_kms_encrypted_objects(
            var_206,
            inner_writer,
        )?
    }
    if let Some(var_207) = &input.replica_modifications {
        let inner_writer = scope.start_el("ReplicaModifications");
        crate::xml_ser::serialize_structure_crate_model_replica_modifications(
            var_207,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_existing_object_replication(
    input: &crate::model::ExistingObjectReplication,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_208) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_208.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_destination(
    input: &crate::model::Destination,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_209) = &input.bucket {
        let mut inner_writer = scope.start_el("Bucket").finish();
        inner_writer.data(var_209.as_str());
    }
    if let Some(var_210) = &input.account {
        let mut inner_writer = scope.start_el("Account").finish();
        inner_writer.data(var_210.as_str());
    }
    if let Some(var_211) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_211.as_str());
    }
    if let Some(var_212) = &input.access_control_translation {
        let inner_writer = scope.start_el("AccessControlTranslation");
        crate::xml_ser::serialize_structure_crate_model_access_control_translation(
            var_212,
            inner_writer,
        )?
    }
    if let Some(var_213) = &input.encryption_configuration {
        let inner_writer = scope.start_el("EncryptionConfiguration");
        crate::xml_ser::serialize_structure_crate_model_encryption_configuration(
            var_213,
            inner_writer,
        )?
    }
    if let Some(var_214) = &input.replication_time {
        let inner_writer = scope.start_el("ReplicationTime");
        crate::xml_ser::serialize_structure_crate_model_replication_time(var_214, inner_writer)?
    }
    if let Some(var_215) = &input.metrics {
        let inner_writer = scope.start_el("Metrics");
        crate::xml_ser::serialize_structure_crate_model_metrics(var_215, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_delete_marker_replication(
    input: &crate::model::DeleteMarkerReplication,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_216) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_216.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_condition(
    input: &crate::model::Condition,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_217) = &input.http_error_code_returned_equals {
        let mut inner_writer = scope.start_el("HttpErrorCodeReturnedEquals").finish();
        inner_writer.data(var_217.as_str());
    }
    if let Some(var_218) = &input.key_prefix_equals {
        let mut inner_writer = scope.start_el("KeyPrefixEquals").finish();
        inner_writer.data(var_218.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_redirect(
    input: &crate::model::Redirect,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_219) = &input.host_name {
        let mut inner_writer = scope.start_el("HostName").finish();
        inner_writer.data(var_219.as_str());
    }
    if let Some(var_220) = &input.http_redirect_code {
        let mut inner_writer = scope.start_el("HttpRedirectCode").finish();
        inner_writer.data(var_220.as_str());
    }
    if let Some(var_221) = &input.protocol {
        let mut inner_writer = scope.start_el("Protocol").finish();
        inner_writer.data(var_221.as_str());
    }
    if let Some(var_222) = &input.replace_key_prefix_with {
        let mut inner_writer = scope.start_el("ReplaceKeyPrefixWith").finish();
        inner_writer.data(var_222.as_str());
    }
    if let Some(var_223) = &input.replace_key_with {
        let mut inner_writer = scope.start_el("ReplaceKeyWith").finish();
        inner_writer.data(var_223.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_default_retention(
    input: &crate::model::DefaultRetention,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_224) = &input.mode {
        let mut inner_writer = scope.start_el("Mode").finish();
        inner_writer.data(var_224.as_str());
    }
    if input.days != 0 {
        let mut inner_writer = scope.start_el("Days").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.days).encode());
    }
    if input.years != 0 {
        let mut inner_writer = scope.start_el("Years").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.years).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_location(
    input: &crate::model::S3Location,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_225) = &input.bucket_name {
        let mut inner_writer = scope.start_el("BucketName").finish();
        inner_writer.data(var_225.as_str());
    }
    if let Some(var_226) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_226.as_str());
    }
    if let Some(var_227) = &input.encryption {
        let inner_writer = scope.start_el("Encryption");
        crate::xml_ser::serialize_structure_crate_model_encryption(var_227, inner_writer)?
    }
    if let Some(var_228) = &input.canned_acl {
        let mut inner_writer = scope.start_el("CannedACL").finish();
        inner_writer.data(var_228.as_str());
    }
    if let Some(var_229) = &input.access_control_list {
        let mut inner_writer = scope.start_el("AccessControlList").finish();
        for list_item_230 in var_229 {
            {
                let inner_writer = inner_writer.start_el("Grant");
                crate::xml_ser::serialize_structure_crate_model_grant(list_item_230, inner_writer)?
            }
        }
    }
    if let Some(var_231) = &input.tagging {
        let inner_writer = scope.start_el("Tagging");
        crate::xml_ser::serialize_structure_crate_model_tagging(var_231, inner_writer)?
    }
    if let Some(var_232) = &input.user_metadata {
        let mut inner_writer = scope.start_el("UserMetadata").finish();
        for list_item_233 in var_232 {
            {
                let inner_writer = inner_writer.start_el("MetadataEntry");
                crate::xml_ser::serialize_structure_crate_model_metadata_entry(
                    list_item_233,
                    inner_writer,
                )?
            }
        }
    }
    if let Some(var_234) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_234.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_analytics_export_destination(
    input: &crate::model::AnalyticsExportDestination,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_235) = &input.s3_bucket_destination {
        let inner_writer = scope.start_el("S3BucketDestination");
        crate::xml_ser::serialize_structure_crate_model_analytics_s3_bucket_destination(
            var_235,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_inventory_encryption(
    input: &crate::model::InventoryEncryption,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(_var_236) = &input.sses3 {
        scope.start_el("SSE-S3").finish();
    }
    if let Some(var_237) = &input.ssekms {
        let inner_writer = scope.start_el("SSE-KMS");
        crate::xml_ser::serialize_structure_crate_model_ssekms(var_237, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_lifecycle_rule_and_operator(
    input: &crate::model::LifecycleRuleAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_238) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_238.as_str());
    }
    if let Some(var_239) = &input.tags {
        for list_item_240 in var_239 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_240, inner_writer)?
            }
        }
    }
    if input.object_size_greater_than != 0 {
        let mut inner_writer = scope.start_el("ObjectSizeGreaterThan").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.object_size_greater_than).encode(),
        );
    }
    if input.object_size_less_than != 0 {
        let mut inner_writer = scope.start_el("ObjectSizeLessThan").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.object_size_less_than).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_s3_key_filter(
    input: &crate::model::S3KeyFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_241) = &input.filter_rules {
        for list_item_242 in var_241 {
            {
                let inner_writer = scope.start_el("FilterRule");
                crate::xml_ser::serialize_structure_crate_model_filter_rule(
                    list_item_242,
                    inner_writer,
                )?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_replication_rule_and_operator(
    input: &crate::model::ReplicationRuleAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_243) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_243.as_str());
    }
    if let Some(var_244) = &input.tags {
        for list_item_245 in var_244 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_245, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_sse_kms_encrypted_objects(
    input: &crate::model::SseKmsEncryptedObjects,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_246) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_246.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_replica_modifications(
    input: &crate::model::ReplicaModifications,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_247) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_247.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_access_control_translation(
    input: &crate::model::AccessControlTranslation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_248) = &input.owner {
        let mut inner_writer = scope.start_el("Owner").finish();
        inner_writer.data(var_248.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_encryption_configuration(
    input: &crate::model::EncryptionConfiguration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_249) = &input.replica_kms_key_id {
        let mut inner_writer = scope.start_el("ReplicaKmsKeyID").finish();
        inner_writer.data(var_249.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_replication_time(
    input: &crate::model::ReplicationTime,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_250) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_250.as_str());
    }
    if let Some(var_251) = &input.time {
        let inner_writer = scope.start_el("Time");
        crate::xml_ser::serialize_structure_crate_model_replication_time_value(
            var_251,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_metrics(
    input: &crate::model::Metrics,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_252) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_252.as_str());
    }
    if let Some(var_253) = &input.event_threshold {
        let inner_writer = scope.start_el("EventThreshold");
        crate::xml_ser::serialize_structure_crate_model_replication_time_value(
            var_253,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_encryption(
    input: &crate::model::Encryption,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_254) = &input.encryption_type {
        let mut inner_writer = scope.start_el("EncryptionType").finish();
        inner_writer.data(var_254.as_str());
    }
    if let Some(var_255) = &input.kms_key_id {
        let mut inner_writer = scope.start_el("KMSKeyId").finish();
        inner_writer.data(var_255.as_str());
    }
    if let Some(var_256) = &input.kms_context {
        let mut inner_writer = scope.start_el("KMSContext").finish();
        inner_writer.data(var_256.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_metadata_entry(
    input: &crate::model::MetadataEntry,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_257) = &input.name {
        let mut inner_writer = scope.start_el("Name").finish();
        inner_writer.data(var_257.as_str());
    }
    if let Some(var_258) = &input.value {
        let mut inner_writer = scope.start_el("Value").finish();
        inner_writer.data(var_258.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_analytics_s3_bucket_destination(
    input: &crate::model::AnalyticsS3BucketDestination,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_259) = &input.format {
        let mut inner_writer = scope.start_el("Format").finish();
        inner_writer.data(var_259.as_str());
    }
    if let Some(var_260) = &input.bucket_account_id {
        let mut inner_writer = scope.start_el("BucketAccountId").finish();
        inner_writer.data(var_260.as_str());
    }
    if let Some(var_261) = &input.bucket {
        let mut inner_writer = scope.start_el("Bucket").finish();
        inner_writer.data(var_261.as_str());
    }
    if let Some(var_262) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_262.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_ssekms(
    input: &crate::model::Ssekms,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_263) = &input.key_id {
        let mut inner_writer = scope.start_el("KeyId").finish();
        inner_writer.data(var_263.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_filter_rule(
    input: &crate::model::FilterRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_264) = &input.name {
        let mut inner_writer = scope.start_el("Name").finish();
        inner_writer.data(var_264.as_str());
    }
    if let Some(var_265) = &input.value {
        let mut inner_writer = scope.start_el("Value").finish();
        inner_writer.data(var_265.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_replication_time_value(
    input: &crate::model::ReplicationTimeValue,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.minutes != 0 {
        let mut inner_writer = scope.start_el("Minutes").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.minutes).encode());
    }
    scope.finish();
    Ok(())
}