// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_add_flow_media_streams_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AddFlowMediaStreamsInput,
) {
    if let Some(var_1) = &input.media_streams {
        let mut array_2 = object.key("mediaStreams").start_array();
        for item_3 in var_1 {
            {
                let mut object_4 = array_2.value().start_object();
                crate::json_ser::serialize_structure_crate_model_add_media_stream_request(
                    &mut object_4,
                    item_3,
                );
                object_4.finish();
            }
        }
        array_2.finish();
    }
}

pub fn serialize_structure_crate_input_add_flow_outputs_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AddFlowOutputsInput,
) {
    if let Some(var_5) = &input.outputs {
        let mut array_6 = object.key("outputs").start_array();
        for item_7 in var_5 {
            {
                let mut object_8 = array_6.value().start_object();
                crate::json_ser::serialize_structure_crate_model_add_output_request(
                    &mut object_8,
                    item_7,
                );
                object_8.finish();
            }
        }
        array_6.finish();
    }
}

pub fn serialize_structure_crate_input_add_flow_sources_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AddFlowSourcesInput,
) {
    if let Some(var_9) = &input.sources {
        let mut array_10 = object.key("sources").start_array();
        for item_11 in var_9 {
            {
                let mut object_12 = array_10.value().start_object();
                crate::json_ser::serialize_structure_crate_model_set_source_request(
                    &mut object_12,
                    item_11,
                );
                object_12.finish();
            }
        }
        array_10.finish();
    }
}

pub fn serialize_structure_crate_input_add_flow_vpc_interfaces_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::AddFlowVpcInterfacesInput,
) {
    if let Some(var_13) = &input.vpc_interfaces {
        let mut array_14 = object.key("vpcInterfaces").start_array();
        for item_15 in var_13 {
            {
                let mut object_16 = array_14.value().start_object();
                crate::json_ser::serialize_structure_crate_model_vpc_interface_request(
                    &mut object_16,
                    item_15,
                );
                object_16.finish();
            }
        }
        array_14.finish();
    }
}

pub fn serialize_structure_crate_input_create_flow_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateFlowInput,
) {
    if let Some(var_17) = &input.availability_zone {
        object.key("availabilityZone").string(var_17);
    }
    if let Some(var_18) = &input.entitlements {
        let mut array_19 = object.key("entitlements").start_array();
        for item_20 in var_18 {
            {
                let mut object_21 = array_19.value().start_object();
                crate::json_ser::serialize_structure_crate_model_grant_entitlement_request(
                    &mut object_21,
                    item_20,
                );
                object_21.finish();
            }
        }
        array_19.finish();
    }
    if let Some(var_22) = &input.media_streams {
        let mut array_23 = object.key("mediaStreams").start_array();
        for item_24 in var_22 {
            {
                let mut object_25 = array_23.value().start_object();
                crate::json_ser::serialize_structure_crate_model_add_media_stream_request(
                    &mut object_25,
                    item_24,
                );
                object_25.finish();
            }
        }
        array_23.finish();
    }
    if let Some(var_26) = &input.name {
        object.key("name").string(var_26);
    }
    if let Some(var_27) = &input.outputs {
        let mut array_28 = object.key("outputs").start_array();
        for item_29 in var_27 {
            {
                let mut object_30 = array_28.value().start_object();
                crate::json_ser::serialize_structure_crate_model_add_output_request(
                    &mut object_30,
                    item_29,
                );
                object_30.finish();
            }
        }
        array_28.finish();
    }
    if let Some(var_31) = &input.source {
        let mut object_32 = object.key("source").start_object();
        crate::json_ser::serialize_structure_crate_model_set_source_request(&mut object_32, var_31);
        object_32.finish();
    }
    if let Some(var_33) = &input.source_failover_config {
        let mut object_34 = object.key("sourceFailoverConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_failover_config(&mut object_34, var_33);
        object_34.finish();
    }
    if let Some(var_35) = &input.sources {
        let mut array_36 = object.key("sources").start_array();
        for item_37 in var_35 {
            {
                let mut object_38 = array_36.value().start_object();
                crate::json_ser::serialize_structure_crate_model_set_source_request(
                    &mut object_38,
                    item_37,
                );
                object_38.finish();
            }
        }
        array_36.finish();
    }
    if let Some(var_39) = &input.vpc_interfaces {
        let mut array_40 = object.key("vpcInterfaces").start_array();
        for item_41 in var_39 {
            {
                let mut object_42 = array_40.value().start_object();
                crate::json_ser::serialize_structure_crate_model_vpc_interface_request(
                    &mut object_42,
                    item_41,
                );
                object_42.finish();
            }
        }
        array_40.finish();
    }
}

pub fn serialize_structure_crate_input_grant_flow_entitlements_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GrantFlowEntitlementsInput,
) {
    if let Some(var_43) = &input.entitlements {
        let mut array_44 = object.key("entitlements").start_array();
        for item_45 in var_43 {
            {
                let mut object_46 = array_44.value().start_object();
                crate::json_ser::serialize_structure_crate_model_grant_entitlement_request(
                    &mut object_46,
                    item_45,
                );
                object_46.finish();
            }
        }
        array_44.finish();
    }
}

