// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_payload_completed_multipart_upload_complete_multipart_upload_input(
    input: &crate::model::CompletedMultipartUpload,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_completed_multipart_upload(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_create_bucket_configuration_create_bucket_input(
    input: &crate::model::CreateBucketConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_create_bucket_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_delete_delete_objects_input(
    input: &crate::model::Delete,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_delete(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_accelerate_configuration_put_bucket_accelerate_configuration_input(
    input: &crate::model::AccelerateConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_accelerate_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_access_control_policy_put_bucket_acl_input(
    input: &crate::model::AccessControlPolicy,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_access_control_policy(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_analytics_configuration_put_bucket_analytics_configuration_input(
    input: &crate::model::AnalyticsConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_analytics_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_cors_configuration_put_bucket_cors_input(
    input: &crate::model::CORSConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_cors_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_server_side_encryption_configuration_put_bucket_encryption_input(
    input: &crate::model::ServerSideEncryptionConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_server_side_encryption_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_intelligent_tiering_configuration_put_bucket_intelligent_tiering_configuration_input(
    input: &crate::model::IntelligentTieringConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_intelligent_tiering_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_inventory_configuration_put_bucket_inventory_configuration_input(
    input: &crate::model::InventoryConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_inventory_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_bucket_lifecycle_configuration_put_bucket_lifecycle_configuration_input(
    input: &crate::model::BucketLifecycleConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_bucket_lifecycle_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_bucket_logging_status_put_bucket_logging_input(
    input: &crate::model::BucketLoggingStatus,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_bucket_logging_status(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_metrics_configuration_put_bucket_metrics_configuration_input(
    input: &crate::model::MetricsConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_metrics_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_notification_configuration_put_bucket_notification_configuration_input(
    input: &crate::model::NotificationConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_notification_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_ownership_controls_put_bucket_ownership_controls_input(
    input: &crate::model::OwnershipControls,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_ownership_controls(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_replication_configuration_put_bucket_replication_input(
    input: &crate::model::ReplicationConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_replication_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_request_payment_configuration_put_bucket_request_payment_input(
    input: &crate::model::RequestPaymentConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_request_payment_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_tagging_put_bucket_tagging_input(
    input: &crate::model::Tagging,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_tagging(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_versioning_configuration_put_bucket_versioning_input(
    input: &crate::model::VersioningConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_versioning_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_website_configuration_put_bucket_website_input(
    input: &crate::model::WebsiteConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_website_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_access_control_policy_put_object_acl_input(
    input: &crate::model::AccessControlPolicy,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_access_control_policy(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_object_lock_legal_hold_put_object_legal_hold_input(
    input: &crate::model::ObjectLockLegalHold,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_object_lock_legal_hold(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_object_lock_configuration_put_object_lock_configuration_input(
    input: &crate::model::ObjectLockConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_object_lock_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_object_lock_retention_put_object_retention_input(
    input: &crate::model::ObjectLockRetention,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_object_lock_retention(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_tagging_put_object_tagging_input(
    input: &crate::model::Tagging,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_tagging(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_public_access_block_configuration_put_public_access_block_input(
    input: &crate::model::PublicAccessBlockConfiguration,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_public_access_block_configuration(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_payload_restore_request_restore_object_input(
    input: &crate::model::RestoreRequest,
) -> Result<smithy_http::body::SdkBody, String> {
    let mut out = String::new();
    {
        let mut writer = 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_restore_request(&&input, root)
    }
    Ok(smithy_http::body::SdkBody::from(out))
}

pub fn serialize_structure_completed_multipart_upload(
    input: &crate::model::CompletedMultipartUpload,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_1) = &input.parts {
        for list_item_2 in var_1 {
            {
                let inner_writer = scope
                    .start_el("Part")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_completed_part(&list_item_2, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_create_bucket_configuration(
    input: &crate::model::CreateBucketConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_3) = &input.location_constraint {
        let mut inner_writer = scope
            .start_el("LocationConstraint")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_3.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_delete(
    input: &crate::model::Delete,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_4) = &input.objects {
        for list_item_5 in var_4 {
            {
                let inner_writer = scope
                    .start_el("Object")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_object_identifier(&list_item_5, inner_writer)
            }
        }
    }
    {
        let mut inner_writer = scope
            .start_el("Quiet")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.quiet { "true" } else { "false" });
    }
    scope.finish();
}

pub fn serialize_structure_accelerate_configuration(
    input: &crate::model::AccelerateConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_6) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_6.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_access_control_policy(
    input: &crate::model::AccessControlPolicy,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_7) = &input.grants {
        let mut inner_writer = scope
            .start_el("AccessControlList")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        for list_item_8 in var_7 {
            {
                let inner_writer = inner_writer
                    .start_el("Grant")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_grant(&list_item_8, inner_writer)
            }
        }
    }
    if let Some(var_9) = &input.owner {
        let inner_writer = scope
            .start_el("Owner")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_owner(&var_9, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_analytics_configuration(
    input: &crate::model::AnalyticsConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_10) = &input.id {
        let mut inner_writer = scope
            .start_el("Id")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_10.as_ref());
    }
    if let Some(var_11) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_union_analytics_filter(&var_11, inner_writer)
    }
    if let Some(var_12) = &input.storage_class_analysis {
        let inner_writer = scope
            .start_el("StorageClassAnalysis")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_storage_class_analysis(&var_12, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_cors_configuration(
    input: &crate::model::CORSConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_13) = &input.cors_rules {
        for list_item_14 in var_13 {
            {
                let inner_writer = scope
                    .start_el("CORSRule")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_cors_rule(&list_item_14, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_server_side_encryption_configuration(
    input: &crate::model::ServerSideEncryptionConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_15) = &input.rules {
        for list_item_16 in var_15 {
            {
                let inner_writer = scope
                    .start_el("Rule")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_server_side_encryption_rule(
                    &list_item_16,
                    inner_writer,
                )
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_intelligent_tiering_configuration(
    input: &crate::model::IntelligentTieringConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_17) = &input.id {
        let mut inner_writer = scope
            .start_el("Id")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_17.as_ref());
    }
    if let Some(var_18) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_intelligent_tiering_filter(&var_18, inner_writer)
    }
    if let Some(var_19) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_19.as_str());
    }
    if let Some(var_20) = &input.tierings {
        for list_item_21 in var_20 {
            {
                let inner_writer = scope
                    .start_el("Tiering")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_tiering(&list_item_21, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_inventory_configuration(
    input: &crate::model::InventoryConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_22) = &input.destination {
        let inner_writer = scope
            .start_el("Destination")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_inventory_destination(&var_22, inner_writer)
    }
    {
        let mut inner_writer = scope
            .start_el("IsEnabled")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.is_enabled { "true" } else { "false" });
    }
    if let Some(var_23) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_inventory_filter(&var_23, inner_writer)
    }
    if let Some(var_24) = &input.id {
        let mut inner_writer = scope
            .start_el("Id")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_24.as_ref());
    }
    if let Some(var_25) = &input.included_object_versions {
        let mut inner_writer = scope
            .start_el("IncludedObjectVersions")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_25.as_str());
    }
    if let Some(var_26) = &input.optional_fields {
        let mut inner_writer = scope
            .start_el("OptionalFields")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        for list_item_27 in var_26 {
            {
                let mut inner_writer = inner_writer
                    .start_el("Field")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_27.as_str());
            }
        }
    }
    if let Some(var_28) = &input.schedule {
        let inner_writer = scope
            .start_el("Schedule")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_inventory_schedule(&var_28, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_bucket_lifecycle_configuration(
    input: &crate::model::BucketLifecycleConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_29) = &input.rules {
        for list_item_30 in var_29 {
            {
                let inner_writer = scope
                    .start_el("Rule")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_lifecycle_rule(&list_item_30, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_bucket_logging_status(
    input: &crate::model::BucketLoggingStatus,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_31) = &input.logging_enabled {
        let inner_writer = scope
            .start_el("LoggingEnabled")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_logging_enabled(&var_31, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_metrics_configuration(
    input: &crate::model::MetricsConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_32) = &input.id {
        let mut inner_writer = scope
            .start_el("Id")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_32.as_ref());
    }
    if let Some(var_33) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_union_metrics_filter(&var_33, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_notification_configuration(
    input: &crate::model::NotificationConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_34) = &input.topic_configurations {
        for list_item_35 in var_34 {
            {
                let inner_writer = scope
                    .start_el("TopicConfiguration")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_topic_configuration(&list_item_35, inner_writer)
            }
        }
    }
    if let Some(var_36) = &input.queue_configurations {
        for list_item_37 in var_36 {
            {
                let inner_writer = scope
                    .start_el("QueueConfiguration")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_queue_configuration(&list_item_37, inner_writer)
            }
        }
    }
    if let Some(var_38) = &input.lambda_function_configurations {
        for list_item_39 in var_38 {
            {
                let inner_writer = scope
                    .start_el("CloudFunctionConfiguration")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_lambda_function_configuration(
                    &list_item_39,
                    inner_writer,
                )
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_ownership_controls(
    input: &crate::model::OwnershipControls,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_40) = &input.rules {
        for list_item_41 in var_40 {
            {
                let inner_writer = scope
                    .start_el("Rule")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_ownership_controls_rule(
                    &list_item_41,
                    inner_writer,
                )
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_replication_configuration(
    input: &crate::model::ReplicationConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_42) = &input.role {
        let mut inner_writer = scope
            .start_el("Role")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_42.as_ref());
    }
    if let Some(var_43) = &input.rules {
        for list_item_44 in var_43 {
            {
                let inner_writer = scope
                    .start_el("Rule")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_replication_rule(&list_item_44, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_request_payment_configuration(
    input: &crate::model::RequestPaymentConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_45) = &input.payer {
        let mut inner_writer = scope
            .start_el("Payer")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_45.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_tagging(
    input: &crate::model::Tagging,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_46) = &input.tag_set {
        let mut inner_writer = scope
            .start_el("TagSet")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        for list_item_47 in var_46 {
            {
                let inner_writer = inner_writer
                    .start_el("Tag")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_tag(&list_item_47, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_versioning_configuration(
    input: &crate::model::VersioningConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_48) = &input.mfa_delete {
        let mut inner_writer = scope
            .start_el("MfaDelete")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_48.as_str());
    }
    if let Some(var_49) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_49.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_website_configuration(
    input: &crate::model::WebsiteConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_50) = &input.error_document {
        let inner_writer = scope
            .start_el("ErrorDocument")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_error_document(&var_50, inner_writer)
    }
    if let Some(var_51) = &input.index_document {
        let inner_writer = scope
            .start_el("IndexDocument")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_index_document(&var_51, inner_writer)
    }
    if let Some(var_52) = &input.redirect_all_requests_to {
        let inner_writer = scope
            .start_el("RedirectAllRequestsTo")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_redirect_all_requests_to(&var_52, inner_writer)
    }
    if let Some(var_53) = &input.routing_rules {
        let mut inner_writer = scope
            .start_el("RoutingRules")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        for list_item_54 in var_53 {
            {
                let inner_writer = inner_writer
                    .start_el("RoutingRule")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_routing_rule(&list_item_54, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_object_lock_legal_hold(
    input: &crate::model::ObjectLockLegalHold,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_55) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_55.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_object_lock_configuration(
    input: &crate::model::ObjectLockConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_56) = &input.object_lock_enabled {
        let mut inner_writer = scope
            .start_el("ObjectLockEnabled")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_56.as_str());
    }
    if let Some(var_57) = &input.rule {
        let inner_writer = scope
            .start_el("Rule")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_object_lock_rule(&var_57, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_object_lock_retention(
    input: &crate::model::ObjectLockRetention,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_58) = &input.mode {
        let mut inner_writer = scope
            .start_el("Mode")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_58.as_str());
    }
    if let Some(var_59) = &input.retain_until_date {
        let mut inner_writer = scope
            .start_el("RetainUntilDate")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_59.fmt(smithy_types::instant::Format::DateTime).as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_public_access_block_configuration(
    input: &crate::model::PublicAccessBlockConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope
            .start_el("BlockPublicAcls")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.block_public_acls {
            "true"
        } else {
            "false"
        });
    }
    {
        let mut inner_writer = scope
            .start_el("IgnorePublicAcls")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.ignore_public_acls {
            "true"
        } else {
            "false"
        });
    }
    {
        let mut inner_writer = scope
            .start_el("BlockPublicPolicy")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.block_public_policy {
            "true"
        } else {
            "false"
        });
    }
    {
        let mut inner_writer = scope
            .start_el("RestrictPublicBuckets")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.restrict_public_buckets {
            "true"
        } else {
            "false"
        });
    }
    scope.finish();
}

pub fn serialize_structure_restore_request(
    input: &crate::model::RestoreRequest,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope
            .start_el("Days")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.days.to_string().as_ref());
    }
    if let Some(var_60) = &input.glacier_job_parameters {
        let inner_writer = scope
            .start_el("GlacierJobParameters")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_glacier_job_parameters(&var_60, inner_writer)
    }
    if let Some(var_61) = &input.r#type {
        let mut inner_writer = scope
            .start_el("Type")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_61.as_str());
    }
    if let Some(var_62) = &input.tier {
        let mut inner_writer = scope
            .start_el("Tier")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_62.as_str());
    }
    if let Some(var_63) = &input.description {
        let mut inner_writer = scope
            .start_el("Description")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_63.as_ref());
    }
    if let Some(var_64) = &input.select_parameters {
        let inner_writer = scope
            .start_el("SelectParameters")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_select_parameters(&var_64, inner_writer)
    }
    if let Some(var_65) = &input.output_location {
        let inner_writer = scope
            .start_el("OutputLocation")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_output_location(&var_65, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_completed_part(
    input: &crate::model::CompletedPart,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_66) = &input.e_tag {
        let mut inner_writer = scope
            .start_el("ETag")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_66.as_ref());
    }
    {
        let mut inner_writer = scope
            .start_el("PartNumber")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.part_number.to_string().as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_object_identifier(
    input: &crate::model::ObjectIdentifier,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_67) = &input.key {
        let mut inner_writer = scope
            .start_el("Key")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_67.as_ref());
    }
    if let Some(var_68) = &input.version_id {
        let mut inner_writer = scope
            .start_el("VersionId")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_68.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_grant(
    input: &crate::model::Grant,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_69) = &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_grantee(&var_69, inner_writer)
    }
    if let Some(var_70) = &input.permission {
        let mut inner_writer = scope
            .start_el("Permission")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_70.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_owner(
    input: &crate::model::Owner,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_71) = &input.display_name {
        let mut inner_writer = scope
            .start_el("DisplayName")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_71.as_ref());
    }
    if let Some(var_72) = &input.id {
        let mut inner_writer = scope
            .start_el("ID")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_72.as_ref());
    }
    scope.finish();
}

pub fn serialize_union_analytics_filter(
    input: &crate::model::AnalyticsFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::AnalyticsFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer
                .start_el("Prefix")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                .finish();
            inner_writer.data(inner.as_ref());
        }
        crate::model::AnalyticsFilter::Tag(inner) => {
            let inner_writer = scope_writer
                .start_el("Tag")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_tag(&inner, inner_writer)
        }
        crate::model::AnalyticsFilter::And(inner) => {
            let inner_writer = scope_writer
                .start_el("And")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_analytics_and_operator(&inner, inner_writer)
        }
    }
}

pub fn serialize_structure_storage_class_analysis(
    input: &crate::model::StorageClassAnalysis,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_73) = &input.data_export {
        let inner_writer = scope
            .start_el("DataExport")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_storage_class_analysis_data_export(
            &var_73,
            inner_writer,
        )
    }
    scope.finish();
}

pub fn serialize_structure_cors_rule(
    input: &crate::model::CORSRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_74) = &input.id {
        let mut inner_writer = scope
            .start_el("ID")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_74.as_ref());
    }
    if let Some(var_75) = &input.allowed_headers {
        for list_item_76 in var_75 {
            {
                let mut inner_writer = scope
                    .start_el("AllowedHeader")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_76.as_ref());
            }
        }
    }
    if let Some(var_77) = &input.allowed_methods {
        for list_item_78 in var_77 {
            {
                let mut inner_writer = scope
                    .start_el("AllowedMethod")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_78.as_ref());
            }
        }
    }
    if let Some(var_79) = &input.allowed_origins {
        for list_item_80 in var_79 {
            {
                let mut inner_writer = scope
                    .start_el("AllowedOrigin")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_80.as_ref());
            }
        }
    }
    if let Some(var_81) = &input.expose_headers {
        for list_item_82 in var_81 {
            {
                let mut inner_writer = scope
                    .start_el("ExposeHeader")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_82.as_ref());
            }
        }
    }
    {
        let mut inner_writer = scope
            .start_el("MaxAgeSeconds")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.max_age_seconds.to_string().as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_server_side_encryption_rule(
    input: &crate::model::ServerSideEncryptionRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_83) = &input.apply_server_side_encryption_by_default {
        let inner_writer = scope
            .start_el("ApplyServerSideEncryptionByDefault")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_server_side_encryption_by_default(&var_83, inner_writer)
    }
    {
        let mut inner_writer = scope
            .start_el("BucketKeyEnabled")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.bucket_key_enabled {
            "true"
        } else {
            "false"
        });
    }
    scope.finish();
}

pub fn serialize_structure_intelligent_tiering_filter(
    input: &crate::model::IntelligentTieringFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_84) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_84.as_ref());
    }
    if let Some(var_85) = &input.tag {
        let inner_writer = scope
            .start_el("Tag")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_tag(&var_85, inner_writer)
    }
    if let Some(var_86) = &input.and {
        let inner_writer = scope
            .start_el("And")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_intelligent_tiering_and_operator(&var_86, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_tiering(
    input: &crate::model::Tiering,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope
            .start_el("Days")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.days.to_string().as_ref());
    }
    if let Some(var_87) = &input.access_tier {
        let mut inner_writer = scope
            .start_el("AccessTier")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_87.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_inventory_destination(
    input: &crate::model::InventoryDestination,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_88) = &input.s3_bucket_destination {
        let inner_writer = scope
            .start_el("S3BucketDestination")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_inventory_s3_bucket_destination(&var_88, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_inventory_filter(
    input: &crate::model::InventoryFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_89) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_89.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_inventory_schedule(
    input: &crate::model::InventorySchedule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_90) = &input.frequency {
        let mut inner_writer = scope
            .start_el("Frequency")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_90.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_lifecycle_rule(
    input: &crate::model::LifecycleRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_91) = &input.expiration {
        let inner_writer = scope
            .start_el("Expiration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_lifecycle_expiration(&var_91, inner_writer)
    }
    if let Some(var_92) = &input.id {
        let mut inner_writer = scope
            .start_el("ID")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_92.as_ref());
    }
    if let Some(var_93) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_93.as_ref());
    }
    if let Some(var_94) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_union_lifecycle_rule_filter(&var_94, inner_writer)
    }
    if let Some(var_95) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_95.as_str());
    }
    if let Some(var_96) = &input.transitions {
        for list_item_97 in var_96 {
            {
                let inner_writer = scope
                    .start_el("Transition")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_transition(&list_item_97, inner_writer)
            }
        }
    }
    if let Some(var_98) = &input.noncurrent_version_transitions {
        for list_item_99 in var_98 {
            {
                let inner_writer = scope
                    .start_el("NoncurrentVersionTransition")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_noncurrent_version_transition(
                    &list_item_99,
                    inner_writer,
                )
            }
        }
    }
    if let Some(var_100) = &input.noncurrent_version_expiration {
        let inner_writer = scope
            .start_el("NoncurrentVersionExpiration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_noncurrent_version_expiration(&var_100, inner_writer)
    }
    if let Some(var_101) = &input.abort_incomplete_multipart_upload {
        let inner_writer = scope
            .start_el("AbortIncompleteMultipartUpload")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_abort_incomplete_multipart_upload(
            &var_101,
            inner_writer,
        )
    }
    scope.finish();
}

pub fn serialize_structure_logging_enabled(
    input: &crate::model::LoggingEnabled,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_102) = &input.target_bucket {
        let mut inner_writer = scope
            .start_el("TargetBucket")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_102.as_ref());
    }
    if let Some(var_103) = &input.target_grants {
        let mut inner_writer = scope
            .start_el("TargetGrants")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        for list_item_104 in var_103 {
            {
                let inner_writer = inner_writer
                    .start_el("Grant")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_target_grant(&list_item_104, inner_writer)
            }
        }
    }
    if let Some(var_105) = &input.target_prefix {
        let mut inner_writer = scope
            .start_el("TargetPrefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_105.as_ref());
    }
    scope.finish();
}

pub fn serialize_union_metrics_filter(
    input: &crate::model::MetricsFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::MetricsFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer
                .start_el("Prefix")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                .finish();
            inner_writer.data(inner.as_ref());
        }
        crate::model::MetricsFilter::Tag(inner) => {
            let inner_writer = scope_writer
                .start_el("Tag")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_tag(&inner, inner_writer)
        }
        crate::model::MetricsFilter::And(inner) => {
            let inner_writer = scope_writer
                .start_el("And")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_metrics_and_operator(&inner, inner_writer)
        }
    }
}

pub fn serialize_structure_topic_configuration(
    input: &crate::model::TopicConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_106) = &input.id {
        let mut inner_writer = scope
            .start_el("Id")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_106.as_ref());
    }
    if let Some(var_107) = &input.topic_arn {
        let mut inner_writer = scope
            .start_el("Topic")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_107.as_ref());
    }
    if let Some(var_108) = &input.events {
        for list_item_109 in var_108 {
            {
                let mut inner_writer = scope
                    .start_el("Event")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_109.as_str());
            }
        }
    }
    if let Some(var_110) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_notification_configuration_filter(
            &var_110,
            inner_writer,
        )
    }
    scope.finish();
}

pub fn serialize_structure_queue_configuration(
    input: &crate::model::QueueConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_111) = &input.id {
        let mut inner_writer = scope
            .start_el("Id")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_111.as_ref());
    }
    if let Some(var_112) = &input.queue_arn {
        let mut inner_writer = scope
            .start_el("Queue")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_112.as_ref());
    }
    if let Some(var_113) = &input.events {
        for list_item_114 in var_113 {
            {
                let mut inner_writer = scope
                    .start_el("Event")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_114.as_str());
            }
        }
    }
    if let Some(var_115) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_notification_configuration_filter(
            &var_115,
            inner_writer,
        )
    }
    scope.finish();
}

pub fn serialize_structure_lambda_function_configuration(
    input: &crate::model::LambdaFunctionConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_116) = &input.id {
        let mut inner_writer = scope
            .start_el("Id")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_116.as_ref());
    }
    if let Some(var_117) = &input.lambda_function_arn {
        let mut inner_writer = scope
            .start_el("CloudFunction")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_117.as_ref());
    }
    if let Some(var_118) = &input.events {
        for list_item_119 in var_118 {
            {
                let mut inner_writer = scope
                    .start_el("Event")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                    .finish();
                inner_writer.data(list_item_119.as_str());
            }
        }
    }
    if let Some(var_120) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_notification_configuration_filter(
            &var_120,
            inner_writer,
        )
    }
    scope.finish();
}

pub fn serialize_structure_ownership_controls_rule(
    input: &crate::model::OwnershipControlsRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_121) = &input.object_ownership {
        let mut inner_writer = scope
            .start_el("ObjectOwnership")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_121.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_replication_rule(
    input: &crate::model::ReplicationRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_122) = &input.id {
        let mut inner_writer = scope
            .start_el("ID")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_122.as_ref());
    }
    {
        let mut inner_writer = scope
            .start_el("Priority")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.priority.to_string().as_ref());
    }
    if let Some(var_123) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_123.as_ref());
    }
    if let Some(var_124) = &input.filter {
        let inner_writer = scope
            .start_el("Filter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_union_replication_rule_filter(&var_124, inner_writer)
    }
    if let Some(var_125) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_125.as_str());
    }
    if let Some(var_126) = &input.source_selection_criteria {
        let inner_writer = scope
            .start_el("SourceSelectionCriteria")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_source_selection_criteria(&var_126, inner_writer)
    }
    if let Some(var_127) = &input.existing_object_replication {
        let inner_writer = scope
            .start_el("ExistingObjectReplication")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_existing_object_replication(&var_127, inner_writer)
    }
    if let Some(var_128) = &input.destination {
        let inner_writer = scope
            .start_el("Destination")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_destination(&var_128, inner_writer)
    }
    if let Some(var_129) = &input.delete_marker_replication {
        let inner_writer = scope
            .start_el("DeleteMarkerReplication")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_delete_marker_replication(&var_129, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_tag(input: &crate::model::Tag, writer: smithy_xml::encode::ElWriter) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_130) = &input.key {
        let mut inner_writer = scope
            .start_el("Key")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_130.as_ref());
    }
    if let Some(var_131) = &input.value {
        let mut inner_writer = scope
            .start_el("Value")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_131.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_error_document(
    input: &crate::model::ErrorDocument,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_132) = &input.key {
        let mut inner_writer = scope
            .start_el("Key")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_132.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_index_document(
    input: &crate::model::IndexDocument,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_133) = &input.suffix {
        let mut inner_writer = scope
            .start_el("Suffix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_133.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_redirect_all_requests_to(
    input: &crate::model::RedirectAllRequestsTo,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_134) = &input.host_name {
        let mut inner_writer = scope
            .start_el("HostName")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_134.as_ref());
    }
    if let Some(var_135) = &input.protocol {
        let mut inner_writer = scope
            .start_el("Protocol")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_135.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_routing_rule(
    input: &crate::model::RoutingRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_136) = &input.condition {
        let inner_writer = scope
            .start_el("Condition")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_condition(&var_136, inner_writer)
    }
    if let Some(var_137) = &input.redirect {
        let inner_writer = scope
            .start_el("Redirect")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_redirect(&var_137, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_object_lock_rule(
    input: &crate::model::ObjectLockRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_138) = &input.default_retention {
        let inner_writer = scope
            .start_el("DefaultRetention")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_default_retention(&var_138, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_glacier_job_parameters(
    input: &crate::model::GlacierJobParameters,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_139) = &input.tier {
        let mut inner_writer = scope
            .start_el("Tier")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_139.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_select_parameters(
    input: &crate::model::SelectParameters,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_140) = &input.input_serialization {
        let inner_writer = scope
            .start_el("InputSerialization")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_input_serialization(&var_140, inner_writer)
    }
    if let Some(var_141) = &input.expression_type {
        let mut inner_writer = scope
            .start_el("ExpressionType")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_141.as_str());
    }
    if let Some(var_142) = &input.expression {
        let mut inner_writer = scope
            .start_el("Expression")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_142.as_ref());
    }
    if let Some(var_143) = &input.output_serialization {
        let inner_writer = scope
            .start_el("OutputSerialization")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_output_serialization(&var_143, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_output_location(
    input: &crate::model::OutputLocation,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_144) = &input.s3 {
        let inner_writer = scope
            .start_el("S3")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_s3_location(&var_144, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_grantee(
    input: &crate::model::Grantee,
    writer: smithy_xml::encode::ElWriter,
) {
    let mut writer = writer;
    if let Some(var_145) = &input.r#type {
        writer.write_attribute("xsi:type", var_145.as_str());
    }
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_146) = &input.display_name {
        let mut inner_writer = scope
            .start_el("DisplayName")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_146.as_ref());
    }
    if let Some(var_147) = &input.email_address {
        let mut inner_writer = scope
            .start_el("EmailAddress")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_147.as_ref());
    }
    if let Some(var_148) = &input.id {
        let mut inner_writer = scope
            .start_el("ID")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_148.as_ref());
    }
    if let Some(var_149) = &input.uri {
        let mut inner_writer = scope
            .start_el("URI")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_149.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_analytics_and_operator(
    input: &crate::model::AnalyticsAndOperator,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_150) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_150.as_ref());
    }
    if let Some(var_151) = &input.tags {
        for list_item_152 in var_151 {
            {
                let inner_writer = scope
                    .start_el("Tag")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_tag(&list_item_152, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_storage_class_analysis_data_export(
    input: &crate::model::StorageClassAnalysisDataExport,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_153) = &input.output_schema_version {
        let mut inner_writer = scope
            .start_el("OutputSchemaVersion")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_153.as_str());
    }
    if let Some(var_154) = &input.destination {
        let inner_writer = scope
            .start_el("Destination")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_analytics_export_destination(&var_154, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_server_side_encryption_by_default(
    input: &crate::model::ServerSideEncryptionByDefault,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_155) = &input.sse_algorithm {
        let mut inner_writer = scope
            .start_el("SSEAlgorithm")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_155.as_str());
    }
    if let Some(var_156) = &input.kms_master_key_id {
        let mut inner_writer = scope
            .start_el("KMSMasterKeyID")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_156.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_intelligent_tiering_and_operator(
    input: &crate::model::IntelligentTieringAndOperator,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_157) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_157.as_ref());
    }
    if let Some(var_158) = &input.tags {
        for list_item_159 in var_158 {
            {
                let inner_writer = scope
                    .start_el("Tag")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_tag(&list_item_159, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_inventory_s3_bucket_destination(
    input: &crate::model::InventoryS3BucketDestination,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_160) = &input.account_id {
        let mut inner_writer = scope
            .start_el("AccountId")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_160.as_ref());
    }
    if let Some(var_161) = &input.bucket {
        let mut inner_writer = scope
            .start_el("Bucket")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_161.as_ref());
    }
    if let Some(var_162) = &input.format {
        let mut inner_writer = scope
            .start_el("Format")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_162.as_str());
    }
    if let Some(var_163) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_163.as_ref());
    }
    if let Some(var_164) = &input.encryption {
        let inner_writer = scope
            .start_el("Encryption")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_inventory_encryption(&var_164, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_lifecycle_expiration(
    input: &crate::model::LifecycleExpiration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_165) = &input.date {
        let mut inner_writer = scope
            .start_el("Date")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(
            var_165
                .fmt(smithy_types::instant::Format::DateTime)
                .as_ref(),
        );
    }
    {
        let mut inner_writer = scope
            .start_el("Days")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.days.to_string().as_ref());
    }
    {
        let mut inner_writer = scope
            .start_el("ExpiredObjectDeleteMarker")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.expired_object_delete_marker {
            "true"
        } else {
            "false"
        });
    }
    scope.finish();
}

pub fn serialize_union_lifecycle_rule_filter(
    input: &crate::model::LifecycleRuleFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::LifecycleRuleFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer
                .start_el("Prefix")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                .finish();
            inner_writer.data(inner.as_ref());
        }
        crate::model::LifecycleRuleFilter::Tag(inner) => {
            let inner_writer = scope_writer
                .start_el("Tag")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_tag(&inner, inner_writer)
        }
        crate::model::LifecycleRuleFilter::And(inner) => {
            let inner_writer = scope_writer
                .start_el("And")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_lifecycle_rule_and_operator(&inner, inner_writer)
        }
    }
}

pub fn serialize_structure_transition(
    input: &crate::model::Transition,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_166) = &input.date {
        let mut inner_writer = scope
            .start_el("Date")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(
            var_166
                .fmt(smithy_types::instant::Format::DateTime)
                .as_ref(),
        );
    }
    {
        let mut inner_writer = scope
            .start_el("Days")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.days.to_string().as_ref());
    }
    if let Some(var_167) = &input.storage_class {
        let mut inner_writer = scope
            .start_el("StorageClass")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_167.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_noncurrent_version_transition(
    input: &crate::model::NoncurrentVersionTransition,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope
            .start_el("NoncurrentDays")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.noncurrent_days.to_string().as_ref());
    }
    if let Some(var_168) = &input.storage_class {
        let mut inner_writer = scope
            .start_el("StorageClass")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_168.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_noncurrent_version_expiration(
    input: &crate::model::NoncurrentVersionExpiration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope
            .start_el("NoncurrentDays")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.noncurrent_days.to_string().as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_abort_incomplete_multipart_upload(
    input: &crate::model::AbortIncompleteMultipartUpload,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope
            .start_el("DaysAfterInitiation")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.days_after_initiation.to_string().as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_target_grant(
    input: &crate::model::TargetGrant,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_169) = &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_grantee(&var_169, inner_writer)
    }
    if let Some(var_170) = &input.permission {
        let mut inner_writer = scope
            .start_el("Permission")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_170.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_metrics_and_operator(
    input: &crate::model::MetricsAndOperator,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_171) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_171.as_ref());
    }
    if let Some(var_172) = &input.tags {
        for list_item_173 in var_172 {
            {
                let inner_writer = scope
                    .start_el("Tag")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_tag(&list_item_173, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_notification_configuration_filter(
    input: &crate::model::NotificationConfigurationFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_174) = &input.key {
        let inner_writer = scope
            .start_el("S3Key")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_s3_key_filter(&var_174, inner_writer)
    }
    scope.finish();
}

pub fn serialize_union_replication_rule_filter(
    input: &crate::model::ReplicationRuleFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::ReplicationRuleFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer
                .start_el("Prefix")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
                .finish();
            inner_writer.data(inner.as_ref());
        }
        crate::model::ReplicationRuleFilter::Tag(inner) => {
            let inner_writer = scope_writer
                .start_el("Tag")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_tag(&inner, inner_writer)
        }
        crate::model::ReplicationRuleFilter::And(inner) => {
            let inner_writer = scope_writer
                .start_el("And")
                .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
            crate::xml_ser::serialize_structure_replication_rule_and_operator(&inner, inner_writer)
        }
    }
}

pub fn serialize_structure_source_selection_criteria(
    input: &crate::model::SourceSelectionCriteria,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_175) = &input.sse_kms_encrypted_objects {
        let inner_writer = scope
            .start_el("SseKmsEncryptedObjects")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_sse_kms_encrypted_objects(&var_175, inner_writer)
    }
    if let Some(var_176) = &input.replica_modifications {
        let inner_writer = scope
            .start_el("ReplicaModifications")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_replica_modifications(&var_176, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_existing_object_replication(
    input: &crate::model::ExistingObjectReplication,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_177) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_177.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_destination(
    input: &crate::model::Destination,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_178) = &input.bucket {
        let mut inner_writer = scope
            .start_el("Bucket")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_178.as_ref());
    }
    if let Some(var_179) = &input.account {
        let mut inner_writer = scope
            .start_el("Account")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_179.as_ref());
    }
    if let Some(var_180) = &input.storage_class {
        let mut inner_writer = scope
            .start_el("StorageClass")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_180.as_str());
    }
    if let Some(var_181) = &input.access_control_translation {
        let inner_writer = scope
            .start_el("AccessControlTranslation")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_access_control_translation(&var_181, inner_writer)
    }
    if let Some(var_182) = &input.encryption_configuration {
        let inner_writer = scope
            .start_el("EncryptionConfiguration")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_encryption_configuration(&var_182, inner_writer)
    }
    if let Some(var_183) = &input.replication_time {
        let inner_writer = scope
            .start_el("ReplicationTime")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_replication_time(&var_183, inner_writer)
    }
    if let Some(var_184) = &input.metrics {
        let inner_writer = scope
            .start_el("Metrics")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_metrics(&var_184, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_delete_marker_replication(
    input: &crate::model::DeleteMarkerReplication,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_185) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_185.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_condition(
    input: &crate::model::Condition,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_186) = &input.http_error_code_returned_equals {
        let mut inner_writer = scope
            .start_el("HttpErrorCodeReturnedEquals")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_186.as_ref());
    }
    if let Some(var_187) = &input.key_prefix_equals {
        let mut inner_writer = scope
            .start_el("KeyPrefixEquals")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_187.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_redirect(
    input: &crate::model::Redirect,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_188) = &input.host_name {
        let mut inner_writer = scope
            .start_el("HostName")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_188.as_ref());
    }
    if let Some(var_189) = &input.http_redirect_code {
        let mut inner_writer = scope
            .start_el("HttpRedirectCode")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_189.as_ref());
    }
    if let Some(var_190) = &input.protocol {
        let mut inner_writer = scope
            .start_el("Protocol")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_190.as_str());
    }
    if let Some(var_191) = &input.replace_key_prefix_with {
        let mut inner_writer = scope
            .start_el("ReplaceKeyPrefixWith")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_191.as_ref());
    }
    if let Some(var_192) = &input.replace_key_with {
        let mut inner_writer = scope
            .start_el("ReplaceKeyWith")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_192.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_default_retention(
    input: &crate::model::DefaultRetention,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_193) = &input.mode {
        let mut inner_writer = scope
            .start_el("Mode")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_193.as_str());
    }
    {
        let mut inner_writer = scope
            .start_el("Days")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.days.to_string().as_ref());
    }
    {
        let mut inner_writer = scope
            .start_el("Years")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.years.to_string().as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_input_serialization(
    input: &crate::model::InputSerialization,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_194) = &input.csv {
        let inner_writer = scope
            .start_el("CSV")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_csv_input(&var_194, inner_writer)
    }
    if let Some(var_195) = &input.compression_type {
        let mut inner_writer = scope
            .start_el("CompressionType")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_195.as_str());
    }
    if let Some(var_196) = &input.json {
        let inner_writer = scope
            .start_el("JSON")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_json_input(&var_196, inner_writer)
    }
    if let Some(var_197) = &input.parquet {
        let inner_writer = scope
            .start_el("Parquet")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_parquet_input(&var_197, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_output_serialization(
    input: &crate::model::OutputSerialization,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_198) = &input.csv {
        let inner_writer = scope
            .start_el("CSV")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_csv_output(&var_198, inner_writer)
    }
    if let Some(var_199) = &input.json {
        let inner_writer = scope
            .start_el("JSON")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_json_output(&var_199, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_s3_location(
    input: &crate::model::S3Location,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_200) = &input.bucket_name {
        let mut inner_writer = scope
            .start_el("BucketName")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_200.as_ref());
    }
    if let Some(var_201) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_201.as_ref());
    }
    if let Some(var_202) = &input.encryption {
        let inner_writer = scope
            .start_el("Encryption")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_encryption(&var_202, inner_writer)
    }
    if let Some(var_203) = &input.canned_acl {
        let mut inner_writer = scope
            .start_el("CannedACL")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_203.as_str());
    }
    if let Some(var_204) = &input.access_control_list {
        let mut inner_writer = scope
            .start_el("AccessControlList")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        for list_item_205 in var_204 {
            {
                let inner_writer = inner_writer
                    .start_el("Grant")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_grant(&list_item_205, inner_writer)
            }
        }
    }
    if let Some(var_206) = &input.tagging {
        let inner_writer = scope
            .start_el("Tagging")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_tagging(&var_206, inner_writer)
    }
    if let Some(var_207) = &input.user_metadata {
        let mut inner_writer = scope
            .start_el("UserMetadata")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        for list_item_208 in var_207 {
            {
                let inner_writer = inner_writer
                    .start_el("MetadataEntry")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_metadata_entry(&list_item_208, inner_writer)
            }
        }
    }
    if let Some(var_209) = &input.storage_class {
        let mut inner_writer = scope
            .start_el("StorageClass")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_209.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_analytics_export_destination(
    input: &crate::model::AnalyticsExportDestination,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_210) = &input.s3_bucket_destination {
        let inner_writer = scope
            .start_el("S3BucketDestination")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_analytics_s3_bucket_destination(&var_210, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_inventory_encryption(
    input: &crate::model::InventoryEncryption,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_211) = &input.sses3 {
        let inner_writer = scope
            .start_el("SSE-S3")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_sses3(&var_211, inner_writer)
    }
    if let Some(var_212) = &input.ssekms {
        let inner_writer = scope
            .start_el("SSE-KMS")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_ssekms(&var_212, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_lifecycle_rule_and_operator(
    input: &crate::model::LifecycleRuleAndOperator,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_213) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_213.as_ref());
    }
    if let Some(var_214) = &input.tags {
        for list_item_215 in var_214 {
            {
                let inner_writer = scope
                    .start_el("Tag")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_tag(&list_item_215, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_s3_key_filter(
    input: &crate::model::S3KeyFilter,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_216) = &input.filter_rules {
        for list_item_217 in var_216 {
            {
                let inner_writer = scope
                    .start_el("FilterRule")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_filter_rule(&list_item_217, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_replication_rule_and_operator(
    input: &crate::model::ReplicationRuleAndOperator,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_218) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_218.as_ref());
    }
    if let Some(var_219) = &input.tags {
        for list_item_220 in var_219 {
            {
                let inner_writer = scope
                    .start_el("Tag")
                    .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
                crate::xml_ser::serialize_structure_tag(&list_item_220, inner_writer)
            }
        }
    }
    scope.finish();
}

pub fn serialize_structure_sse_kms_encrypted_objects(
    input: &crate::model::SseKmsEncryptedObjects,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_221) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_221.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_replica_modifications(
    input: &crate::model::ReplicaModifications,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_222) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_222.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_access_control_translation(
    input: &crate::model::AccessControlTranslation,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_223) = &input.owner {
        let mut inner_writer = scope
            .start_el("Owner")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_223.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_encryption_configuration(
    input: &crate::model::EncryptionConfiguration,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_224) = &input.replica_kms_key_id {
        let mut inner_writer = scope
            .start_el("ReplicaKmsKeyID")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_224.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_replication_time(
    input: &crate::model::ReplicationTime,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_225) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_225.as_str());
    }
    if let Some(var_226) = &input.time {
        let inner_writer = scope
            .start_el("Time")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_replication_time_value(&var_226, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_metrics(
    input: &crate::model::Metrics,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_227) = &input.status {
        let mut inner_writer = scope
            .start_el("Status")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_227.as_str());
    }
    if let Some(var_228) = &input.event_threshold {
        let inner_writer = scope
            .start_el("EventThreshold")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
        crate::xml_ser::serialize_structure_replication_time_value(&var_228, inner_writer)
    }
    scope.finish();
}

pub fn serialize_structure_csv_input(
    input: &crate::model::CSVInput,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_229) = &input.file_header_info {
        let mut inner_writer = scope
            .start_el("FileHeaderInfo")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_229.as_str());
    }
    if let Some(var_230) = &input.comments {
        let mut inner_writer = scope
            .start_el("Comments")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_230.as_ref());
    }
    if let Some(var_231) = &input.quote_escape_character {
        let mut inner_writer = scope
            .start_el("QuoteEscapeCharacter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_231.as_ref());
    }
    if let Some(var_232) = &input.record_delimiter {
        let mut inner_writer = scope
            .start_el("RecordDelimiter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_232.as_ref());
    }
    if let Some(var_233) = &input.field_delimiter {
        let mut inner_writer = scope
            .start_el("FieldDelimiter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_233.as_ref());
    }
    if let Some(var_234) = &input.quote_character {
        let mut inner_writer = scope
            .start_el("QuoteCharacter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_234.as_ref());
    }
    {
        let mut inner_writer = scope
            .start_el("AllowQuotedRecordDelimiter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(if input.allow_quoted_record_delimiter {
            "true"
        } else {
            "false"
        });
    }
    scope.finish();
}

pub fn serialize_structure_json_input(
    input: &crate::model::JSONInput,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_235) = &input.r#type {
        let mut inner_writer = scope
            .start_el("Type")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_235.as_str());
    }
    scope.finish();
}

pub fn serialize_structure_parquet_input(
    input: &crate::model::ParquetInput,
    writer: smithy_xml::encode::ElWriter,
) {
    let _ = input;
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    scope.finish();
}

pub fn serialize_structure_csv_output(
    input: &crate::model::CSVOutput,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_236) = &input.quote_fields {
        let mut inner_writer = scope
            .start_el("QuoteFields")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_236.as_str());
    }
    if let Some(var_237) = &input.quote_escape_character {
        let mut inner_writer = scope
            .start_el("QuoteEscapeCharacter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_237.as_ref());
    }
    if let Some(var_238) = &input.record_delimiter {
        let mut inner_writer = scope
            .start_el("RecordDelimiter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_238.as_ref());
    }
    if let Some(var_239) = &input.field_delimiter {
        let mut inner_writer = scope
            .start_el("FieldDelimiter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_239.as_ref());
    }
    if let Some(var_240) = &input.quote_character {
        let mut inner_writer = scope
            .start_el("QuoteCharacter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_240.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_json_output(
    input: &crate::model::JSONOutput,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_241) = &input.record_delimiter {
        let mut inner_writer = scope
            .start_el("RecordDelimiter")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_241.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_encryption(
    input: &crate::model::Encryption,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_242) = &input.encryption_type {
        let mut inner_writer = scope
            .start_el("EncryptionType")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_242.as_str());
    }
    if let Some(var_243) = &input.kms_key_id {
        let mut inner_writer = scope
            .start_el("KMSKeyId")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_243.as_ref());
    }
    if let Some(var_244) = &input.kms_context {
        let mut inner_writer = scope
            .start_el("KMSContext")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_244.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_metadata_entry(
    input: &crate::model::MetadataEntry,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_245) = &input.name {
        let mut inner_writer = scope
            .start_el("Name")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_245.as_ref());
    }
    if let Some(var_246) = &input.value {
        let mut inner_writer = scope
            .start_el("Value")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_246.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_analytics_s3_bucket_destination(
    input: &crate::model::AnalyticsS3BucketDestination,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_247) = &input.format {
        let mut inner_writer = scope
            .start_el("Format")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_247.as_str());
    }
    if let Some(var_248) = &input.bucket_account_id {
        let mut inner_writer = scope
            .start_el("BucketAccountId")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_248.as_ref());
    }
    if let Some(var_249) = &input.bucket {
        let mut inner_writer = scope
            .start_el("Bucket")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_249.as_ref());
    }
    if let Some(var_250) = &input.prefix {
        let mut inner_writer = scope
            .start_el("Prefix")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_250.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_sses3(
    input: &crate::model::SSES3,
    writer: smithy_xml::encode::ElWriter,
) {
    let _ = input;
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    scope.finish();
}

pub fn serialize_structure_ssekms(
    input: &crate::model::SSEKMS,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_251) = &input.key_id {
        let mut inner_writer = scope
            .start_el("KeyId")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_251.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_filter_rule(
    input: &crate::model::FilterRule,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_252) = &input.name {
        let mut inner_writer = scope
            .start_el("Name")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_252.as_str());
    }
    if let Some(var_253) = &input.value {
        let mut inner_writer = scope
            .start_el("Value")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(var_253.as_ref());
    }
    scope.finish();
}

pub fn serialize_structure_replication_time_value(
    input: &crate::model::ReplicationTimeValue,
    writer: smithy_xml::encode::ElWriter,
) {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    {
        let mut inner_writer = scope
            .start_el("Minutes")
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None)
            .finish();
        inner_writer.data(&input.minutes.to_string().as_ref());
    }
    scope.finish();
}
