aws_sdk_s3/protocol_serde/
shape_condition.rs
1#[allow(clippy::needless_question_mark)]
3pub fn de_condition(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::Condition, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::Condition::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("HttpErrorCodeReturnedEquals") => {
11 let var_1 =
12 Some(
13 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
14 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
15 .into()
16 )
17 ?
18 )
19 ;
20 builder = builder.set_http_error_code_returned_equals(var_1);
21 }
22 ,
23 s if s.matches("KeyPrefixEquals") => {
24 let var_2 =
25 Some(
26 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
28 .into()
29 )
30 ?
31 )
32 ;
33 builder = builder.set_key_prefix_equals(var_2);
34 }
35 ,
36 _ => {}
37 }
38 }
39 Ok(builder.build())
40}
41
42pub fn ser_condition(
43 input: &crate::types::Condition,
44 writer: ::aws_smithy_xml::encode::ElWriter,
45) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
46 #[allow(unused_mut)]
47 let mut scope = writer.finish();
48 if let Some(var_3) = &input.http_error_code_returned_equals {
49 let mut inner_writer = scope.start_el("HttpErrorCodeReturnedEquals").finish();
50 inner_writer.data(var_3.as_str());
51 }
52 if let Some(var_4) = &input.key_prefix_equals {
53 let mut inner_writer = scope.start_el("KeyPrefixEquals").finish();
54 inner_writer.data(var_4.as_str());
55 }
56 scope.finish();
57 Ok(())
58}