pub fn serialize_structure_crate_input_purchase_offering_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::PurchaseOfferingInput,
) {
    if let Some(var_47) = &input.reservation_name {
        object.key("reservationName").string(var_47);
    }
    if let Some(var_48) = &input.start {
        object.key("start").string(var_48);
    }
}

pub fn serialize_structure_crate_input_tag_resource_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::TagResourceInput,
) {
    if let Some(var_49) = &input.tags {
        let mut object_50 = object.key("tags").start_object();
        for (key_51, value_52) in var_49 {
            {
                object_50.key(key_51).string(value_52);
            }
        }
        object_50.finish();
    }
}

pub fn serialize_structure_crate_input_update_flow_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFlowInput,
) {
    if let Some(var_53) = &input.source_failover_config {
        let mut object_54 = object.key("sourceFailoverConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_update_failover_config(
            &mut object_54,
            var_53,
        );
        object_54.finish();
    }
}

pub fn serialize_structure_crate_input_update_flow_entitlement_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFlowEntitlementInput,
) {
    if let Some(var_55) = &input.description {
        object.key("description").string(var_55);
    }
    if let Some(var_56) = &input.encryption {
        let mut object_57 = object.key("encryption").start_object();
        crate::json_ser::serialize_structure_crate_model_update_encryption(&mut object_57, var_56);
        object_57.finish();
    }
    if let Some(var_58) = &input.entitlement_status {
        object.key("entitlementStatus").string(var_58.as_str());
    }
    if let Some(var_59) = &input.subscribers {
        let mut array_60 = object.key("subscribers").start_array();
        for item_61 in var_59 {
            {
                array_60.value().string(item_61);
            }
        }
        array_60.finish();
    }
}

pub fn serialize_structure_crate_input_update_flow_media_stream_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFlowMediaStreamInput,
) {
    if let Some(var_62) = &input.attributes {
        let mut object_63 = object.key("attributes").start_object();
        crate::json_ser::serialize_structure_crate_model_media_stream_attributes_request(
            &mut object_63,
            var_62,
        );
        object_63.finish();
    }
    if input.clock_rate != 0 {
        object.key("clockRate").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.clock_rate).into()),
        );
    }
    if let Some(var_64) = &input.description {
        object.key("description").string(var_64);
    }
    if let Some(var_65) = &input.media_stream_type {
        object.key("mediaStreamType").string(var_65.as_str());
    }
    if let Some(var_66) = &input.video_format {
        object.key("videoFormat").string(var_66);
    }
}

