aws-sdk-ec2 1.223.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn ser_create_client_vpn_endpoint_input_input_input(
    input: &crate::operation::create_client_vpn_endpoint::CreateClientVpnEndpointInput,
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
    let mut out = String::new();
    #[allow(unused_mut)]
    let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "CreateClientVpnEndpoint", "2016-11-15");
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("ClientCidrBlock");
    if let Some(var_2) = &input.client_cidr_block {
        scope_1.string(var_2);
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("ServerCertificateArn");
    if let Some(var_4) = &input.server_certificate_arn {
        scope_3.string(var_4);
    }
    #[allow(unused_mut)]
    let mut scope_5 = writer.prefix("Authentication");
    if let Some(var_6) = &input.authentication_options {
        if !var_6.is_empty() {
            let mut list_8 = scope_5.start_list(true, None);
            for item_7 in var_6 {
                #[allow(unused_mut)]
                let mut entry_9 = list_8.entry();
                crate::protocol_serde::shape_client_vpn_authentication_request::ser_client_vpn_authentication_request(entry_9, item_7)?;
            }
            list_8.finish();
        }
    }
    #[allow(unused_mut)]
    let mut scope_10 = writer.prefix("ConnectionLogOptions");
    if let Some(var_11) = &input.connection_log_options {
        crate::protocol_serde::shape_connection_log_options::ser_connection_log_options(scope_10, var_11)?;
    }
    #[allow(unused_mut)]
    let mut scope_12 = writer.prefix("DnsServers");
    if let Some(var_13) = &input.dns_servers {
        if !var_13.is_empty() {
            let mut list_15 = scope_12.start_list(true, Some("item"));
            for item_14 in var_13 {
                #[allow(unused_mut)]
                let mut entry_16 = list_15.entry();
                entry_16.string(item_14);
            }
            list_15.finish();
        }
    }
    #[allow(unused_mut)]
    let mut scope_17 = writer.prefix("TransportProtocol");
    if let Some(var_18) = &input.transport_protocol {
        scope_17.string(var_18.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_19 = writer.prefix("VpnPort");
    if let Some(var_20) = &input.vpn_port {
        scope_19.number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_20).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_21 = writer.prefix("Description");
    if let Some(var_22) = &input.description {
        scope_21.string(var_22);
    }
    #[allow(unused_mut)]
    let mut scope_23 = writer.prefix("SplitTunnel");
    if let Some(var_24) = &input.split_tunnel {
        scope_23.boolean(*var_24);
    }
    #[allow(unused_mut)]
    let mut scope_25 = writer.prefix("DryRun");
    if let Some(var_26) = &input.dry_run {
        scope_25.boolean(*var_26);
    }
    #[allow(unused_mut)]
    let mut scope_27 = writer.prefix("ClientToken");
    if let Some(var_28) = &input.client_token {
        scope_27.string(var_28);
    }
    #[allow(unused_mut)]
    let mut scope_29 = writer.prefix("TagSpecification");
    if let Some(var_30) = &input.tag_specifications {
        if !var_30.is_empty() {
            let mut list_32 = scope_29.start_list(true, Some("item"));
            for item_31 in var_30 {
                #[allow(unused_mut)]
                let mut entry_33 = list_32.entry();
                crate::protocol_serde::shape_tag_specification::ser_tag_specification(entry_33, item_31)?;
            }
            list_32.finish();
        }
    }
    #[allow(unused_mut)]
    let mut scope_34 = writer.prefix("SecurityGroupId");
    if let Some(var_35) = &input.security_group_ids {
        if !var_35.is_empty() {
            let mut list_37 = scope_34.start_list(true, Some("item"));
            for item_36 in var_35 {
                #[allow(unused_mut)]
                let mut entry_38 = list_37.entry();
                entry_38.string(item_36);
            }
            list_37.finish();
        }
    }
    #[allow(unused_mut)]
    let mut scope_39 = writer.prefix("VpcId");
    if let Some(var_40) = &input.vpc_id {
        scope_39.string(var_40);
    }
    #[allow(unused_mut)]
    let mut scope_41 = writer.prefix("SelfServicePortal");
    if let Some(var_42) = &input.self_service_portal {
        scope_41.string(var_42.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_43 = writer.prefix("ClientConnectOptions");
    if let Some(var_44) = &input.client_connect_options {
        crate::protocol_serde::shape_client_connect_options::ser_client_connect_options(scope_43, var_44)?;
    }
    #[allow(unused_mut)]
    let mut scope_45 = writer.prefix("SessionTimeoutHours");
    if let Some(var_46) = &input.session_timeout_hours {
        scope_45.number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_46).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_47 = writer.prefix("ClientLoginBannerOptions");
    if let Some(var_48) = &input.client_login_banner_options {
        crate::protocol_serde::shape_client_login_banner_options::ser_client_login_banner_options(scope_47, var_48)?;
    }
    #[allow(unused_mut)]
    let mut scope_49 = writer.prefix("ClientRouteEnforcementOptions");
    if let Some(var_50) = &input.client_route_enforcement_options {
        crate::protocol_serde::shape_client_route_enforcement_options::ser_client_route_enforcement_options(scope_49, var_50)?;
    }
    #[allow(unused_mut)]
    let mut scope_51 = writer.prefix("DisconnectOnSessionTimeout");
    if let Some(var_52) = &input.disconnect_on_session_timeout {
        scope_51.boolean(*var_52);
    }
    #[allow(unused_mut)]
    let mut scope_53 = writer.prefix("EndpointIpAddressType");
    if let Some(var_54) = &input.endpoint_ip_address_type {
        scope_53.string(var_54.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_55 = writer.prefix("TrafficIpAddressType");
    if let Some(var_56) = &input.traffic_ip_address_type {
        scope_55.string(var_56.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_57 = writer.prefix("TransitGatewayConfiguration");
    if let Some(var_58) = &input.transit_gateway_configuration {
        crate::protocol_serde::shape_transit_gateway_configuration_input_structure::ser_transit_gateway_configuration_input_structure(
            scope_57, var_58,
        )?;
    }
    writer.finish();
    Ok(::aws_smithy_types::body::SdkBody::from(out))
}