// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_accept_direct_connect_gateway_association_proposal_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AcceptDirectConnectGatewayAssociationProposalInput,
) {
    if let Some(var_1) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_1);
    }
    if let Some(var_2) = &input.proposal_id {
        object.key("proposalId").string(var_2);
    }
    if let Some(var_3) = &input.associated_gateway_owner_account {
        object.key("associatedGatewayOwnerAccount").string(var_3);
    }
    if let Some(var_4) = &input.override_allowed_prefixes_to_direct_connect_gateway {
        let mut array_5 = object
            .key("overrideAllowedPrefixesToDirectConnectGateway")
            .start_array();
        for item_6 in var_4 {
            {
                let mut object_7 = array_5.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_7, item_6);
                object_7.finish();
            }
        }
        array_5.finish();
    }
}

pub fn serialize_structure_allocate_connection_on_interconnect_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AllocateConnectionOnInterconnectInput,
) {
    if let Some(var_8) = &input.bandwidth {
        object.key("bandwidth").string(var_8);
    }
    if let Some(var_9) = &input.connection_name {
        object.key("connectionName").string(var_9);
    }
    if let Some(var_10) = &input.owner_account {
        object.key("ownerAccount").string(var_10);
    }
    if let Some(var_11) = &input.interconnect_id {
        object.key("interconnectId").string(var_11);
    }
    {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
}

pub fn serialize_structure_allocate_hosted_connection_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AllocateHostedConnectionInput,
) {
    if let Some(var_12) = &input.connection_id {
        object.key("connectionId").string(var_12);
    }
    if let Some(var_13) = &input.owner_account {
        object.key("ownerAccount").string(var_13);
    }
    if let Some(var_14) = &input.bandwidth {
        object.key("bandwidth").string(var_14);
    }
    if let Some(var_15) = &input.connection_name {
        object.key("connectionName").string(var_15);
    }
    {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
    if let Some(var_16) = &input.tags {
        let mut array_17 = object.key("tags").start_array();
        for item_18 in var_16 {
            {
                let mut object_19 = array_17.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_19, item_18);
                object_19.finish();
            }
        }
        array_17.finish();
    }
}

pub fn serialize_structure_allocate_private_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AllocatePrivateVirtualInterfaceInput,
) {
    if let Some(var_20) = &input.connection_id {
        object.key("connectionId").string(var_20);
    }
    if let Some(var_21) = &input.owner_account {
        object.key("ownerAccount").string(var_21);
    }
    if let Some(var_22) = &input.new_private_virtual_interface_allocation {
        let mut object_23 = object
            .key("newPrivateVirtualInterfaceAllocation")
            .start_object();
        crate::json_ser::serialize_structure_new_private_virtual_interface_allocation(
            &mut object_23,
            var_22,
        );
        object_23.finish();
    }
}

pub fn serialize_structure_allocate_public_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AllocatePublicVirtualInterfaceInput,
) {
    if let Some(var_24) = &input.connection_id {
        object.key("connectionId").string(var_24);
    }
    if let Some(var_25) = &input.owner_account {
        object.key("ownerAccount").string(var_25);
    }
    if let Some(var_26) = &input.new_public_virtual_interface_allocation {
        let mut object_27 = object
            .key("newPublicVirtualInterfaceAllocation")
            .start_object();
        crate::json_ser::serialize_structure_new_public_virtual_interface_allocation(
            &mut object_27,
            var_26,
        );
        object_27.finish();
    }
}

pub fn serialize_structure_allocate_transit_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AllocateTransitVirtualInterfaceInput,
) {
    if let Some(var_28) = &input.connection_id {
        object.key("connectionId").string(var_28);
    }
    if let Some(var_29) = &input.owner_account {
        object.key("ownerAccount").string(var_29);
    }
    if let Some(var_30) = &input.new_transit_virtual_interface_allocation {
        let mut object_31 = object
            .key("newTransitVirtualInterfaceAllocation")
            .start_object();
        crate::json_ser::serialize_structure_new_transit_virtual_interface_allocation(
            &mut object_31,
            var_30,
        );
        object_31.finish();
    }
}