pub fn serialize_structure_crate_input_update_flow_output_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFlowOutputInput,
) {
    if let Some(var_67) = &input.cidr_allow_list {
        let mut array_68 = object.key("cidrAllowList").start_array();
        for item_69 in var_67 {
            {
                array_68.value().string(item_69);
            }
        }
        array_68.finish();
    }
    if let Some(var_70) = &input.description {
        object.key("description").string(var_70);
    }
    if let Some(var_71) = &input.destination {
        object.key("destination").string(var_71);
    }
    if let Some(var_72) = &input.encryption {
        let mut object_73 = object.key("encryption").start_object();
        crate::json_ser::serialize_structure_crate_model_update_encryption(&mut object_73, var_72);
        object_73.finish();
    }
    if input.max_latency != 0 {
        object.key("maxLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_latency).into()),
        );
    }
    if let Some(var_74) = &input.media_stream_output_configurations {
        let mut array_75 = object.key("mediaStreamOutputConfigurations").start_array();
        for item_76 in var_74 {
            {
                let mut object_77 = array_75.value().start_object();
                crate::json_ser::serialize_structure_crate_model_media_stream_output_configuration_request(&mut object_77, item_76);
                object_77.finish();
            }
        }
        array_75.finish();
    }
    if input.min_latency != 0 {
        object.key("minLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.min_latency).into()),
        );
    }
    if input.port != 0 {
        object.key("port").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.port).into()),
        );
    }
    if let Some(var_78) = &input.protocol {
        object.key("protocol").string(var_78.as_str());
    }
    if let Some(var_79) = &input.remote_id {
        object.key("remoteId").string(var_79);
    }
    if input.smoothing_latency != 0 {
        object.key("smoothingLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.smoothing_latency).into()),
        );
    }
    if let Some(var_80) = &input.stream_id {
        object.key("streamId").string(var_80);
    }
    if let Some(var_81) = &input.vpc_interface_attachment {
        let mut object_82 = object.key("vpcInterfaceAttachment").start_object();
        crate::json_ser::serialize_structure_crate_model_vpc_interface_attachment(
            &mut object_82,
            var_81,
        );
        object_82.finish();
    }
}

pub fn serialize_structure_crate_input_update_flow_source_input(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateFlowSourceInput,
) {
    if let Some(var_83) = &input.decryption {
        let mut object_84 = object.key("decryption").start_object();
        crate::json_ser::serialize_structure_crate_model_update_encryption(&mut object_84, var_83);
        object_84.finish();
    }
    if let Some(var_85) = &input.description {
        object.key("description").string(var_85);
    }
    if let Some(var_86) = &input.entitlement_arn {
        object.key("entitlementArn").string(var_86);
    }
    if input.ingest_port != 0 {
        object.key("ingestPort").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.ingest_port).into()),
        );
    }
    if input.max_bitrate != 0 {
        object.key("maxBitrate").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_bitrate).into()),
        );
    }
    if input.max_latency != 0 {
        object.key("maxLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_latency).into()),
        );
    }
    if input.max_sync_buffer != 0 {
        object.key("maxSyncBuffer").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_sync_buffer).into()),
        );
    }
    if let Some(var_87) = &input.media_stream_source_configurations {
        let mut array_88 = object.key("mediaStreamSourceConfigurations").start_array();
        for item_89 in var_87 {
            {
                let mut object_90 = array_88.value().start_object();
                crate::json_ser::serialize_structure_crate_model_media_stream_source_configuration_request(&mut object_90, item_89);
                object_90.finish();
            }
        }
        array_88.finish();
    }
    if input.min_latency != 0 {
        object.key("minLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.min_latency).into()),
        );
    }
    if let Some(var_91) = &input.protocol {
        object.key("protocol").string(var_91.as_str());
    }
    if let Some(var_92) = &input.stream_id {
        object.key("streamId").string(var_92);
    }
    if let Some(var_93) = &input.vpc_interface_name {
        object.key("vpcInterfaceName").string(var_93);
    }
    if let Some(var_94) = &input.whitelist_cidr {
        object.key("whitelistCidr").string(var_94);
    }
}

