aws-sdk-ec2 1.222.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_tunnel_option(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::TunnelOption, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::TunnelOption::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("outsideIpAddress") /* OutsideIpAddress com.amazonaws.ec2#TunnelOption$OutsideIpAddress */ =>  {
                let var_1 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_outside_ip_address(var_1);
            }
            ,
            s if s.matches("tunnelInsideCidr") /* TunnelInsideCidr com.amazonaws.ec2#TunnelOption$TunnelInsideCidr */ =>  {
                let var_2 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_tunnel_inside_cidr(var_2);
            }
            ,
            s if s.matches("tunnelInsideIpv6Cidr") /* TunnelInsideIpv6Cidr com.amazonaws.ec2#TunnelOption$TunnelInsideIpv6Cidr */ =>  {
                let var_3 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_tunnel_inside_ipv6_cidr(var_3);
            }
            ,
            s if s.matches("preSharedKey") /* PreSharedKey com.amazonaws.ec2#TunnelOption$PreSharedKey */ =>  {
                let var_4 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_pre_shared_key(var_4);
            }
            ,
            s if s.matches("phase1LifetimeSeconds") /* Phase1LifetimeSeconds com.amazonaws.ec2#TunnelOption$Phase1LifetimeSeconds */ =>  {
                let var_5 =
                    Some(
                         {
                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_phase1_lifetime_seconds(var_5);
            }
            ,
            s if s.matches("phase2LifetimeSeconds") /* Phase2LifetimeSeconds com.amazonaws.ec2#TunnelOption$Phase2LifetimeSeconds */ =>  {
                let var_6 =
                    Some(
                         {
                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_phase2_lifetime_seconds(var_6);
            }
            ,
            s if s.matches("rekeyMarginTimeSeconds") /* RekeyMarginTimeSeconds com.amazonaws.ec2#TunnelOption$RekeyMarginTimeSeconds */ =>  {
                let var_7 =
                    Some(
                         {
                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_rekey_margin_time_seconds(var_7);
            }
            ,
            s if s.matches("rekeyFuzzPercentage") /* RekeyFuzzPercentage com.amazonaws.ec2#TunnelOption$RekeyFuzzPercentage */ =>  {
                let var_8 =
                    Some(
                         {
                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_rekey_fuzz_percentage(var_8);
            }
            ,
            s if s.matches("replayWindowSize") /* ReplayWindowSize com.amazonaws.ec2#TunnelOption$ReplayWindowSize */ =>  {
                let var_9 =
                    Some(
                         {
                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_replay_window_size(var_9);
            }
            ,
            s if s.matches("dpdTimeoutSeconds") /* DpdTimeoutSeconds com.amazonaws.ec2#TunnelOption$DpdTimeoutSeconds */ =>  {
                let var_10 =
                    Some(
                         {
                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_dpd_timeout_seconds(var_10);
            }
            ,
            s if s.matches("dpdTimeoutAction") /* DpdTimeoutAction com.amazonaws.ec2#TunnelOption$DpdTimeoutAction */ =>  {
                let var_11 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_dpd_timeout_action(var_11);
            }
            ,
            s if s.matches("phase1EncryptionAlgorithmSet") /* Phase1EncryptionAlgorithms com.amazonaws.ec2#TunnelOption$Phase1EncryptionAlgorithms */ =>  {
                let var_12 =
                    Some(
                        crate::protocol_serde::shape_phase1_encryption_algorithms_list::de_phase1_encryption_algorithms_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phase1_encryption_algorithms(var_12);
            }
            ,
            s if s.matches("phase2EncryptionAlgorithmSet") /* Phase2EncryptionAlgorithms com.amazonaws.ec2#TunnelOption$Phase2EncryptionAlgorithms */ =>  {
                let var_13 =
                    Some(
                        crate::protocol_serde::shape_phase2_encryption_algorithms_list::de_phase2_encryption_algorithms_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phase2_encryption_algorithms(var_13);
            }
            ,
            s if s.matches("phase1IntegrityAlgorithmSet") /* Phase1IntegrityAlgorithms com.amazonaws.ec2#TunnelOption$Phase1IntegrityAlgorithms */ =>  {
                let var_14 =
                    Some(
                        crate::protocol_serde::shape_phase1_integrity_algorithms_list::de_phase1_integrity_algorithms_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phase1_integrity_algorithms(var_14);
            }
            ,
            s if s.matches("phase2IntegrityAlgorithmSet") /* Phase2IntegrityAlgorithms com.amazonaws.ec2#TunnelOption$Phase2IntegrityAlgorithms */ =>  {
                let var_15 =
                    Some(
                        crate::protocol_serde::shape_phase2_integrity_algorithms_list::de_phase2_integrity_algorithms_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phase2_integrity_algorithms(var_15);
            }
            ,
            s if s.matches("phase1DHGroupNumberSet") /* Phase1DHGroupNumbers com.amazonaws.ec2#TunnelOption$Phase1DHGroupNumbers */ =>  {
                let var_16 =
                    Some(
                        crate::protocol_serde::shape_phase1_dh_group_numbers_list::de_phase1_dh_group_numbers_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phase1_dh_group_numbers(var_16);
            }
            ,
            s if s.matches("phase2DHGroupNumberSet") /* Phase2DHGroupNumbers com.amazonaws.ec2#TunnelOption$Phase2DHGroupNumbers */ =>  {
                let var_17 =
                    Some(
                        crate::protocol_serde::shape_phase2_dh_group_numbers_list::de_phase2_dh_group_numbers_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_phase2_dh_group_numbers(var_17);
            }
            ,
            s if s.matches("ikeVersionSet") /* IkeVersions com.amazonaws.ec2#TunnelOption$IkeVersions */ =>  {
                let var_18 =
                    Some(
                        crate::protocol_serde::shape_ike_versions_list::de_ike_versions_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_ike_versions(var_18);
            }
            ,
            s if s.matches("startupAction") /* StartupAction com.amazonaws.ec2#TunnelOption$StartupAction */ =>  {
                let var_19 =
                    Some(
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_startup_action(var_19);
            }
            ,
            s if s.matches("logOptions") /* LogOptions com.amazonaws.ec2#TunnelOption$LogOptions */ =>  {
                let var_20 =
                    Some(
                        crate::protocol_serde::shape_vpn_tunnel_log_options::de_vpn_tunnel_log_options(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_log_options(var_20);
            }
            ,
            s if s.matches("enableTunnelLifecycleControl") /* EnableTunnelLifecycleControl com.amazonaws.ec2#TunnelOption$EnableTunnelLifecycleControl */ =>  {
                let var_21 =
                    Some(
                         {
                            <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_enable_tunnel_lifecycle_control(var_21);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}