pub fn serialize_structure_associate_connection_with_lag_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateConnectionWithLagInput,
) {
    if let Some(var_32) = &input.connection_id {
        object.key("connectionId").string(var_32);
    }
    if let Some(var_33) = &input.lag_id {
        object.key("lagId").string(var_33);
    }
}

pub fn serialize_structure_associate_hosted_connection_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateHostedConnectionInput,
) {
    if let Some(var_34) = &input.connection_id {
        object.key("connectionId").string(var_34);
    }
    if let Some(var_35) = &input.parent_connection_id {
        object.key("parentConnectionId").string(var_35);
    }
}

pub fn serialize_structure_associate_mac_sec_key_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateMacSecKeyInput,
) {
    if let Some(var_36) = &input.connection_id {
        object.key("connectionId").string(var_36);
    }
    if let Some(var_37) = &input.secret_arn {
        object.key("secretARN").string(var_37);
    }
    if let Some(var_38) = &input.ckn {
        object.key("ckn").string(var_38);
    }
    if let Some(var_39) = &input.cak {
        object.key("cak").string(var_39);
    }
}

pub fn serialize_structure_associate_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AssociateVirtualInterfaceInput,
) {
    if let Some(var_40) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_40);
    }
    if let Some(var_41) = &input.connection_id {
        object.key("connectionId").string(var_41);
    }
}

pub fn serialize_structure_confirm_connection_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ConfirmConnectionInput,
) {
    if let Some(var_42) = &input.connection_id {
        object.key("connectionId").string(var_42);
    }
}

pub fn serialize_structure_confirm_private_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ConfirmPrivateVirtualInterfaceInput,
) {
    if let Some(var_43) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_43);
    }
    if let Some(var_44) = &input.virtual_gateway_id {
        object.key("virtualGatewayId").string(var_44);
    }
    if let Some(var_45) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_45);
    }
}

pub fn serialize_structure_confirm_public_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ConfirmPublicVirtualInterfaceInput,
) {
    if let Some(var_46) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_46);
    }
}

pub fn serialize_structure_confirm_transit_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ConfirmTransitVirtualInterfaceInput,
) {
    if let Some(var_47) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_47);
    }
    if let Some(var_48) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_48);
    }
}

pub fn serialize_structure_create_bgp_peer_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateBgpPeerInput,
) {
    if let Some(var_49) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_49);
    }
    if let Some(var_50) = &input.new_bgp_peer {
        let mut object_51 = object.key("newBGPPeer").start_object();
        crate::json_ser::serialize_structure_new_bgp_peer(&mut object_51, var_50);
        object_51.finish();
    }
}

pub fn serialize_structure_create_connection_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateConnectionInput,
) {
    if let Some(var_52) = &input.location {
        object.key("location").string(var_52);
    }
    if let Some(var_53) = &input.bandwidth {
        object.key("bandwidth").string(var_53);
    }
    if let Some(var_54) = &input.connection_name {
        object.key("connectionName").string(var_54);
    }
    if let Some(var_55) = &input.lag_id {
        object.key("lagId").string(var_55);
    }
    if let Some(var_56) = &input.tags {
        let mut array_57 = object.key("tags").start_array();
        for item_58 in var_56 {
            {
                let mut object_59 = array_57.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_59, item_58);
                object_59.finish();
            }
        }
        array_57.finish();
    }
    if let Some(var_60) = &input.provider_name {
        object.key("providerName").string(var_60);
    }
    if let Some(var_61) = &input.request_mac_sec {
        object.key("requestMACSec").boolean(*var_61);
    }
}

pub fn serialize_structure_create_direct_connect_gateway_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateDirectConnectGatewayInput,
) {
    if let Some(var_62) = &input.direct_connect_gateway_name {
        object.key("directConnectGatewayName").string(var_62);
    }
    if let Some(var_63) = &input.amazon_side_asn {
        object.key("amazonSideAsn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_63).into()),
        );
    }
}

