// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_multipart_upload(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::MultipartUpload, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::MultipartUpload::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("UploadId") /* UploadId com.amazonaws.s3#MultipartUpload$UploadId */ =>  {
                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_upload_id(var_1);
            }
            ,
            s if s.matches("Key") /* Key com.amazonaws.s3#MultipartUpload$Key */ =>  {
                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_key(var_2);
            }
            ,
            s if s.matches("Initiated") /* Initiated com.amazonaws.s3#MultipartUpload$Initiated */ =>  {
                let var_3 =
                    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#Initiated`)"))
                        ?
                    )
                ;
                builder = builder.set_initiated(var_3);
            }
            ,
            s if s.matches("StorageClass") /* StorageClass com.amazonaws.s3#MultipartUpload$StorageClass */ =>  {
                let var_4 =
                    Some(
                        Result::<crate::types::StorageClass, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::StorageClass::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_storage_class(var_4);
            }
            ,
            s if s.matches("Owner") /* Owner com.amazonaws.s3#MultipartUpload$Owner */ =>  {
                let var_5 =
                    Some(
                        crate::protocol_serde::shape_owner::de_owner(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_owner(var_5);
            }
            ,
            s if s.matches("Initiator") /* Initiator com.amazonaws.s3#MultipartUpload$Initiator */ =>  {
                let var_6 =
                    Some(
                        crate::protocol_serde::shape_initiator::de_initiator(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_initiator(var_6);
            }
            ,
            s if s.matches("ChecksumAlgorithm") /* ChecksumAlgorithm com.amazonaws.s3#MultipartUpload$ChecksumAlgorithm */ =>  {
                let var_7 =
                    Some(
                        Result::<crate::types::ChecksumAlgorithm, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ChecksumAlgorithm::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_checksum_algorithm(var_7);
            }
            ,
            s if s.matches("ChecksumType") /* ChecksumType com.amazonaws.s3#MultipartUpload$ChecksumType */ =>  {
                let var_8 =
                    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_8);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}
