aws_sdk_s3/protocol_serde/
shape_invalid_object_state.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn de_invalid_object_state_xml_err(
    inp: &[u8],
    mut builder: crate::types::error::builders::InvalidObjectStateBuilder,
) -> Result<crate::types::error::builders::InvalidObjectStateBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
    if inp.is_empty() {
        return Ok(builder);
    }
    let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?;
    #[allow(unused_mut)]
    let mut error_decoder = crate::rest_xml_unwrapped_errors::error_scope(&mut document)?;
    while let Some(mut tag) = error_decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Message") /* Message com.amazonaws.s3#InvalidObjectState$Message */ =>  {
                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_message(var_1);
            }
            ,
            s if s.matches("StorageClass") /* StorageClass com.amazonaws.s3#InvalidObjectState$StorageClass */ =>  {
                let var_2 =
                    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_2);
            }
            ,
            s if s.matches("AccessTier") /* AccessTier com.amazonaws.s3#InvalidObjectState$AccessTier */ =>  {
                let var_3 =
                    Some(
                        Result::<crate::types::IntelligentTieringAccessTier, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::IntelligentTieringAccessTier::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_access_tier(var_3);
            }
            ,
            _ => {}
        }
    }
    Ok(builder)
}