pub fn serialize_structure_create_direct_connect_gateway_association_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateDirectConnectGatewayAssociationInput,
) {
    if let Some(var_64) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_64);
    }
    if let Some(var_65) = &input.gateway_id {
        object.key("gatewayId").string(var_65);
    }
    if let Some(var_66) = &input.add_allowed_prefixes_to_direct_connect_gateway {
        let mut array_67 = object
            .key("addAllowedPrefixesToDirectConnectGateway")
            .start_array();
        for item_68 in var_66 {
            {
                let mut object_69 = array_67.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_69, item_68);
                object_69.finish();
            }
        }
        array_67.finish();
    }
    if let Some(var_70) = &input.virtual_gateway_id {
        object.key("virtualGatewayId").string(var_70);
    }
}

pub fn serialize_structure_create_direct_connect_gateway_association_proposal_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateDirectConnectGatewayAssociationProposalInput,
) {
    if let Some(var_71) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_71);
    }
    if let Some(var_72) = &input.direct_connect_gateway_owner_account {
        object
            .key("directConnectGatewayOwnerAccount")
            .string(var_72);
    }
    if let Some(var_73) = &input.gateway_id {
        object.key("gatewayId").string(var_73);
    }
    if let Some(var_74) = &input.add_allowed_prefixes_to_direct_connect_gateway {
        let mut array_75 = object
            .key("addAllowedPrefixesToDirectConnectGateway")
            .start_array();
        for item_76 in var_74 {
            {
                let mut object_77 = array_75.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_77, item_76);
                object_77.finish();
            }
        }
        array_75.finish();
    }
    if let Some(var_78) = &input.remove_allowed_prefixes_to_direct_connect_gateway {
        let mut array_79 = object
            .key("removeAllowedPrefixesToDirectConnectGateway")
            .start_array();
        for item_80 in var_78 {
            {
                let mut object_81 = array_79.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_81, item_80);
                object_81.finish();
            }
        }
        array_79.finish();
    }
}

pub fn serialize_structure_create_interconnect_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateInterconnectInput,
) {
    if let Some(var_82) = &input.interconnect_name {
        object.key("interconnectName").string(var_82);
    }
    if let Some(var_83) = &input.bandwidth {
        object.key("bandwidth").string(var_83);
    }
    if let Some(var_84) = &input.location {
        object.key("location").string(var_84);
    }
    if let Some(var_85) = &input.lag_id {
        object.key("lagId").string(var_85);
    }
    if let Some(var_86) = &input.tags {
        let mut array_87 = object.key("tags").start_array();
        for item_88 in var_86 {
            {
                let mut object_89 = array_87.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_89, item_88);
                object_89.finish();
            }
        }
        array_87.finish();
    }
    if let Some(var_90) = &input.provider_name {
        object.key("providerName").string(var_90);
    }
}

pub fn serialize_structure_create_lag_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateLagInput,
) {
    {
        object.key("numberOfConnections").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.number_of_connections).into()),
        );
    }
    if let Some(var_91) = &input.location {
        object.key("location").string(var_91);
    }
    if let Some(var_92) = &input.connections_bandwidth {
        object.key("connectionsBandwidth").string(var_92);
    }
    if let Some(var_93) = &input.lag_name {
        object.key("lagName").string(var_93);
    }
    if let Some(var_94) = &input.connection_id {
        object.key("connectionId").string(var_94);
    }
    if let Some(var_95) = &input.tags {
        let mut array_96 = object.key("tags").start_array();
        for item_97 in var_95 {
            {
                let mut object_98 = array_96.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_98, item_97);
                object_98.finish();
            }
        }
        array_96.finish();
    }
    if let Some(var_99) = &input.child_connection_tags {
        let mut array_100 = object.key("childConnectionTags").start_array();
        for item_101 in var_99 {
            {
                let mut object_102 = array_100.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_102, item_101);
                object_102.finish();
            }
        }
        array_100.finish();
    }
    if let Some(var_103) = &input.provider_name {
        object.key("providerName").string(var_103);
    }
    if let Some(var_104) = &input.request_mac_sec {
        object.key("requestMACSec").boolean(*var_104);
    }
}

pub fn serialize_structure_create_private_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreatePrivateVirtualInterfaceInput,
) {
    if let Some(var_105) = &input.connection_id {
        object.key("connectionId").string(var_105);
    }
    if let Some(var_106) = &input.new_private_virtual_interface {
        let mut object_107 = object.key("newPrivateVirtualInterface").start_object();
        crate::json_ser::serialize_structure_new_private_virtual_interface(
            &mut object_107,
            var_106,
        );
        object_107.finish();
    }
}

