// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_object(decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder) -> Result<crate::types::Object, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::Object::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Key") /* Key com.amazonaws.s3#Object$Key */ =>  {
                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_key(var_1);
            }
            ,
            s if s.matches("LastModified") /* LastModified com.amazonaws.s3#Object$LastModified */ =>  {
                let var_2 =
                    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.s3#LastModified`)"))
                        ?
                    )
                ;
                builder = builder.set_last_modified(var_2);
            }
            ,
            s if s.matches("ETag") /* ETag com.amazonaws.s3#Object$ETag */ =>  {
                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_e_tag(var_3);
            }
            ,
            s if s.matches("ChecksumAlgorithm") /* ChecksumAlgorithm com.amazonaws.s3#Object$ChecksumAlgorithm */ =>  {
                let var_4 =
                    Some(
                        Result::<::std::vec::Vec::<crate::types::ChecksumAlgorithm>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
                            let mut list_5 = builder.checksum_algorithm.take().unwrap_or_default();
                            list_5.push(
                                Result::<crate::types::ChecksumAlgorithm, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                                    crate::types::ChecksumAlgorithm::from(
                                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                                    )
                                )
                                ?
                            );
                            list_5
                        })
                        ?
                    )
                ;
                builder = builder.set_checksum_algorithm(var_4);
            }
            ,
            s if s.matches("ChecksumType") /* ChecksumType com.amazonaws.s3#Object$ChecksumType */ =>  {
                let var_6 =
                    Some(
                        Result::<crate::types::ChecksumType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ChecksumType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_checksum_type(var_6);
            }
            ,
            s if s.matches("Size") /* Size com.amazonaws.s3#Object$Size */ =>  {
                let var_7 =
                    Some(
                         {
                            <i64 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 (long: `com.amazonaws.s3#Size`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_size(var_7);
            }
            ,
            s if s.matches("StorageClass") /* StorageClass com.amazonaws.s3#Object$StorageClass */ =>  {
                let var_8 =
                    Some(
                        Result::<crate::types::ObjectStorageClass, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ObjectStorageClass::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_storage_class(var_8);
            }
            ,
            s if s.matches("Owner") /* Owner com.amazonaws.s3#Object$Owner */ =>  {
                let var_9 =
                    Some(
                        crate::protocol_serde::shape_owner::de_owner(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_owner(var_9);
            }
            ,
            s if s.matches("RestoreStatus") /* RestoreStatus com.amazonaws.s3#Object$RestoreStatus */ =>  {
                let var_10 =
                    Some(
                        crate::protocol_serde::shape_restore_status::de_restore_status(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_restore_status(var_10);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}
