// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_create_as2_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateAs2ConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_1) = &input.inbound_settings {
        #[allow(unused_mut)]
        let mut object_2 = object.key("inboundSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_inbound_fields(&mut object_2, var_1)?;
        object_2.finish();
    }
    if let Some(var_3) = &input.local_as2_id {
        object.key("localAs2Id").string(var_3.as_str());
    }
    if let Some(var_4) = &input.local_encryption {
        #[allow(unused_mut)]
        let mut object_5 = object.key("localEncryption").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_local_certificate(
            &mut object_5,
            var_4,
        )?;
        object_5.finish();
    }
    if let Some(var_6) = &input.local_signing {
        #[allow(unused_mut)]
        let mut object_7 = object.key("localSigning").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_local_certificate(
            &mut object_7,
            var_6,
        )?;
        object_7.finish();
    }
    if let Some(var_8) = &input.name {
        object.key("name").string(var_8.as_str());
    }
    if let Some(var_9) = &input.outbound_settings {
        #[allow(unused_mut)]
        let mut object_10 = object.key("outboundSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_outbound_fields(
            &mut object_10,
            var_9,
        )?;
        object_10.finish();
    }
    if let Some(var_11) = &input.partner_as2_id {
        object.key("partnerAs2Id").string(var_11.as_str());
    }
    if let Some(var_12) = &input.partner_encryption {
        #[allow(unused_mut)]
        let mut object_13 = object.key("partnerEncryption").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_partner_certificate(
            &mut object_13,
            var_12,
        )?;
        object_13.finish();
    }
    if let Some(var_14) = &input.partner_signing {
        #[allow(unused_mut)]
        let mut object_15 = object.key("partnerSigning").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_partner_certificate(
            &mut object_15,
            var_14,
        )?;
        object_15.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_bucket_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateBucketConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_16) = &input.bucket_name {
        object.key("bucketName").string(var_16.as_str());
    }
    if let Some(var_17) = &input.delete_inbound_files_on_receipt {
        object.key("deleteInboundFilesOnReceipt").boolean(*var_17);
    }
    if let Some(var_18) = &input.inbound_subdirectory {
        object.key("inboundSubdirectory").string(var_18.as_str());
    }
    if let Some(var_19) = &input.name {
        object.key("name").string(var_19.as_str());
    }
    if let Some(var_20) = &input.outbound_subdirectory {
        object.key("outboundSubdirectory").string(var_20.as_str());
    }
    if let Some(var_21) = &input.parent_directory {
        object.key("parentDirectory").string(var_21.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_global_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGlobalConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_22) = &input.bucket_name {
        object.key("bucketName").string(var_22.as_str());
    }
    if let Some(var_23) = &input.name {
        object.key("name").string(var_23.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_inbound_x12_transaction_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateInboundX12TransactionSettingsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_24) = &input.enable_fragments {
        object.key("enableFragments").boolean(*var_24);
    }
    if let Some(var_25) = &input.fragment_size {
        object.key("fragmentSize").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_25).into()),
        );
    }
    if let Some(var_26) = &input.guide_id {
        object.key("guideId").string(var_26.as_str());
    }
    if let Some(var_27) = &input.release {
        object.key("release").string(var_27.as_str());
    }
    if let Some(var_28) = &input.transaction_set_identifier {
        object
            .key("transactionSetIdentifier")
            .string(var_28.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_outbound_x12_transaction_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateOutboundX12TransactionSettingsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_29) = &input.connection {
        #[allow(unused_mut)]
        let mut object_30 = object.key("connection").start_object();
        crate::json_ser::serialize_structure_crate_model_outbound_connection(
            &mut object_30,
            var_29,
        )?;
        object_30.finish();
    }
    if let Some(var_31) = &input.guide_id {
        object.key("guideId").string(var_31.as_str());
    }
    if let Some(var_32) = &input.local_application_id {
        object.key("localApplicationId").string(var_32.as_str());
    }
    if let Some(var_33) = &input.outbound_x12_transaction_settings_id {
        object
            .key("outboundX12TransactionSettingsId")
            .string(var_33.as_str());
    }
    if let Some(var_34) = &input.partner_application_id {
        object.key("partnerApplicationId").string(var_34.as_str());
    }
    if let Some(var_35) = &input.release {
        object.key("release").string(var_35.as_str());
    }
    if let Some(var_36) = &input.transaction_set_identifier {
        object
            .key("transactionSetIdentifier")
            .string(var_36.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_remote_ftp_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateRemoteFtpConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_37) = &input.algorithms {
        #[allow(unused_mut)]
        let mut object_38 = object.key("algorithms").start_object();
        crate::json_ser::serialize_structure_crate_model_remote_ftp_algorithms(
            &mut object_38,
            var_37,
        )?;
        object_38.finish();
    }
    if let Some(var_39) = &input.delete_after_retrieval {
        object.key("deleteAfterRetrieval").boolean(*var_39);
    }
    if let Some(var_40) = &input.enable_polling {
        object.key("enablePolling").boolean(*var_40);
    }
    if let Some(var_41) = &input.host {
        object.key("host").string(var_41.as_str());
    }
    if let Some(var_42) = &input.ignore_file_timestamps {
        object.key("ignoreFileTimestamps").boolean(*var_42);
    }
    if let Some(var_43) = &input.inbound_subdirectory {
        object.key("inboundSubdirectory").string(var_43.as_str());
    }
    if let Some(var_44) = &input.last_poll_at {
        object
            .key("lastPollAt")
            .date_time(var_44, aws_smithy_types::date_time::Format::DateTime)?;
    }
    if let Some(var_45) = &input.name {
        object.key("name").string(var_45.as_str());
    }
    if let Some(var_46) = &input.outbound_subdirectory {
        object.key("outboundSubdirectory").string(var_46.as_str());
    }
    if let Some(var_47) = &input.passphrase {
        object.key("passphrase").string(var_47.as_str());
    }
    if let Some(var_48) = &input.password {
        object.key("password").string(var_48.as_str());
    }
    if let Some(var_49) = &input.polling_interval {
        object.key("pollingInterval").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_49).into()),
        );
    }
    if let Some(var_50) = &input.polling_interval_unit {
        object.key("pollingIntervalUnit").string(var_50.as_str());
    }
    if let Some(var_51) = &input.port {
        object.key("port").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_51).into()),
        );
    }
    if let Some(var_52) = &input.private_key {
        object.key("privateKey").string(var_52.as_str());
    }
    if let Some(var_53) = &input.ready_timeout {
        object.key("readyTimeout").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_53).into()),
        );
    }
    if let Some(var_54) = &input.retries {
        object.key("retries").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_54).into()),
        );
    }
    if let Some(var_55) = &input.root_directory {
        object.key("rootDirectory").string(var_55.as_str());
    }
    if let Some(var_56) = &input.timeout {
        object.key("timeout").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_56).into()),
        );
    }
    if let Some(var_57) = &input.username {
        object.key("username").string(var_57.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_stedi_ftp_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateStediFtpConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_58) = &input.bucket_name {
        object.key("bucketName").string(var_58.as_str());
    }
    if let Some(var_59) = &input.delete_inbound_files_on_receipt {
        object.key("deleteInboundFilesOnReceipt").boolean(*var_59);
    }
    if let Some(var_60) = &input.home_directory {
        object.key("homeDirectory").string(var_60.as_str());
    }
    if let Some(var_61) = &input.inbound_subdirectory {
        object.key("inboundSubdirectory").string(var_61.as_str());
    }
    if let Some(var_62) = &input.name {
        object.key("name").string(var_62.as_str());
    }
    if let Some(var_63) = &input.outbound_subdirectory {
        object.key("outboundSubdirectory").string(var_63.as_str());
    }
    if let Some(var_64) = &input.username {
        object.key("username").string(var_64.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_x12_partnership_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateX12PartnershipInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_65) = &input.ack_configuration {
        #[allow(unused_mut)]
        let mut object_66 = object.key("ackConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_x12_partnership_ack_configuration(
            &mut object_66,
            var_65,
        )?;
        object_66.finish();
    }
    if let Some(var_67) = &input.interchange_usage_indicator {
        object
            .key("interchangeUsageIndicator")
            .string(var_67.as_str());
    }
    if let Some(var_68) = &input.local_profile_id {
        object.key("localProfileId").string(var_68.as_str());
    }
    if let Some(var_69) = &input.partner_profile_id {
        object.key("partnerProfileId").string(var_69.as_str());
    }
    if let Some(var_70) = &input.partnership_id {
        object.key("partnershipId").string(var_70.as_str());
    }
    if let Some(var_71) = &input.time_format {
        object.key("timeFormat").string(var_71.as_str());
    }
    if let Some(var_72) = &input.timezone {
        object.key("timezone").string(var_72.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_x12_profile_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateX12ProfileInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_73) = &input.application_identifiers {
        let mut array_74 = object.key("applicationIdentifiers").start_array();
        for item_75 in var_73 {
            {
                #[allow(unused_mut)]
                let mut object_76 = array_74.value().start_object();
                crate::json_ser::serialize_structure_crate_model_x12_application_id(
                    &mut object_76,
                    item_75,
                )?;
                object_76.finish();
            }
        }
        array_74.finish();
    }
    if let Some(var_77) = &input.interchange_id {
        object.key("interchangeId").string(var_77.as_str());
    }
    if let Some(var_78) = &input.interchange_qualifier {
        object.key("interchangeQualifier").string(var_78.as_str());
    }
    if let Some(var_79) = &input.profile_id {
        object.key("profileId").string(var_79.as_str());
    }
    if let Some(var_80) = &input.profile_type {
        object.key("profileType").string(var_80.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_generate_edi_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GenerateEdiInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_81) = &input.filename {
        object.key("filename").string(var_81.as_str());
    }
    if let Some(var_82) = &input.interchange_authorization {
        #[allow(unused_mut)]
        let mut object_83 = object.key("interchangeAuthorization").start_object();
        crate::json_ser::serialize_structure_crate_model_x12_interchange_authorization(
            &mut object_83,
            var_82,
        )?;
        object_83.finish();
    }
    if let Some(var_84) = &input.interchange_usage_indicator_override {
        object
            .key("interchangeUsageIndicatorOverride")
            .string(var_84.as_str());
    }
    if let Some(var_85) = &input.transaction_groups {
        let mut array_86 = object.key("transactionGroups").start_array();
        for item_87 in var_85 {
            {
                #[allow(unused_mut)]
                let mut object_88 = array_86.value().start_object();
                crate::json_ser::serialize_structure_crate_model_transaction_group(
                    &mut object_88,
                    item_87,
                )?;
                object_88.finish();
            }
        }
        array_86.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_x12_partnership_by_interchanges_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetX12PartnershipByInterchangesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_89) = &input.local_interchange_identifier {
        #[allow(unused_mut)]
        let mut object_90 = object.key("localInterchangeIdentifier").start_object();
        crate::json_ser::serialize_structure_crate_model_x12_interchange_identifier(
            &mut object_90,
            var_89,
        )?;
        object_90.finish();
    }
    if let Some(var_91) = &input.partner_interchange_identifier {
        #[allow(unused_mut)]
        let mut object_92 = object.key("partnerInterchangeIdentifier").start_object();
        crate::json_ser::serialize_structure_crate_model_x12_interchange_identifier(
            &mut object_92,
            var_91,
        )?;
        object_92.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_x12_profile_by_interchange_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetX12ProfileByInterchangeInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_93) = &input.interchange_identifier {
        #[allow(unused_mut)]
        let mut object_94 = object.key("interchangeIdentifier").start_object();
        crate::json_ser::serialize_structure_crate_model_x12_interchange_identifier(
            &mut object_94,
            var_93,
        )?;
        object_94.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_increment_x12_control_number_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::IncrementX12ControlNumberInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_95) = &input.control_number_type {
        object.key("controlNumberType").string(var_95.as_str());
    }
    if let Some(var_96) = &input.partnership_id {
        object.key("partnershipId").string(var_96.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_set_outbound_x12_control_number_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::SetOutboundX12ControlNumberInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_97) = &input.control_number_type {
        object.key("controlNumberType").string(var_97.as_str());
    }
    if let Some(var_98) = &input.x12_control_number {
        object.key("x12ControlNumber").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_98).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_as2_basic_auth_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateAs2BasicAuthInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_99) = &input.password {
        object.key("password").string(var_99.as_str());
    }
    if let Some(var_100) = &input.username {
        object.key("username").string(var_100.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_as2_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateAs2ConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_101) = &input.enabled {
        object.key("enabled").boolean(*var_101);
    }
    if let Some(var_102) = &input.inbound_settings {
        #[allow(unused_mut)]
        let mut object_103 = object.key("inboundSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_inbound_fields(
            &mut object_103,
            var_102,
        )?;
        object_103.finish();
    }
    if let Some(var_104) = &input.local_as2_id {
        object.key("localAs2Id").string(var_104.as_str());
    }
    if let Some(var_105) = &input.name {
        object.key("name").string(var_105.as_str());
    }
    if let Some(var_106) = &input.outbound_settings {
        #[allow(unused_mut)]
        let mut object_107 = object.key("outboundSettings").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_outbound_fields(
            &mut object_107,
            var_106,
        )?;
        object_107.finish();
    }
    if let Some(var_108) = &input.partner_as2_id {
        object.key("partnerAs2Id").string(var_108.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_as2_credentials_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateAs2CredentialsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_109) = &input.local_encryption {
        #[allow(unused_mut)]
        let mut object_110 = object.key("localEncryption").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_local_certificate(
            &mut object_110,
            var_109,
        )?;
        object_110.finish();
    }
    if let Some(var_111) = &input.local_signing {
        #[allow(unused_mut)]
        let mut object_112 = object.key("localSigning").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_local_certificate(
            &mut object_112,
            var_111,
        )?;
        object_112.finish();
    }
    if let Some(var_113) = &input.partner_encryption {
        #[allow(unused_mut)]
        let mut object_114 = object.key("partnerEncryption").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_partner_certificate(
            &mut object_114,
            var_113,
        )?;
        object_114.finish();
    }
    if let Some(var_115) = &input.partner_signing {
        #[allow(unused_mut)]
        let mut object_116 = object.key("partnerSigning").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_partner_certificate(
            &mut object_116,
            var_115,
        )?;
        object_116.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_bucket_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateBucketConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_117) = &input.delete_inbound_files_on_receipt {
        object.key("deleteInboundFilesOnReceipt").boolean(*var_117);
    }
    if let Some(var_118) = &input.enabled {
        object.key("enabled").boolean(*var_118);
    }
    if let Some(var_119) = &input.inbound_subdirectory {
        object.key("inboundSubdirectory").string(var_119.as_str());
    }
    if let Some(var_120) = &input.name {
        object.key("name").string(var_120.as_str());
    }
    if let Some(var_121) = &input.outbound_subdirectory {
        object.key("outboundSubdirectory").string(var_121.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_global_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGlobalConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_122) = &input.enabled {
        object.key("enabled").boolean(*var_122);
    }
    if let Some(var_123) = &input.name {
        object.key("name").string(var_123.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_inbound_x12_transaction_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateInboundX12TransactionSettingsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_124) = &input.enable_fragments {
        object.key("enableFragments").boolean(*var_124);
    }
    if let Some(var_125) = &input.fragment_size {
        object.key("fragmentSize").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_125).into()),
        );
    }
    if let Some(var_126) = &input.guide_id {
        object.key("guideId").string(var_126.as_str());
    }
    if let Some(var_127) = &input.release {
        object.key("release").string(var_127.as_str());
    }
    if let Some(var_128) = &input.transaction_set_identifier {
        object
            .key("transactionSetIdentifier")
            .string(var_128.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_outbound_x12_transaction_settings_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateOutboundX12TransactionSettingsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_129) = &input.connection {
        #[allow(unused_mut)]
        let mut object_130 = object.key("connection").start_object();
        crate::json_ser::serialize_structure_crate_model_outbound_connection(
            &mut object_130,
            var_129,
        )?;
        object_130.finish();
    }
    if let Some(var_131) = &input.guide_id {
        object.key("guideId").string(var_131.as_str());
    }
    if let Some(var_132) = &input.local_application_id {
        object.key("localApplicationId").string(var_132.as_str());
    }
    if let Some(var_133) = &input.partner_application_id {
        object.key("partnerApplicationId").string(var_133.as_str());
    }
    if let Some(var_134) = &input.release {
        object.key("release").string(var_134.as_str());
    }
    if let Some(var_135) = &input.transaction_set_identifier {
        object
            .key("transactionSetIdentifier")
            .string(var_135.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_remote_ftp_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateRemoteFtpConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_136) = &input.algorithms {
        #[allow(unused_mut)]
        let mut object_137 = object.key("algorithms").start_object();
        crate::json_ser::serialize_structure_crate_model_remote_ftp_algorithms(
            &mut object_137,
            var_136,
        )?;
        object_137.finish();
    }
    if let Some(var_138) = &input.delete_after_retrieval {
        object.key("deleteAfterRetrieval").boolean(*var_138);
    }
    if let Some(var_139) = &input.enable_polling {
        object.key("enablePolling").boolean(*var_139);
    }
    if let Some(var_140) = &input.enabled {
        object.key("enabled").boolean(*var_140);
    }
    if let Some(var_141) = &input.host {
        object.key("host").string(var_141.as_str());
    }
    if let Some(var_142) = &input.ignore_file_timestamps {
        object.key("ignoreFileTimestamps").boolean(*var_142);
    }
    if let Some(var_143) = &input.inbound_subdirectory {
        object.key("inboundSubdirectory").string(var_143.as_str());
    }
    if let Some(var_144) = &input.last_poll_at {
        object
            .key("lastPollAt")
            .date_time(var_144, aws_smithy_types::date_time::Format::DateTime)?;
    }
    if let Some(var_145) = &input.name {
        object.key("name").string(var_145.as_str());
    }
    if let Some(var_146) = &input.outbound_subdirectory {
        object.key("outboundSubdirectory").string(var_146.as_str());
    }
    if let Some(var_147) = &input.polling_interval {
        object.key("pollingInterval").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_147).into()),
        );
    }
    if let Some(var_148) = &input.polling_interval_unit {
        object.key("pollingIntervalUnit").string(var_148.as_str());
    }
    if let Some(var_149) = &input.port {
        object.key("port").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_149).into()),
        );
    }
    if let Some(var_150) = &input.ready_timeout {
        object.key("readyTimeout").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_150).into()),
        );
    }
    if let Some(var_151) = &input.retries {
        object.key("retries").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_151).into()),
        );
    }
    if let Some(var_152) = &input.root_directory {
        object.key("rootDirectory").string(var_152.as_str());
    }
    if let Some(var_153) = &input.timeout {
        object.key("timeout").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_153).into()),
        );
    }
    if let Some(var_154) = &input.username {
        object.key("username").string(var_154.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_remote_ftp_credentials_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateRemoteFtpCredentialsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_155) = &input.passphrase {
        object.key("passphrase").string(var_155.as_str());
    }
    if let Some(var_156) = &input.password {
        object.key("password").string(var_156.as_str());
    }
    if let Some(var_157) = &input.private_key {
        object.key("privateKey").string(var_157.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_stedi_ftp_connection_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateStediFtpConnectionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_158) = &input.delete_inbound_files_on_receipt {
        object.key("deleteInboundFilesOnReceipt").boolean(*var_158);
    }
    if let Some(var_159) = &input.enabled {
        object.key("enabled").boolean(*var_159);
    }
    if let Some(var_160) = &input.inbound_subdirectory {
        object.key("inboundSubdirectory").string(var_160.as_str());
    }
    if let Some(var_161) = &input.name {
        object.key("name").string(var_161.as_str());
    }
    if let Some(var_162) = &input.outbound_subdirectory {
        object.key("outboundSubdirectory").string(var_162.as_str());
    }
    if let Some(var_163) = &input.username {
        object.key("username").string(var_163.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_x12_partnership_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateX12PartnershipInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_164) = &input.ack_configuration {
        #[allow(unused_mut)]
        let mut object_165 = object.key("ackConfiguration").start_object();
        crate::json_ser::serialize_structure_crate_model_x12_partnership_ack_configuration(
            &mut object_165,
            var_164,
        )?;
        object_165.finish();
    }
    if let Some(var_166) = &input.interchange_usage_indicator {
        object
            .key("interchangeUsageIndicator")
            .string(var_166.as_str());
    }
    if let Some(var_167) = &input.time_format {
        object.key("timeFormat").string(var_167.as_str());
    }
    if let Some(var_168) = &input.timezone {
        object.key("timezone").string(var_168.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_x12_profile_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateX12ProfileInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_169) = &input.application_identifiers {
        let mut array_170 = object.key("applicationIdentifiers").start_array();
        for item_171 in var_169 {
            {
                #[allow(unused_mut)]
                let mut object_172 = array_170.value().start_object();
                crate::json_ser::serialize_structure_crate_model_x12_application_id(
                    &mut object_172,
                    item_171,
                )?;
                object_172.finish();
            }
        }
        array_170.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_as2_inbound_fields(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::As2InboundFields,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    {
        object.key("enabled").boolean(input.enabled);
    }
    if let Some(var_173) = &input.encryption_algorithm {
        object.key("encryptionAlgorithm").string(var_173.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_as2_local_certificate(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::As2LocalCertificate,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    {
        object.key("remove").boolean(input.remove);
    }
    if let Some(var_174) = &input.private_key {
        object.key("privateKey").string(var_174.as_str());
    }
    if let Some(var_175) = &input.public_certificate {
        object.key("publicCertificate").string(var_175.as_str());
    }
    if let Some(var_176) = &input.certificate_chain {
        object.key("certificateChain").string(var_176.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_as2_outbound_fields(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::As2OutboundFields,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    {
        object.key("enabled").boolean(input.enabled);
    }
    if let Some(var_177) = &input.partner_server_url {
        object.key("partnerServerUrl").string(var_177.as_str());
    }
    if let Some(var_178) = &input.encryption_algorithm {
        object.key("encryptionAlgorithm").string(var_178.as_str());
    }
    if let Some(var_179) = &input.mdn_response {
        object.key("mdnResponse").string(var_179.as_str());
    }
    if let Some(var_180) = &input.basic_auth {
        #[allow(unused_mut)]
        let mut object_181 = object.key("basicAuth").start_object();
        crate::json_ser::serialize_structure_crate_model_as2_outbound_basic_auth(
            &mut object_181,
            var_180,
        )?;
        object_181.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_as2_partner_certificate(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::As2PartnerCertificate,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    {
        object.key("remove").boolean(input.remove);
    }
    if let Some(var_182) = &input.public_certificate {
        object.key("publicCertificate").string(var_182.as_str());
    }
    if let Some(var_183) = &input.certificate_chain {
        object.key("certificateChain").string(var_183.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_outbound_connection(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::OutboundConnection,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_184) = &input.connection_type {
        object.key("connectionType").string(var_184.as_str());
    }
    if let Some(var_185) = &input.connection_id {
        object.key("connectionId").string(var_185.as_str());
    }
    if let Some(var_186) = &input.subdirectory {
        object.key("subdirectory").string(var_186.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_remote_ftp_algorithms(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RemoteFtpAlgorithms,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_187) = &input.kex {
        let mut array_188 = object.key("kex").start_array();
        for item_189 in var_187 {
            {
                array_188.value().string(item_189.as_str());
            }
        }
        array_188.finish();
    }
    if let Some(var_190) = &input.cipher {
        let mut array_191 = object.key("cipher").start_array();
        for item_192 in var_190 {
            {
                array_191.value().string(item_192.as_str());
            }
        }
        array_191.finish();
    }
    if let Some(var_193) = &input.server_host_key {
        let mut array_194 = object.key("serverHostKey").start_array();
        for item_195 in var_193 {
            {
                array_194.value().string(item_195.as_str());
            }
        }
        array_194.finish();
    }
    if let Some(var_196) = &input.hmac {
        let mut array_197 = object.key("hmac").start_array();
        for item_198 in var_196 {
            {
                array_197.value().string(item_198.as_str());
            }
        }
        array_197.finish();
    }
    if let Some(var_199) = &input.compress {
        let mut array_200 = object.key("compress").start_array();
        for item_201 in var_199 {
            {
                array_200.value().string(item_201.as_str());
            }
        }
        array_200.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_x12_partnership_ack_configuration(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::X12PartnershipAckConfiguration,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_202) = &input.enabled {
        object.key("enabled").boolean(*var_202);
    }
    if let Some(var_203) = &input.functional_acknowledgment_type {
        object
            .key("functionalAcknowledgmentType")
            .string(var_203.as_str());
    }
    if let Some(var_204) = &input.connection {
        #[allow(unused_mut)]
        let mut object_205 = object.key("connection").start_object();
        crate::json_ser::serialize_structure_crate_model_outbound_connection(
            &mut object_205,
            var_204,
        )?;
        object_205.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_x12_application_id(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::X12ApplicationId,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_206) = &input.value {
        object.key("value").string(var_206.as_str());
    }
    if let Some(var_207) = &input.is_default {
        object.key("isDefault").boolean(*var_207);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_x12_interchange_authorization(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::X12InterchangeAuthorization,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_208) = &input.authorization_information_qualifier {
        object
            .key("authorizationInformationQualifier")
            .string(var_208.as_str());
    }
    if let Some(var_209) = &input.authorization_information {
        object
            .key("authorizationInformation")
            .string(var_209.as_str());
    }
    if let Some(var_210) = &input.security_information_qualifier {
        object
            .key("securityInformationQualifier")
            .string(var_210.as_str());
    }
    if let Some(var_211) = &input.security_information {
        object.key("securityInformation").string(var_211.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_transaction_group(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::TransactionGroup,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_212) = &input.transaction_setting_id {
        object.key("transactionSettingId").string(var_212.as_str());
    }
    if let Some(var_213) = &input.transactions {
        let mut array_214 = object.key("transactions").start_array();
        for item_215 in var_213 {
            {
                array_214.value().document(item_215);
            }
        }
        array_214.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_model_x12_interchange_identifier(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::X12InterchangeIdentifier,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_216) = &input.interchange_qualifier {
        object.key("interchangeQualifier").string(var_216.as_str());
    }
    if let Some(var_217) = &input.interchange_id {
        object.key("interchangeId").string(var_217.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_as2_outbound_basic_auth(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::As2OutboundBasicAuth,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_218) = &input.username {
        object.key("username").string(var_218.as_str());
    }
    if let Some(var_219) = &input.password {
        object.key("password").string(var_219.as_str());
    }
    Ok(())
}
