aws_sdk_s3/protocol_serde/
shape_bucket.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_bucket(decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder) -> Result<crate::types::Bucket, ::aws_smithy_xml::decode::XmlDecodeError> {
4    #[allow(unused_mut)]
5    let mut builder = crate::types::Bucket::builder();
6    while let Some(mut tag) = decoder.next_tag() {
7        match tag.start_el() {
8            s if s.matches("Name") /* Name com.amazonaws.s3#Bucket$Name */ =>  {
9                let var_1 =
10                    Some(
11                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
12                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
13                            .into()
14                        )
15                        ?
16                    )
17                ;
18                builder = builder.set_name(var_1);
19            }
20            ,
21            s if s.matches("CreationDate") /* CreationDate com.amazonaws.s3#Bucket$CreationDate */ =>  {
22                let var_2 =
23                    Some(
24                        ::aws_smithy_types::DateTime::from_str(
25                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
26                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
27                        )
28                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.s3#CreationDate`)"))
29                        ?
30                    )
31                ;
32                builder = builder.set_creation_date(var_2);
33            }
34            ,
35            _ => {}
36        }
37    }
38    Ok(builder.build())
39}