pub fn serialize_structure_create_public_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreatePublicVirtualInterfaceInput,
) {
    if let Some(var_108) = &input.connection_id {
        object.key("connectionId").string(var_108);
    }
    if let Some(var_109) = &input.new_public_virtual_interface {
        let mut object_110 = object.key("newPublicVirtualInterface").start_object();
        crate::json_ser::serialize_structure_new_public_virtual_interface(&mut object_110, var_109);
        object_110.finish();
    }
}

pub fn serialize_structure_create_transit_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateTransitVirtualInterfaceInput,
) {
    if let Some(var_111) = &input.connection_id {
        object.key("connectionId").string(var_111);
    }
    if let Some(var_112) = &input.new_transit_virtual_interface {
        let mut object_113 = object.key("newTransitVirtualInterface").start_object();
        crate::json_ser::serialize_structure_new_transit_virtual_interface(
            &mut object_113,
            var_112,
        );
        object_113.finish();
    }
}

pub fn serialize_structure_delete_bgp_peer_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteBgpPeerInput,
) {
    if let Some(var_114) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_114);
    }
    if input.asn != 0 {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_115) = &input.customer_address {
        object.key("customerAddress").string(var_115);
    }
    if let Some(var_116) = &input.bgp_peer_id {
        object.key("bgpPeerId").string(var_116);
    }
}

pub fn serialize_structure_delete_connection_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteConnectionInput,
) {
    if let Some(var_117) = &input.connection_id {
        object.key("connectionId").string(var_117);
    }
}

pub fn serialize_structure_delete_direct_connect_gateway_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteDirectConnectGatewayInput,
) {
    if let Some(var_118) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_118);
    }
}

pub fn serialize_structure_delete_direct_connect_gateway_association_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteDirectConnectGatewayAssociationInput,
) {
    if let Some(var_119) = &input.association_id {
        object.key("associationId").string(var_119);
    }
    if let Some(var_120) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_120);
    }
    if let Some(var_121) = &input.virtual_gateway_id {
        object.key("virtualGatewayId").string(var_121);
    }
}

pub fn serialize_structure_delete_direct_connect_gateway_association_proposal_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteDirectConnectGatewayAssociationProposalInput,
) {
    if let Some(var_122) = &input.proposal_id {
        object.key("proposalId").string(var_122);
    }
}

pub fn serialize_structure_delete_interconnect_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteInterconnectInput,
) {
    if let Some(var_123) = &input.interconnect_id {
        object.key("interconnectId").string(var_123);
    }
}

pub fn serialize_structure_delete_lag_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteLagInput,
) {
    if let Some(var_124) = &input.lag_id {
        object.key("lagId").string(var_124);
    }
}

pub fn serialize_structure_delete_virtual_interface_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteVirtualInterfaceInput,
) {
    if let Some(var_125) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_125);
    }
}

pub fn serialize_structure_describe_connection_loa_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeConnectionLoaInput,
) {
    if let Some(var_126) = &input.connection_id {
        object.key("connectionId").string(var_126);
    }
    if let Some(var_127) = &input.provider_name {
        object.key("providerName").string(var_127);
    }
    if let Some(var_128) = &input.loa_content_type {
        object.key("loaContentType").string(var_128.as_str());
    }
}

pub fn serialize_structure_describe_connections_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeConnectionsInput,
) {
    if let Some(var_129) = &input.connection_id {
        object.key("connectionId").string(var_129);
    }
}

pub fn serialize_structure_describe_connections_on_interconnect_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeConnectionsOnInterconnectInput,
) {
    if let Some(var_130) = &input.interconnect_id {
        object.key("interconnectId").string(var_130);
    }
}

pub fn serialize_structure_describe_direct_connect_gateway_association_proposals_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeDirectConnectGatewayAssociationProposalsInput,
) {
    if let Some(var_131) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_131);
    }
    if let Some(var_132) = &input.proposal_id {
        object.key("proposalId").string(var_132);
    }
    if let Some(var_133) = &input.associated_gateway_id {
        object.key("associatedGatewayId").string(var_133);
    }
    if let Some(var_134) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_134).into()),
        );
    }
    if let Some(var_135) = &input.next_token {
        object.key("nextToken").string(var_135);
    }
}