pub fn serialize_structure_crate_model_add_media_stream_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AddMediaStreamRequest,
) {
    if let Some(var_95) = &input.attributes {
        let mut object_96 = object.key("attributes").start_object();
        crate::json_ser::serialize_structure_crate_model_media_stream_attributes_request(
            &mut object_96,
            var_95,
        );
        object_96.finish();
    }
    if input.clock_rate != 0 {
        object.key("clockRate").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.clock_rate).into()),
        );
    }
    if let Some(var_97) = &input.description {
        object.key("description").string(var_97);
    }
    {
        object.key("mediaStreamId").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.media_stream_id).into()),
        );
    }
    if let Some(var_98) = &input.media_stream_name {
        object.key("mediaStreamName").string(var_98);
    }
    if let Some(var_99) = &input.media_stream_type {
        object.key("mediaStreamType").string(var_99.as_str());
    }
    if let Some(var_100) = &input.video_format {
        object.key("videoFormat").string(var_100);
    }
}

pub fn serialize_structure_crate_model_add_output_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AddOutputRequest,
) {
    if let Some(var_101) = &input.cidr_allow_list {
        let mut array_102 = object.key("cidrAllowList").start_array();
        for item_103 in var_101 {
            {
                array_102.value().string(item_103);
            }
        }
        array_102.finish();
    }
    if let Some(var_104) = &input.description {
        object.key("description").string(var_104);
    }
    if let Some(var_105) = &input.destination {
        object.key("destination").string(var_105);
    }
    if let Some(var_106) = &input.encryption {
        let mut object_107 = object.key("encryption").start_object();
        crate::json_ser::serialize_structure_crate_model_encryption(&mut object_107, var_106);
        object_107.finish();
    }
    if input.max_latency != 0 {
        object.key("maxLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_latency).into()),
        );
    }
    if let Some(var_108) = &input.media_stream_output_configurations {
        let mut array_109 = object.key("mediaStreamOutputConfigurations").start_array();
        for item_110 in var_108 {
            {
                let mut object_111 = array_109.value().start_object();
                crate::json_ser::serialize_structure_crate_model_media_stream_output_configuration_request(&mut object_111, item_110);
                object_111.finish();
            }
        }
        array_109.finish();
    }
    if input.min_latency != 0 {
        object.key("minLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.min_latency).into()),
        );
    }
    if let Some(var_112) = &input.name {
        object.key("name").string(var_112);
    }
    if input.port != 0 {
        object.key("port").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.port).into()),
        );
    }
    if let Some(var_113) = &input.protocol {
        object.key("protocol").string(var_113.as_str());
    }
    if let Some(var_114) = &input.remote_id {
        object.key("remoteId").string(var_114);
    }
    if input.smoothing_latency != 0 {
        object.key("smoothingLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.smoothing_latency).into()),
        );
    }
    if let Some(var_115) = &input.stream_id {
        object.key("streamId").string(var_115);
    }
    if let Some(var_116) = &input.vpc_interface_attachment {
        let mut object_117 = object.key("vpcInterfaceAttachment").start_object();
        crate::json_ser::serialize_structure_crate_model_vpc_interface_attachment(
            &mut object_117,
            var_116,
        );
        object_117.finish();
    }
}

