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

pub fn serialize_structure_crate_input_cancel_service_software_update_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CancelServiceSoftwareUpdateInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_6) = &input.domain_name {
        object.key("DomainName").string(var_6);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_domain_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateDomainInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_7) = &input.access_policies {
        object.key("AccessPolicies").string(var_7);
    }
    if let Some(var_8) = &input.advanced_options {
        let mut object_9 = object.key("AdvancedOptions").start_object();
        for (key_10, value_11) in var_8 {
            {
                object_9.key(key_10).string(value_11);
            }
        }
        object_9.finish();
    }
    if let Some(var_12) = &input.advanced_security_options {
        let mut object_13 = object.key("AdvancedSecurityOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_advanced_security_options_input(
            &mut object_13,
            var_12,
        )?;
        object_13.finish();
    }
    if let Some(var_14) = &input.auto_tune_options {
        let mut object_15 = object.key("AutoTuneOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_auto_tune_options_input(
            &mut object_15,
            var_14,
        )?;
        object_15.finish();
    }
    if let Some(var_16) = &input.cluster_config {
        let mut object_17 = object.key("ClusterConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_cluster_config(&mut object_17, var_16)?;
        object_17.finish();
    }
    if let Some(var_18) = &input.cognito_options {
        let mut object_19 = object.key("CognitoOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_cognito_options(&mut object_19, var_18)?;
        object_19.finish();
    }
    if let Some(var_20) = &input.domain_endpoint_options {
        let mut object_21 = object.key("DomainEndpointOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_domain_endpoint_options(
            &mut object_21,
            var_20,
        )?;
        object_21.finish();
    }
    if let Some(var_22) = &input.domain_name {
        object.key("DomainName").string(var_22);
    }
    if let Some(var_23) = &input.ebs_options {
        let mut object_24 = object.key("EBSOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_ebs_options(&mut object_24, var_23)?;
        object_24.finish();
    }
    if let Some(var_25) = &input.encryption_at_rest_options {
        let mut object_26 = object.key("EncryptionAtRestOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_encryption_at_rest_options(
            &mut object_26,
            var_25,
        )?;
        object_26.finish();
    }
    if let Some(var_27) = &input.engine_version {
        object.key("EngineVersion").string(var_27);
    }
    if let Some(var_28) = &input.log_publishing_options {
        let mut object_29 = object.key("LogPublishingOptions").start_object();
        for (key_30, value_31) in var_28 {
            {
                let mut object_32 = object_29.key(key_30.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_log_publishing_option(
                    &mut object_32,
                    value_31,
                )?;
                object_32.finish();
            }
        }
        object_29.finish();
    }
    if let Some(var_33) = &input.node_to_node_encryption_options {
        let mut object_34 = object.key("NodeToNodeEncryptionOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_node_to_node_encryption_options(
            &mut object_34,
            var_33,
        )?;
        object_34.finish();
    }
    if let Some(var_35) = &input.snapshot_options {
        let mut object_36 = object.key("SnapshotOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_snapshot_options(&mut object_36, var_35)?;
        object_36.finish();
    }
    if let Some(var_37) = &input.tag_list {
        let mut array_38 = object.key("TagList").start_array();
        for item_39 in var_37 {
            {
                let mut object_40 = array_38.value().start_object();
                crate::json_ser::serialize_structure_crate_model_tag(&mut object_40, item_39)?;
                object_40.finish();
            }
        }
        array_38.finish();
    }
    if let Some(var_41) = &input.vpc_options {
        let mut object_42 = object.key("VPCOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_vpc_options(&mut object_42, var_41)?;
        object_42.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_outbound_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateOutboundConnectionInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_43) = &input.connection_alias {
        object.key("ConnectionAlias").string(var_43);
    }
    if let Some(var_44) = &input.local_domain_info {
        let mut object_45 = object.key("LocalDomainInfo").start_object();
        crate::json_ser::serialize_structure_crate_model_domain_information_container(
            &mut object_45,
            var_44,
        )?;
        object_45.finish();
    }
    if let Some(var_46) = &input.remote_domain_info {
        let mut object_47 = object.key("RemoteDomainInfo").start_object();
        crate::json_ser::serialize_structure_crate_model_domain_information_container(
            &mut object_47,
            var_46,
        )?;
        object_47.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_package_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreatePackageInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_48) = &input.package_description {
        object.key("PackageDescription").string(var_48);
    }
    if let Some(var_49) = &input.package_name {
        object.key("PackageName").string(var_49);
    }
    if let Some(var_50) = &input.package_source {
        let mut object_51 = object.key("PackageSource").start_object();
        crate::json_ser::serialize_structure_crate_model_package_source(&mut object_51, var_50)?;
        object_51.finish();
    }
    if let Some(var_52) = &input.package_type {
        object.key("PackageType").string(var_52.as_str());
    }
    Ok(())
}

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

pub fn serialize_structure_crate_input_describe_domains_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeDomainsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_54) = &input.domain_names {
        let mut array_55 = object.key("DomainNames").start_array();
        for item_56 in var_54 {
            {
                array_55.value().string(item_56);
            }
        }
        array_55.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_inbound_connections_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeInboundConnectionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_57) = &input.filters {
        let mut array_58 = object.key("Filters").start_array();
        for item_59 in var_57 {
            {
                let mut object_60 = array_58.value().start_object();
                crate::json_ser::serialize_structure_crate_model_filter(&mut object_60, item_59)?;
                object_60.finish();
            }
        }
        array_58.finish();
    }
    if input.max_results != 0 {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_61) = &input.next_token {
        object.key("NextToken").string(var_61);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_outbound_connections_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeOutboundConnectionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_62) = &input.filters {
        let mut array_63 = object.key("Filters").start_array();
        for item_64 in var_62 {
            {
                let mut object_65 = array_63.value().start_object();
                crate::json_ser::serialize_structure_crate_model_filter(&mut object_65, item_64)?;
                object_65.finish();
            }
        }
        array_63.finish();
    }
    if input.max_results != 0 {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_66) = &input.next_token {
        object.key("NextToken").string(var_66);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_packages_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribePackagesInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_67) = &input.filters {
        let mut array_68 = object.key("Filters").start_array();
        for item_69 in var_67 {
            {
                let mut object_70 = array_68.value().start_object();
                crate::json_ser::serialize_structure_crate_model_describe_packages_filter(
                    &mut object_70,
                    item_69,
                )?;
                object_70.finish();
            }
        }
        array_68.finish();
    }
    if input.max_results != 0 {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.max_results).into()),
        );
    }
    if let Some(var_71) = &input.next_token {
        object.key("NextToken").string(var_71);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_purchase_reserved_instance_offering_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::PurchaseReservedInstanceOfferingInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.instance_count != 0 {
        object.key("InstanceCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.instance_count).into()),
        );
    }
    if let Some(var_72) = &input.reservation_name {
        object.key("ReservationName").string(var_72);
    }
    if let Some(var_73) = &input.reserved_instance_offering_id {
        object.key("ReservedInstanceOfferingId").string(var_73);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_remove_tags_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RemoveTagsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_74) = &input.arn {
        object.key("ARN").string(var_74);
    }
    if let Some(var_75) = &input.tag_keys {
        let mut array_76 = object.key("TagKeys").start_array();
        for item_77 in var_75 {
            {
                array_76.value().string(item_77);
            }
        }
        array_76.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_service_software_update_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartServiceSoftwareUpdateInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_78) = &input.domain_name {
        object.key("DomainName").string(var_78);
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_domain_config_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateDomainConfigInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_79) = &input.access_policies {
        object.key("AccessPolicies").string(var_79);
    }
    if let Some(var_80) = &input.advanced_options {
        let mut object_81 = object.key("AdvancedOptions").start_object();
        for (key_82, value_83) in var_80 {
            {
                object_81.key(key_82).string(value_83);
            }
        }
        object_81.finish();
    }
    if let Some(var_84) = &input.advanced_security_options {
        let mut object_85 = object.key("AdvancedSecurityOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_advanced_security_options_input(
            &mut object_85,
            var_84,
        )?;
        object_85.finish();
    }
    if let Some(var_86) = &input.auto_tune_options {
        let mut object_87 = object.key("AutoTuneOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_auto_tune_options(&mut object_87, var_86)?;
        object_87.finish();
    }
    if let Some(var_88) = &input.cluster_config {
        let mut object_89 = object.key("ClusterConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_cluster_config(&mut object_89, var_88)?;
        object_89.finish();
    }
    if let Some(var_90) = &input.cognito_options {
        let mut object_91 = object.key("CognitoOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_cognito_options(&mut object_91, var_90)?;
        object_91.finish();
    }
    if let Some(var_92) = &input.domain_endpoint_options {
        let mut object_93 = object.key("DomainEndpointOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_domain_endpoint_options(
            &mut object_93,
            var_92,
        )?;
        object_93.finish();
    }
    if let Some(var_94) = &input.dry_run {
        object.key("DryRun").boolean(*var_94);
    }
    if let Some(var_95) = &input.ebs_options {
        let mut object_96 = object.key("EBSOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_ebs_options(&mut object_96, var_95)?;
        object_96.finish();
    }
    if let Some(var_97) = &input.encryption_at_rest_options {
        let mut object_98 = object.key("EncryptionAtRestOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_encryption_at_rest_options(
            &mut object_98,
            var_97,
        )?;
        object_98.finish();
    }
    if let Some(var_99) = &input.log_publishing_options {
        let mut object_100 = object.key("LogPublishingOptions").start_object();
        for (key_101, value_102) in var_99 {
            {
                let mut object_103 = object_100.key(key_101.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_log_publishing_option(
                    &mut object_103,
                    value_102,
                )?;
                object_103.finish();
            }
        }
        object_100.finish();
    }
    if let Some(var_104) = &input.node_to_node_encryption_options {
        let mut object_105 = object.key("NodeToNodeEncryptionOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_node_to_node_encryption_options(
            &mut object_105,
            var_104,
        )?;
        object_105.finish();
    }
    if let Some(var_106) = &input.snapshot_options {
        let mut object_107 = object.key("SnapshotOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_snapshot_options(
            &mut object_107,
            var_106,
        )?;
        object_107.finish();
    }
    if let Some(var_108) = &input.vpc_options {
        let mut object_109 = object.key("VPCOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_vpc_options(&mut object_109, var_108)?;
        object_109.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_package_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdatePackageInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_110) = &input.commit_message {
        object.key("CommitMessage").string(var_110);
    }
    if let Some(var_111) = &input.package_description {
        object.key("PackageDescription").string(var_111);
    }
    if let Some(var_112) = &input.package_id {
        object.key("PackageID").string(var_112);
    }
    if let Some(var_113) = &input.package_source {
        let mut object_114 = object.key("PackageSource").start_object();
        crate::json_ser::serialize_structure_crate_model_package_source(&mut object_114, var_113)?;
        object_114.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_upgrade_domain_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpgradeDomainInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_115) = &input.advanced_options {
        let mut object_116 = object.key("AdvancedOptions").start_object();
        for (key_117, value_118) in var_115 {
            {
                object_116.key(key_117).string(value_118);
            }
        }
        object_116.finish();
    }
    if let Some(var_119) = &input.domain_name {
        object.key("DomainName").string(var_119);
    }
    if let Some(var_120) = &input.perform_check_only {
        object.key("PerformCheckOnly").boolean(*var_120);
    }
    if let Some(var_121) = &input.target_version {
        object.key("TargetVersion").string(var_121);
    }
    Ok(())
}

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

pub fn serialize_structure_crate_model_advanced_security_options_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AdvancedSecurityOptionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_124) = &input.enabled {
        object.key("Enabled").boolean(*var_124);
    }
    if let Some(var_125) = &input.internal_user_database_enabled {
        object.key("InternalUserDatabaseEnabled").boolean(*var_125);
    }
    if let Some(var_126) = &input.master_user_options {
        let mut object_127 = object.key("MasterUserOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_master_user_options(
            &mut object_127,
            var_126,
        )?;
        object_127.finish();
    }
    if let Some(var_128) = &input.saml_options {
        let mut object_129 = object.key("SAMLOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_saml_options_input(
            &mut object_129,
            var_128,
        )?;
        object_129.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_auto_tune_options_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AutoTuneOptionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_130) = &input.desired_state {
        object.key("DesiredState").string(var_130.as_str());
    }
    if let Some(var_131) = &input.maintenance_schedules {
        let mut array_132 = object.key("MaintenanceSchedules").start_array();
        for item_133 in var_131 {
            {
                let mut object_134 = array_132.value().start_object();
                crate::json_ser::serialize_structure_crate_model_auto_tune_maintenance_schedule(
                    &mut object_134,
                    item_133,
                )?;
                object_134.finish();
            }
        }
        array_132.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_cluster_config(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ClusterConfig,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_135) = &input.instance_type {
        object.key("InstanceType").string(var_135.as_str());
    }
    if let Some(var_136) = &input.instance_count {
        object.key("InstanceCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_136).into()),
        );
    }
    if let Some(var_137) = &input.dedicated_master_enabled {
        object.key("DedicatedMasterEnabled").boolean(*var_137);
    }
    if let Some(var_138) = &input.zone_awareness_enabled {
        object.key("ZoneAwarenessEnabled").boolean(*var_138);
    }
    if let Some(var_139) = &input.zone_awareness_config {
        let mut object_140 = object.key("ZoneAwarenessConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_zone_awareness_config(
            &mut object_140,
            var_139,
        )?;
        object_140.finish();
    }
    if let Some(var_141) = &input.dedicated_master_type {
        object.key("DedicatedMasterType").string(var_141.as_str());
    }
    if let Some(var_142) = &input.dedicated_master_count {
        object.key("DedicatedMasterCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_142).into()),
        );
    }
    if let Some(var_143) = &input.warm_enabled {
        object.key("WarmEnabled").boolean(*var_143);
    }
    if let Some(var_144) = &input.warm_type {
        object.key("WarmType").string(var_144.as_str());
    }
    if let Some(var_145) = &input.warm_count {
        object.key("WarmCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_145).into()),
        );
    }
    if let Some(var_146) = &input.cold_storage_options {
        let mut object_147 = object.key("ColdStorageOptions").start_object();
        crate::json_ser::serialize_structure_crate_model_cold_storage_options(
            &mut object_147,
            var_146,
        )?;
        object_147.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_cognito_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::CognitoOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_148) = &input.enabled {
        object.key("Enabled").boolean(*var_148);
    }
    if let Some(var_149) = &input.user_pool_id {
        object.key("UserPoolId").string(var_149);
    }
    if let Some(var_150) = &input.identity_pool_id {
        object.key("IdentityPoolId").string(var_150);
    }
    if let Some(var_151) = &input.role_arn {
        object.key("RoleArn").string(var_151);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_domain_endpoint_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DomainEndpointOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_152) = &input.enforce_https {
        object.key("EnforceHTTPS").boolean(*var_152);
    }
    if let Some(var_153) = &input.tls_security_policy {
        object.key("TLSSecurityPolicy").string(var_153.as_str());
    }
    if let Some(var_154) = &input.custom_endpoint_enabled {
        object.key("CustomEndpointEnabled").boolean(*var_154);
    }
    if let Some(var_155) = &input.custom_endpoint {
        object.key("CustomEndpoint").string(var_155);
    }
    if let Some(var_156) = &input.custom_endpoint_certificate_arn {
        object.key("CustomEndpointCertificateArn").string(var_156);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_ebs_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::EbsOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_157) = &input.ebs_enabled {
        object.key("EBSEnabled").boolean(*var_157);
    }
    if let Some(var_158) = &input.volume_type {
        object.key("VolumeType").string(var_158.as_str());
    }
    if let Some(var_159) = &input.volume_size {
        object.key("VolumeSize").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_159).into()),
        );
    }
    if let Some(var_160) = &input.iops {
        object.key("Iops").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_160).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_encryption_at_rest_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::EncryptionAtRestOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_161) = &input.enabled {
        object.key("Enabled").boolean(*var_161);
    }
    if let Some(var_162) = &input.kms_key_id {
        object.key("KmsKeyId").string(var_162);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_log_publishing_option(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::LogPublishingOption,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_163) = &input.cloud_watch_logs_log_group_arn {
        object.key("CloudWatchLogsLogGroupArn").string(var_163);
    }
    if let Some(var_164) = &input.enabled {
        object.key("Enabled").boolean(*var_164);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_node_to_node_encryption_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NodeToNodeEncryptionOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_165) = &input.enabled {
        object.key("Enabled").boolean(*var_165);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_snapshot_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SnapshotOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_166) = &input.automated_snapshot_start_hour {
        object.key("AutomatedSnapshotStartHour").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_166).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_vpc_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::VpcOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_167) = &input.subnet_ids {
        let mut array_168 = object.key("SubnetIds").start_array();
        for item_169 in var_167 {
            {
                array_168.value().string(item_169);
            }
        }
        array_168.finish();
    }
    if let Some(var_170) = &input.security_group_ids {
        let mut array_171 = object.key("SecurityGroupIds").start_array();
        for item_172 in var_170 {
            {
                array_171.value().string(item_172);
            }
        }
        array_171.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_domain_information_container(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DomainInformationContainer,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_173) = &input.aws_domain_information {
        let mut object_174 = object.key("AWSDomainInformation").start_object();
        crate::json_ser::serialize_structure_crate_model_aws_domain_information(
            &mut object_174,
            var_173,
        )?;
        object_174.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_package_source(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::PackageSource,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_175) = &input.s3_bucket_name {
        object.key("S3BucketName").string(var_175);
    }
    if let Some(var_176) = &input.s3_key {
        object.key("S3Key").string(var_176);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_filter(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Filter,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_177) = &input.name {
        object.key("Name").string(var_177);
    }
    if let Some(var_178) = &input.values {
        let mut array_179 = object.key("Values").start_array();
        for item_180 in var_178 {
            {
                array_179.value().string(item_180);
            }
        }
        array_179.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_describe_packages_filter(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DescribePackagesFilter,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_181) = &input.name {
        object.key("Name").string(var_181.as_str());
    }
    if let Some(var_182) = &input.value {
        let mut array_183 = object.key("Value").start_array();
        for item_184 in var_182 {
            {
                array_183.value().string(item_184);
            }
        }
        array_183.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_auto_tune_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AutoTuneOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_185) = &input.desired_state {
        object.key("DesiredState").string(var_185.as_str());
    }
    if let Some(var_186) = &input.rollback_on_disable {
        object.key("RollbackOnDisable").string(var_186.as_str());
    }
    if let Some(var_187) = &input.maintenance_schedules {
        let mut array_188 = object.key("MaintenanceSchedules").start_array();
        for item_189 in var_187 {
            {
                let mut object_190 = array_188.value().start_object();
                crate::json_ser::serialize_structure_crate_model_auto_tune_maintenance_schedule(
                    &mut object_190,
                    item_189,
                )?;
                object_190.finish();
            }
        }
        array_188.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_master_user_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::MasterUserOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_191) = &input.master_user_arn {
        object.key("MasterUserARN").string(var_191);
    }
    if let Some(var_192) = &input.master_user_name {
        object.key("MasterUserName").string(var_192);
    }
    if let Some(var_193) = &input.master_user_password {
        object.key("MasterUserPassword").string(var_193);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_saml_options_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SamlOptionsInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_194) = &input.enabled {
        object.key("Enabled").boolean(*var_194);
    }
    if let Some(var_195) = &input.idp {
        let mut object_196 = object.key("Idp").start_object();
        crate::json_ser::serialize_structure_crate_model_saml_idp(&mut object_196, var_195)?;
        object_196.finish();
    }
    if let Some(var_197) = &input.master_user_name {
        object.key("MasterUserName").string(var_197);
    }
    if let Some(var_198) = &input.master_backend_role {
        object.key("MasterBackendRole").string(var_198);
    }
    if let Some(var_199) = &input.subject_key {
        object.key("SubjectKey").string(var_199);
    }
    if let Some(var_200) = &input.roles_key {
        object.key("RolesKey").string(var_200);
    }
    if let Some(var_201) = &input.session_timeout_minutes {
        object.key("SessionTimeoutMinutes").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_201).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_auto_tune_maintenance_schedule(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AutoTuneMaintenanceSchedule,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_202) = &input.start_at {
        object
            .key("StartAt")
            .date_time(var_202, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_203) = &input.duration {
        let mut object_204 = object.key("Duration").start_object();
        crate::json_ser::serialize_structure_crate_model_duration(&mut object_204, var_203)?;
        object_204.finish();
    }
    if let Some(var_205) = &input.cron_expression_for_recurrence {
        object.key("CronExpressionForRecurrence").string(var_205);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_zone_awareness_config(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ZoneAwarenessConfig,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_206) = &input.availability_zone_count {
        object.key("AvailabilityZoneCount").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_206).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_model_cold_storage_options(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ColdStorageOptions,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_207) = &input.enabled {
        object.key("Enabled").boolean(*var_207);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_aws_domain_information(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AwsDomainInformation,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_208) = &input.owner_id {
        object.key("OwnerId").string(var_208);
    }
    if let Some(var_209) = &input.domain_name {
        object.key("DomainName").string(var_209);
    }
    if let Some(var_210) = &input.region {
        object.key("Region").string(var_210);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_saml_idp(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SamlIdp,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if let Some(var_211) = &input.metadata_content {
        object.key("MetadataContent").string(var_211);
    }
    if let Some(var_212) = &input.entity_id {
        object.key("EntityId").string(var_212);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_duration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Duration,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
    if input.value != 0 {
        object.key("Value").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((input.value).into()),
        );
    }
    if let Some(var_213) = &input.unit {
        object.key("Unit").string(var_213.as_str());
    }
    Ok(())
}