pub fn serialize_structure_describe_direct_connect_gateway_associations_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeDirectConnectGatewayAssociationsInput,
) {
    if let Some(var_136) = &input.association_id {
        object.key("associationId").string(var_136);
    }
    if let Some(var_137) = &input.associated_gateway_id {
        object.key("associatedGatewayId").string(var_137);
    }
    if let Some(var_138) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_138);
    }
    if let Some(var_139) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_139).into()),
        );
    }
    if let Some(var_140) = &input.next_token {
        object.key("nextToken").string(var_140);
    }
    if let Some(var_141) = &input.virtual_gateway_id {
        object.key("virtualGatewayId").string(var_141);
    }
}

pub fn serialize_structure_describe_direct_connect_gateway_attachments_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeDirectConnectGatewayAttachmentsInput,
) {
    if let Some(var_142) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_142);
    }
    if let Some(var_143) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_143);
    }
    if let Some(var_144) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_144).into()),
        );
    }
    if let Some(var_145) = &input.next_token {
        object.key("nextToken").string(var_145);
    }
}

pub fn serialize_structure_describe_direct_connect_gateways_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeDirectConnectGatewaysInput,
) {
    if let Some(var_146) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_146);
    }
    if let Some(var_147) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_147).into()),
        );
    }
    if let Some(var_148) = &input.next_token {
        object.key("nextToken").string(var_148);
    }
}

pub fn serialize_structure_describe_hosted_connections_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeHostedConnectionsInput,
) {
    if let Some(var_149) = &input.connection_id {
        object.key("connectionId").string(var_149);
    }
}

pub fn serialize_structure_describe_interconnect_loa_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeInterconnectLoaInput,
) {
    if let Some(var_150) = &input.interconnect_id {
        object.key("interconnectId").string(var_150);
    }
    if let Some(var_151) = &input.provider_name {
        object.key("providerName").string(var_151);
    }
    if let Some(var_152) = &input.loa_content_type {
        object.key("loaContentType").string(var_152.as_str());
    }
}

pub fn serialize_structure_describe_interconnects_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeInterconnectsInput,
) {
    if let Some(var_153) = &input.interconnect_id {
        object.key("interconnectId").string(var_153);
    }
}

pub fn serialize_structure_describe_lags_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeLagsInput,
) {
    if let Some(var_154) = &input.lag_id {
        object.key("lagId").string(var_154);
    }
}

pub fn serialize_structure_describe_loa_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeLoaInput,
) {
    if let Some(var_155) = &input.connection_id {
        object.key("connectionId").string(var_155);
    }
    if let Some(var_156) = &input.provider_name {
        object.key("providerName").string(var_156);
    }
    if let Some(var_157) = &input.loa_content_type {
        object.key("loaContentType").string(var_157.as_str());
    }
}

pub fn serialize_structure_describe_tags_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeTagsInput,
) {
    if let Some(var_158) = &input.resource_arns {
        let mut array_159 = object.key("resourceArns").start_array();
        for item_160 in var_158 {
            {
                array_159.value().string(item_160);
            }
        }
        array_159.finish();
    }
}

pub fn serialize_structure_describe_virtual_interfaces_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeVirtualInterfacesInput,
) {
    if let Some(var_161) = &input.connection_id {
        object.key("connectionId").string(var_161);
    }
    if let Some(var_162) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_162);
    }
}

pub fn serialize_structure_disassociate_connection_from_lag_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DisassociateConnectionFromLagInput,
) {
    if let Some(var_163) = &input.connection_id {
        object.key("connectionId").string(var_163);
    }
    if let Some(var_164) = &input.lag_id {
        object.key("lagId").string(var_164);
    }
}

pub fn serialize_structure_disassociate_mac_sec_key_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DisassociateMacSecKeyInput,
) {
    if let Some(var_165) = &input.connection_id {
        object.key("connectionId").string(var_165);
    }
    if let Some(var_166) = &input.secret_arn {
        object.key("secretARN").string(var_166);
    }
}

