aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_fixed_response_action_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_fixed_response_action_config(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::FixedResponseActionConfig,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("MessageBody");
9    if let Some(var_2) = &input.message_body {
10        scope_1.string(var_2);
11    }
12    #[allow(unused_mut)]
13    let mut scope_3 = writer.prefix("StatusCode");
14    if let Some(var_4) = &input.status_code {
15        scope_3.string(var_4);
16    }
17    #[allow(unused_mut)]
18    let mut scope_5 = writer.prefix("ContentType");
19    if let Some(var_6) = &input.content_type {
20        scope_5.string(var_6);
21    }
22    Ok(())
23}
24
25#[allow(clippy::needless_question_mark)]
26pub fn de_fixed_response_action_config(
27    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
28) -> ::std::result::Result<crate::types::FixedResponseActionConfig, ::aws_smithy_xml::decode::XmlDecodeError> {
29    #[allow(unused_mut)]
30    let mut builder = crate::types::FixedResponseActionConfig::builder();
31    while let Some(mut tag) = decoder.next_tag() {
32        match tag.start_el() {
33            s if s.matches("MessageBody") /* MessageBody com.amazonaws.elasticloadbalancingv2#FixedResponseActionConfig$MessageBody */ =>  {
34                let var_7 =
35                    Some(
36                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
37                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
38                            .into()
39                        )
40                        ?
41                    )
42                ;
43                builder = builder.set_message_body(var_7);
44            }
45            ,
46            s if s.matches("StatusCode") /* StatusCode com.amazonaws.elasticloadbalancingv2#FixedResponseActionConfig$StatusCode */ =>  {
47                let var_8 =
48                    Some(
49                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
50                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
51                            .into()
52                        )
53                        ?
54                    )
55                ;
56                builder = builder.set_status_code(var_8);
57            }
58            ,
59            s if s.matches("ContentType") /* ContentType com.amazonaws.elasticloadbalancingv2#FixedResponseActionConfig$ContentType */ =>  {
60                let var_9 =
61                    Some(
62                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
63                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
64                            .into()
65                        )
66                        ?
67                    )
68                ;
69                builder = builder.set_content_type(var_9);
70            }
71            ,
72            _ => {}
73        }
74    }
75    Ok(crate::serde_util::fixed_response_action_config_correct_errors(builder).build())
76}