pub fn serialize_structure_crate_model_set_source_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SetSourceRequest,
) {
    if let Some(var_118) = &input.decryption {
        let mut object_119 = object.key("decryption").start_object();
        crate::json_ser::serialize_structure_crate_model_encryption(&mut object_119, var_118);
        object_119.finish();
    }
    if let Some(var_120) = &input.description {
        object.key("description").string(var_120);
    }
    if let Some(var_121) = &input.entitlement_arn {
        object.key("entitlementArn").string(var_121);
    }
    if input.ingest_port != 0 {
        object.key("ingestPort").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.ingest_port).into()),
        );
    }
    if input.max_bitrate != 0 {
        object.key("maxBitrate").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_bitrate).into()),
        );
    }
    if input.max_latency != 0 {
        object.key("maxLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_latency).into()),
        );
    }
    if input.max_sync_buffer != 0 {
        object.key("maxSyncBuffer").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.max_sync_buffer).into()),
        );
    }
    if let Some(var_122) = &input.media_stream_source_configurations {
        let mut array_123 = object.key("mediaStreamSourceConfigurations").start_array();
        for item_124 in var_122 {
            {
                let mut object_125 = array_123.value().start_object();
                crate::json_ser::serialize_structure_crate_model_media_stream_source_configuration_request(&mut object_125, item_124);
                object_125.finish();
            }
        }
        array_123.finish();
    }
    if input.min_latency != 0 {
        object.key("minLatency").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.min_latency).into()),
        );
    }
    if let Some(var_126) = &input.name {
        object.key("name").string(var_126);
    }
    if let Some(var_127) = &input.protocol {
        object.key("protocol").string(var_127.as_str());
    }
    if let Some(var_128) = &input.stream_id {
        object.key("streamId").string(var_128);
    }
    if let Some(var_129) = &input.vpc_interface_name {
        object.key("vpcInterfaceName").string(var_129);
    }
    if let Some(var_130) = &input.whitelist_cidr {
        object.key("whitelistCidr").string(var_130);
    }
}

pub fn serialize_structure_crate_model_vpc_interface_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::VpcInterfaceRequest,
) {
    if let Some(var_131) = &input.name {
        object.key("name").string(var_131);
    }
    if let Some(var_132) = &input.network_interface_type {
        object.key("networkInterfaceType").string(var_132.as_str());
    }
    if let Some(var_133) = &input.role_arn {
        object.key("roleArn").string(var_133);
    }
    if let Some(var_134) = &input.security_group_ids {
        let mut array_135 = object.key("securityGroupIds").start_array();
        for item_136 in var_134 {
            {
                array_135.value().string(item_136);
            }
        }
        array_135.finish();
    }
    if let Some(var_137) = &input.subnet_id {
        object.key("subnetId").string(var_137);
    }
}

pub fn serialize_structure_crate_model_grant_entitlement_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::GrantEntitlementRequest,
) {
    if input.data_transfer_subscriber_fee_percent != 0 {
        object.key("dataTransferSubscriberFeePercent").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.data_transfer_subscriber_fee_percent).into()),
        );
    }
    if let Some(var_138) = &input.description {
        object.key("description").string(var_138);
    }
    if let Some(var_139) = &input.encryption {
        let mut object_140 = object.key("encryption").start_object();
        crate::json_ser::serialize_structure_crate_model_encryption(&mut object_140, var_139);
        object_140.finish();
    }
    if let Some(var_141) = &input.entitlement_status {
        object.key("entitlementStatus").string(var_141.as_str());
    }
    if let Some(var_142) = &input.name {
        object.key("name").string(var_142);
    }
    if let Some(var_143) = &input.subscribers {
        let mut array_144 = object.key("subscribers").start_array();
        for item_145 in var_143 {
            {
                array_144.value().string(item_145);
            }
        }
        array_144.finish();
    }
}

pub fn serialize_structure_crate_model_failover_config(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::FailoverConfig,
) {
    if let Some(var_146) = &input.failover_mode {
        object.key("failoverMode").string(var_146.as_str());
    }
    if input.recovery_window != 0 {
        object.key("recoveryWindow").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.recovery_window).into()),
        );
    }
    if let Some(var_147) = &input.source_priority {
        let mut object_148 = object.key("sourcePriority").start_object();
        crate::json_ser::serialize_structure_crate_model_source_priority(&mut object_148, var_147);
        object_148.finish();
    }
    if let Some(var_149) = &input.state {
        object.key("state").string(var_149.as_str());
    }
}

