aws-sdk-ec2 1.244.0

AWS SDK for Amazon Elastic Compute Cloud
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_application_status_check_response_object(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    depth: u32,
) -> ::std::result::Result<crate::types::ApplicationStatusCheckResponseObject, ::aws_smithy_xml::decode::XmlDecodeError> {
    if depth >= 128u32 {
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
    }
    #[allow(unused_mut)]
    let mut builder = crate::types::ApplicationStatusCheckResponseObject::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("applicationStatusCheckId") /* ApplicationStatusCheckId com.amazonaws.ec2#ApplicationStatusCheckResponseObject$ApplicationStatusCheckId */ =>  {
                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_application_status_check_id(var_1);
            }
            ,
            s if s.matches("aggregation") /* Aggregation com.amazonaws.ec2#ApplicationStatusCheckResponseObject$Aggregation */ =>  {
                let var_2 =
                    Some(
                        Result::<crate::types::AggregationStatusEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::AggregationStatusEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_aggregation(var_2);
            }
            ,
            s if s.matches("healthCheckPathSet") /* HealthCheckPaths com.amazonaws.ec2#ApplicationStatusCheckResponseObject$HealthCheckPaths */ =>  {
                let var_3 =
                    Some(
                        crate::protocol_serde::shape_health_check_path_response_list::de_health_check_path_response_list(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_health_check_paths(var_3);
            }
            ,
            s if s.matches("protocol") /* Protocol com.amazonaws.ec2#ApplicationStatusCheckResponseObject$Protocol */ =>  {
                let var_4 =
                    Some(
                        Result::<crate::types::NetworkProtocolEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::NetworkProtocolEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_protocol(var_4);
            }
            ,
            s if s.matches("port") /* Port com.amazonaws.ec2#ApplicationStatusCheckResponseObject$Port */ =>  {
                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_port(var_5);
            }
            ,
            s if s.matches("path") /* Path com.amazonaws.ec2#ApplicationStatusCheckResponseObject$Path */ =>  {
                let var_6 =
                    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_path(var_6);
            }
            ,
            s if s.matches("deviceIndex") /* DeviceIndex com.amazonaws.ec2#ApplicationStatusCheckResponseObject$DeviceIndex */ =>  {
                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_device_index(var_7);
            }
            ,
            s if s.matches("ipVersion") /* IpVersion com.amazonaws.ec2#ApplicationStatusCheckResponseObject$IpVersion */ =>  {
                let var_8 =
                    Some(
                        Result::<crate::types::IpVersionEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::IpVersionEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_ip_version(var_8);
            }
            ,
            s if s.matches("ipScope") /* IpScope com.amazonaws.ec2#ApplicationStatusCheckResponseObject$IpScope */ =>  {
                let var_9 =
                    Some(
                        Result::<crate::types::IpScopeEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::IpScopeEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_ip_scope(var_9);
            }
            ,
            s if s.matches("interval") /* Interval com.amazonaws.ec2#ApplicationStatusCheckResponseObject$Interval */ =>  {
                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_interval(var_10);
            }
            ,
            s if s.matches("timeout") /* Timeout com.amazonaws.ec2#ApplicationStatusCheckResponseObject$Timeout */ =>  {
                let var_11 =
                    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_timeout(var_11);
            }
            ,
            s if s.matches("failureThreshold") /* FailureThreshold com.amazonaws.ec2#ApplicationStatusCheckResponseObject$FailureThreshold */ =>  {
                let var_12 =
                    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_failure_threshold(var_12);
            }
            ,
            s if s.matches("successThreshold") /* SuccessThreshold com.amazonaws.ec2#ApplicationStatusCheckResponseObject$SuccessThreshold */ =>  {
                let var_13 =
                    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_success_threshold(var_13);
            }
            ,
            s if s.matches("statusCodeMatcher") /* StatusCodeMatcher com.amazonaws.ec2#ApplicationStatusCheckResponseObject$StatusCodeMatcher */ =>  {
                let var_14 =
                    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_status_code_matcher(var_14);
            }
            ,
            s if s.matches("initializationGracePeriodSeconds") /* InitializationGracePeriodSeconds com.amazonaws.ec2#ApplicationStatusCheckResponseObject$InitializationGracePeriodSeconds */ =>  {
                let var_15 =
                    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#InitializationGracePeriodSeconds`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_initialization_grace_period_seconds(var_15);
            }
            ,
            s if s.matches("lastUpdatedAt") /* LastUpdatedAt com.amazonaws.ec2#ApplicationStatusCheckResponseObject$LastUpdatedAt */ =>  {
                let var_16 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_last_updated_at(var_16);
            }
            ,
            s if s.matches("targetTagAssociationSet") /* TargetTagAssociations com.amazonaws.ec2#ApplicationStatusCheckResponseObject$TargetTagAssociations */ =>  {
                let var_17 =
                    Some(
                        crate::protocol_serde::shape_custom_key_value_pair_response_set::de_custom_key_value_pair_response_set(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_target_tag_associations(var_17);
            }
            ,
            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#ApplicationStatusCheckResponseObject$Tags */ =>  {
                let var_18 =
                    Some(
                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_tags(var_18);
            }
            ,
            s if s.matches("creationTime") /* CreationTime com.amazonaws.ec2#ApplicationStatusCheckResponseObject$CreationTime */ =>  {
                let var_19 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_creation_time(var_19);
            }
            ,
            s if s.matches("modifyTime") /* ModifyTime com.amazonaws.ec2#ApplicationStatusCheckResponseObject$ModifyTime */ =>  {
                let var_20 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_modify_time(var_20);
            }
            ,
            s if s.matches("deletionTime") /* DeletionTime com.amazonaws.ec2#ApplicationStatusCheckResponseObject$DeletionTime */ =>  {
                let var_21 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_deletion_time(var_21);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}