pub fn serialize_structure_list_virtual_interface_test_history_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListVirtualInterfaceTestHistoryInput,
) {
    if let Some(var_167) = &input.test_id {
        object.key("testId").string(var_167);
    }
    if let Some(var_168) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_168);
    }
    if let Some(var_169) = &input.bgp_peers {
        let mut array_170 = object.key("bgpPeers").start_array();
        for item_171 in var_169 {
            {
                array_170.value().string(item_171);
            }
        }
        array_170.finish();
    }
    if let Some(var_172) = &input.status {
        object.key("status").string(var_172);
    }
    if let Some(var_173) = &input.max_results {
        object.key("maxResults").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_173).into()),
        );
    }
    if let Some(var_174) = &input.next_token {
        object.key("nextToken").string(var_174);
    }
}

pub fn serialize_structure_start_bgp_failover_test_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartBgpFailoverTestInput,
) {
    if let Some(var_175) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_175);
    }
    if let Some(var_176) = &input.bgp_peers {
        let mut array_177 = object.key("bgpPeers").start_array();
        for item_178 in var_176 {
            {
                array_177.value().string(item_178);
            }
        }
        array_177.finish();
    }
    if let Some(var_179) = &input.test_duration_in_minutes {
        object.key("testDurationInMinutes").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_179).into()),
        );
    }
}

pub fn serialize_structure_stop_bgp_failover_test_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopBgpFailoverTestInput,
) {
    if let Some(var_180) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_180);
    }
}

pub fn serialize_structure_tag_resource_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::TagResourceInput,
) {
    if let Some(var_181) = &input.resource_arn {
        object.key("resourceArn").string(var_181);
    }
    if let Some(var_182) = &input.tags {
        let mut array_183 = object.key("tags").start_array();
        for item_184 in var_182 {
            {
                let mut object_185 = array_183.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_185, item_184);
                object_185.finish();
            }
        }
        array_183.finish();
    }
}

pub fn serialize_structure_untag_resource_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UntagResourceInput,
) {
    if let Some(var_186) = &input.resource_arn {
        object.key("resourceArn").string(var_186);
    }
    if let Some(var_187) = &input.tag_keys {
        let mut array_188 = object.key("tagKeys").start_array();
        for item_189 in var_187 {
            {
                array_188.value().string(item_189);
            }
        }
        array_188.finish();
    }
}

pub fn serialize_structure_update_connection_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateConnectionInput,
) {
    if let Some(var_190) = &input.connection_id {
        object.key("connectionId").string(var_190);
    }
    if let Some(var_191) = &input.connection_name {
        object.key("connectionName").string(var_191);
    }
    if let Some(var_192) = &input.encryption_mode {
        object.key("encryptionMode").string(var_192);
    }
}

pub fn serialize_structure_update_direct_connect_gateway_association_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateDirectConnectGatewayAssociationInput,
) {
    if let Some(var_193) = &input.association_id {
        object.key("associationId").string(var_193);
    }
    if let Some(var_194) = &input.add_allowed_prefixes_to_direct_connect_gateway {
        let mut array_195 = object
            .key("addAllowedPrefixesToDirectConnectGateway")
            .start_array();
        for item_196 in var_194 {
            {
                let mut object_197 = array_195.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_197, item_196);
                object_197.finish();
            }
        }
        array_195.finish();
    }
    if let Some(var_198) = &input.remove_allowed_prefixes_to_direct_connect_gateway {
        let mut array_199 = object
            .key("removeAllowedPrefixesToDirectConnectGateway")
            .start_array();
        for item_200 in var_198 {
            {
                let mut object_201 = array_199.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_201, item_200);
                object_201.finish();
            }
        }
        array_199.finish();
    }
}

pub fn serialize_structure_update_lag_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateLagInput,
) {
    if let Some(var_202) = &input.lag_id {
        object.key("lagId").string(var_202);
    }
    if let Some(var_203) = &input.lag_name {
        object.key("lagName").string(var_203);
    }
    if input.minimum_links != 0 {
        object.key("minimumLinks").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.minimum_links).into()),
        );
    }
    if let Some(var_204) = &input.encryption_mode {
        object.key("encryptionMode").string(var_204);
    }
}