pub fn serialize_structure_crate_model_update_failover_config(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UpdateFailoverConfig,
) {
    if let Some(var_150) = &input.failover_mode {
        object.key("failoverMode").string(var_150.as_str());
    }
    if input.recovery_window != 0 {
        object.key("recoveryWindow").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.recovery_window).into()),
        );
    }
    if let Some(var_151) = &input.source_priority {
        let mut object_152 = object.key("sourcePriority").start_object();
        crate::json_ser::serialize_structure_crate_model_source_priority(&mut object_152, var_151);
        object_152.finish();
    }
    if let Some(var_153) = &input.state {
        object.key("state").string(var_153.as_str());
    }
}

pub fn serialize_structure_crate_model_update_encryption(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UpdateEncryption,
) {
    if let Some(var_154) = &input.algorithm {
        object.key("algorithm").string(var_154.as_str());
    }
    if let Some(var_155) = &input.constant_initialization_vector {
        object.key("constantInitializationVector").string(var_155);
    }
    if let Some(var_156) = &input.device_id {
        object.key("deviceId").string(var_156);
    }
    if let Some(var_157) = &input.key_type {
        object.key("keyType").string(var_157.as_str());
    }
    if let Some(var_158) = &input.region {
        object.key("region").string(var_158);
    }
    if let Some(var_159) = &input.resource_id {
        object.key("resourceId").string(var_159);
    }
    if let Some(var_160) = &input.role_arn {
        object.key("roleArn").string(var_160);
    }
    if let Some(var_161) = &input.secret_arn {
        object.key("secretArn").string(var_161);
    }
    if let Some(var_162) = &input.url {
        object.key("url").string(var_162);
    }
}

pub fn serialize_structure_crate_model_media_stream_attributes_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::MediaStreamAttributesRequest,
) {
    if let Some(var_163) = &input.fmtp {
        let mut object_164 = object.key("fmtp").start_object();
        crate::json_ser::serialize_structure_crate_model_fmtp_request(&mut object_164, var_163);
        object_164.finish();
    }
    if let Some(var_165) = &input.lang {
        object.key("lang").string(var_165);
    }
}

pub fn serialize_structure_crate_model_media_stream_output_configuration_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::MediaStreamOutputConfigurationRequest,
) {
    if let Some(var_166) = &input.destination_configurations {
        let mut array_167 = object.key("destinationConfigurations").start_array();
        for item_168 in var_166 {
            {
                let mut object_169 = array_167.value().start_object();
                crate::json_ser::serialize_structure_crate_model_destination_configuration_request(
                    &mut object_169,
                    item_168,
                );
                object_169.finish();
            }
        }
        array_167.finish();
    }
    if let Some(var_170) = &input.encoding_name {
        object.key("encodingName").string(var_170.as_str());
    }
    if let Some(var_171) = &input.encoding_parameters {
        let mut object_172 = object.key("encodingParameters").start_object();
        crate::json_ser::serialize_structure_crate_model_encoding_parameters_request(
            &mut object_172,
            var_171,
        );
        object_172.finish();
    }
    if let Some(var_173) = &input.media_stream_name {
        object.key("mediaStreamName").string(var_173);
    }
}

pub fn serialize_structure_crate_model_vpc_interface_attachment(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::VpcInterfaceAttachment,
) {
    if let Some(var_174) = &input.vpc_interface_name {
        object.key("vpcInterfaceName").string(var_174);
    }
}

pub fn serialize_structure_crate_model_media_stream_source_configuration_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::MediaStreamSourceConfigurationRequest,
) {
    if let Some(var_175) = &input.encoding_name {
        object.key("encodingName").string(var_175.as_str());
    }
    if let Some(var_176) = &input.input_configurations {
        let mut array_177 = object.key("inputConfigurations").start_array();
        for item_178 in var_176 {
            {
                let mut object_179 = array_177.value().start_object();
                crate::json_ser::serialize_structure_crate_model_input_configuration_request(
                    &mut object_179,
                    item_178,
                );
                object_179.finish();
            }
        }
        array_177.finish();
    }
    if let Some(var_180) = &input.media_stream_name {
        object.key("mediaStreamName").string(var_180);
    }
}