pub fn serialize_structure_update_virtual_interface_attributes_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateVirtualInterfaceAttributesInput,
) {
    if let Some(var_205) = &input.virtual_interface_id {
        object.key("virtualInterfaceId").string(var_205);
    }
    if let Some(var_206) = &input.mtu {
        object.key("mtu").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_206).into()),
        );
    }
}

pub fn serialize_structure_route_filter_prefix(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::RouteFilterPrefix,
) {
    if let Some(var_207) = &input.cidr {
        object.key("cidr").string(var_207);
    }
}

pub fn serialize_structure_tag(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Tag,
) {
    if let Some(var_208) = &input.key {
        object.key("key").string(var_208);
    }
    if let Some(var_209) = &input.value {
        object.key("value").string(var_209);
    }
}

pub fn serialize_structure_new_private_virtual_interface_allocation(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NewPrivateVirtualInterfaceAllocation,
) {
    if let Some(var_210) = &input.virtual_interface_name {
        object.key("virtualInterfaceName").string(var_210);
    }
    {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
    {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_211) = &input.mtu {
        object.key("mtu").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_211).into()),
        );
    }
    if let Some(var_212) = &input.auth_key {
        object.key("authKey").string(var_212);
    }
    if let Some(var_213) = &input.amazon_address {
        object.key("amazonAddress").string(var_213);
    }
    if let Some(var_214) = &input.address_family {
        object.key("addressFamily").string(var_214.as_str());
    }
    if let Some(var_215) = &input.customer_address {
        object.key("customerAddress").string(var_215);
    }
    if let Some(var_216) = &input.tags {
        let mut array_217 = object.key("tags").start_array();
        for item_218 in var_216 {
            {
                let mut object_219 = array_217.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_219, item_218);
                object_219.finish();
            }
        }
        array_217.finish();
    }
}

pub fn serialize_structure_new_public_virtual_interface_allocation(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NewPublicVirtualInterfaceAllocation,
) {
    if let Some(var_220) = &input.virtual_interface_name {
        object.key("virtualInterfaceName").string(var_220);
    }
    {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
    {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_221) = &input.auth_key {
        object.key("authKey").string(var_221);
    }
    if let Some(var_222) = &input.amazon_address {
        object.key("amazonAddress").string(var_222);
    }
    if let Some(var_223) = &input.customer_address {
        object.key("customerAddress").string(var_223);
    }
    if let Some(var_224) = &input.address_family {
        object.key("addressFamily").string(var_224.as_str());
    }
    if let Some(var_225) = &input.route_filter_prefixes {
        let mut array_226 = object.key("routeFilterPrefixes").start_array();
        for item_227 in var_225 {
            {
                let mut object_228 = array_226.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_228, item_227);
                object_228.finish();
            }
        }
        array_226.finish();
    }
    if let Some(var_229) = &input.tags {
        let mut array_230 = object.key("tags").start_array();
        for item_231 in var_229 {
            {
                let mut object_232 = array_230.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_232, item_231);
                object_232.finish();
            }
        }
        array_230.finish();
    }
}

pub fn serialize_structure_new_transit_virtual_interface_allocation(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NewTransitVirtualInterfaceAllocation,
) {
    if let Some(var_233) = &input.virtual_interface_name {
        object.key("virtualInterfaceName").string(var_233);
    }
    if input.vlan != 0 {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
    if input.asn != 0 {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_234) = &input.mtu {
        object.key("mtu").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_234).into()),
        );
    }
    if let Some(var_235) = &input.auth_key {
        object.key("authKey").string(var_235);
    }
    if let Some(var_236) = &input.amazon_address {
        object.key("amazonAddress").string(var_236);
    }
    if let Some(var_237) = &input.customer_address {
        object.key("customerAddress").string(var_237);
    }
    if let Some(var_238) = &input.address_family {
        object.key("addressFamily").string(var_238.as_str());
    }
    if let Some(var_239) = &input.tags {
        let mut array_240 = object.key("tags").start_array();
        for item_241 in var_239 {
            {
                let mut object_242 = array_240.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_242, item_241);
                object_242.finish();
            }
        }
        array_240.finish();
    }
}

pub fn serialize_structure_new_bgp_peer(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NewBgpPeer,
) {
    if input.asn != 0 {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_243) = &input.auth_key {
        object.key("authKey").string(var_243);
    }
    if let Some(var_244) = &input.address_family {
        object.key("addressFamily").string(var_244.as_str());
    }
    if let Some(var_245) = &input.amazon_address {
        object.key("amazonAddress").string(var_245);
    }
    if let Some(var_246) = &input.customer_address {
        object.key("customerAddress").string(var_246);
    }
}

pub fn serialize_structure_new_private_virtual_interface(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NewPrivateVirtualInterface,
) {
    if let Some(var_247) = &input.virtual_interface_name {
        object.key("virtualInterfaceName").string(var_247);
    }
    {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
    {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_248) = &input.mtu {
        object.key("mtu").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_248).into()),
        );
    }
    if let Some(var_249) = &input.auth_key {
        object.key("authKey").string(var_249);
    }
    if let Some(var_250) = &input.amazon_address {
        object.key("amazonAddress").string(var_250);
    }
    if let Some(var_251) = &input.customer_address {
        object.key("customerAddress").string(var_251);
    }
    if let Some(var_252) = &input.address_family {
        object.key("addressFamily").string(var_252.as_str());
    }
    if let Some(var_253) = &input.virtual_gateway_id {
        object.key("virtualGatewayId").string(var_253);
    }
    if let Some(var_254) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_254);
    }
    if let Some(var_255) = &input.tags {
        let mut array_256 = object.key("tags").start_array();
        for item_257 in var_255 {
            {
                let mut object_258 = array_256.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_258, item_257);
                object_258.finish();
            }
        }
        array_256.finish();
    }
}

pub fn serialize_structure_new_public_virtual_interface(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NewPublicVirtualInterface,
) {
    if let Some(var_259) = &input.virtual_interface_name {
        object.key("virtualInterfaceName").string(var_259);
    }
    {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
    {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_260) = &input.auth_key {
        object.key("authKey").string(var_260);
    }
    if let Some(var_261) = &input.amazon_address {
        object.key("amazonAddress").string(var_261);
    }
    if let Some(var_262) = &input.customer_address {
        object.key("customerAddress").string(var_262);
    }
    if let Some(var_263) = &input.address_family {
        object.key("addressFamily").string(var_263.as_str());
    }
    if let Some(var_264) = &input.route_filter_prefixes {
        let mut array_265 = object.key("routeFilterPrefixes").start_array();
        for item_266 in var_264 {
            {
                let mut object_267 = array_265.value().start_object();
                crate::json_ser::serialize_structure_route_filter_prefix(&mut object_267, item_266);
                object_267.finish();
            }
        }
        array_265.finish();
    }
    if let Some(var_268) = &input.tags {
        let mut array_269 = object.key("tags").start_array();
        for item_270 in var_268 {
            {
                let mut object_271 = array_269.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_271, item_270);
                object_271.finish();
            }
        }
        array_269.finish();
    }
}

pub fn serialize_structure_new_transit_virtual_interface(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::NewTransitVirtualInterface,
) {
    if let Some(var_272) = &input.virtual_interface_name {
        object.key("virtualInterfaceName").string(var_272);
    }
    if input.vlan != 0 {
        object.key("vlan").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.vlan).into()),
        );
    }
    if input.asn != 0 {
        object.key("asn").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.asn).into()),
        );
    }
    if let Some(var_273) = &input.mtu {
        object.key("mtu").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((*var_273).into()),
        );
    }
    if let Some(var_274) = &input.auth_key {
        object.key("authKey").string(var_274);
    }
    if let Some(var_275) = &input.amazon_address {
        object.key("amazonAddress").string(var_275);
    }
    if let Some(var_276) = &input.customer_address {
        object.key("customerAddress").string(var_276);
    }
    if let Some(var_277) = &input.address_family {
        object.key("addressFamily").string(var_277.as_str());
    }
    if let Some(var_278) = &input.direct_connect_gateway_id {
        object.key("directConnectGatewayId").string(var_278);
    }
    if let Some(var_279) = &input.tags {
        let mut array_280 = object.key("tags").start_array();
        for item_281 in var_279 {
            {
                let mut object_282 = array_280.value().start_object();
                crate::json_ser::serialize_structure_tag(&mut object_282, item_281);
                object_282.finish();
            }
        }
        array_280.finish();
    }
}