pub fn serialize_structure_crate_model_encryption(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Encryption,
) {
    if let Some(var_181) = &input.algorithm {
        object.key("algorithm").string(var_181.as_str());
    }
    if let Some(var_182) = &input.constant_initialization_vector {
        object.key("constantInitializationVector").string(var_182);
    }
    if let Some(var_183) = &input.device_id {
        object.key("deviceId").string(var_183);
    }
    if let Some(var_184) = &input.key_type {
        object.key("keyType").string(var_184.as_str());
    }
    if let Some(var_185) = &input.region {
        object.key("region").string(var_185);
    }
    if let Some(var_186) = &input.resource_id {
        object.key("resourceId").string(var_186);
    }
    if let Some(var_187) = &input.role_arn {
        object.key("roleArn").string(var_187);
    }
    if let Some(var_188) = &input.secret_arn {
        object.key("secretArn").string(var_188);
    }
    if let Some(var_189) = &input.url {
        object.key("url").string(var_189);
    }
}

pub fn serialize_structure_crate_model_source_priority(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::SourcePriority,
) {
    if let Some(var_190) = &input.primary_source {
        object.key("primarySource").string(var_190);
    }
}

pub fn serialize_structure_crate_model_fmtp_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::FmtpRequest,
) {
    if let Some(var_191) = &input.channel_order {
        object.key("channelOrder").string(var_191);
    }
    if let Some(var_192) = &input.colorimetry {
        object.key("colorimetry").string(var_192.as_str());
    }
    if let Some(var_193) = &input.exact_framerate {
        object.key("exactFramerate").string(var_193);
    }
    if let Some(var_194) = &input.par {
        object.key("par").string(var_194);
    }
    if let Some(var_195) = &input.range {
        object.key("range").string(var_195.as_str());
    }
    if let Some(var_196) = &input.scan_mode {
        object.key("scanMode").string(var_196.as_str());
    }
    if let Some(var_197) = &input.tcs {
        object.key("tcs").string(var_197.as_str());
    }
}

pub fn serialize_structure_crate_model_destination_configuration_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::DestinationConfigurationRequest,
) {
    if let Some(var_198) = &input.destination_ip {
        object.key("destinationIp").string(var_198);
    }
    {
        object.key("destinationPort").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.destination_port).into()),
        );
    }
    if let Some(var_199) = &input.interface {
        let mut object_200 = object.key("interface").start_object();
        crate::json_ser::serialize_structure_crate_model_interface_request(
            &mut object_200,
            var_199,
        );
        object_200.finish();
    }
}

pub fn serialize_structure_crate_model_encoding_parameters_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::EncodingParametersRequest,
) {
    {
        object.key("compressionFactor").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::Float((input.compression_factor).into()),
        );
    }
    if let Some(var_201) = &input.encoder_profile {
        object.key("encoderProfile").string(var_201.as_str());
    }
}

pub fn serialize_structure_crate_model_input_configuration_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::InputConfigurationRequest,
) {
    {
        object.key("inputPort").number(
            #[allow(clippy::useless_conversion)]
            smithy_types::Number::NegInt((input.input_port).into()),
        );
    }
    if let Some(var_202) = &input.interface {
        let mut object_203 = object.key("interface").start_object();
        crate::json_ser::serialize_structure_crate_model_interface_request(
            &mut object_203,
            var_202,
        );
        object_203.finish();
    }
}

pub fn serialize_structure_crate_model_interface_request(
    object: &mut smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::InterfaceRequest,
) {
    if let Some(var_204) = &input.name {
        object.key("name").string(var_204);
    }
}
