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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_action(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::Action,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("Type");
    if let Some(var_2) = &input.r#type {
        scope_1.string(var_2.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("TargetGroupArn");
    if let Some(var_4) = &input.target_group_arn {
        scope_3.string(var_4);
    }
    #[allow(unused_mut)]
    let mut scope_5 = writer.prefix("AuthenticateOidcConfig");
    if let Some(var_6) = &input.authenticate_oidc_config {
        crate::protocol_serde::shape_authenticate_oidc_action_config::ser_authenticate_oidc_action_config(scope_5, var_6)?;
    }
    #[allow(unused_mut)]
    let mut scope_7 = writer.prefix("AuthenticateCognitoConfig");
    if let Some(var_8) = &input.authenticate_cognito_config {
        crate::protocol_serde::shape_authenticate_cognito_action_config::ser_authenticate_cognito_action_config(scope_7, var_8)?;
    }
    #[allow(unused_mut)]
    let mut scope_9 = writer.prefix("Order");
    if let Some(var_10) = &input.order {
        scope_9.number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_10).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_11 = writer.prefix("RedirectConfig");
    if let Some(var_12) = &input.redirect_config {
        crate::protocol_serde::shape_redirect_action_config::ser_redirect_action_config(scope_11, var_12)?;
    }
    #[allow(unused_mut)]
    let mut scope_13 = writer.prefix("FixedResponseConfig");
    if let Some(var_14) = &input.fixed_response_config {
        crate::protocol_serde::shape_fixed_response_action_config::ser_fixed_response_action_config(scope_13, var_14)?;
    }
    #[allow(unused_mut)]
    let mut scope_15 = writer.prefix("ForwardConfig");
    if let Some(var_16) = &input.forward_config {
        crate::protocol_serde::shape_forward_action_config::ser_forward_action_config(scope_15, var_16)?;
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_action(decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder) -> Result<crate::types::Action, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::Action::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Type") /* Type com.amazonaws.elasticloadbalancingv2#Action$Type */ =>  {
                let var_17 =
                    Some(
                        Result::<crate::types::ActionTypeEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ActionTypeEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_type(var_17);
            }
            ,
            s if s.matches("TargetGroupArn") /* TargetGroupArn com.amazonaws.elasticloadbalancingv2#Action$TargetGroupArn */ =>  {
                let var_18 =
                    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_target_group_arn(var_18);
            }
            ,
            s if s.matches("AuthenticateOidcConfig") /* AuthenticateOidcConfig com.amazonaws.elasticloadbalancingv2#Action$AuthenticateOidcConfig */ =>  {
                let var_19 =
                    Some(
                        crate::protocol_serde::shape_authenticate_oidc_action_config::de_authenticate_oidc_action_config(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_authenticate_oidc_config(var_19);
            }
            ,
            s if s.matches("AuthenticateCognitoConfig") /* AuthenticateCognitoConfig com.amazonaws.elasticloadbalancingv2#Action$AuthenticateCognitoConfig */ =>  {
                let var_20 =
                    Some(
                        crate::protocol_serde::shape_authenticate_cognito_action_config::de_authenticate_cognito_action_config(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_authenticate_cognito_config(var_20);
            }
            ,
            s if s.matches("Order") /* Order com.amazonaws.elasticloadbalancingv2#Action$Order */ =>  {
                let var_21 =
                    Some(
                         {
                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.elasticloadbalancingv2#ActionOrder`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_order(var_21);
            }
            ,
            s if s.matches("RedirectConfig") /* RedirectConfig com.amazonaws.elasticloadbalancingv2#Action$RedirectConfig */ =>  {
                let var_22 =
                    Some(
                        crate::protocol_serde::shape_redirect_action_config::de_redirect_action_config(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_redirect_config(var_22);
            }
            ,
            s if s.matches("FixedResponseConfig") /* FixedResponseConfig com.amazonaws.elasticloadbalancingv2#Action$FixedResponseConfig */ =>  {
                let var_23 =
                    Some(
                        crate::protocol_serde::shape_fixed_response_action_config::de_fixed_response_action_config(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_fixed_response_config(var_23);
            }
            ,
            s if s.matches("ForwardConfig") /* ForwardConfig com.amazonaws.elasticloadbalancingv2#Action$ForwardConfig */ =>  {
                let var_24 =
                    Some(
                        crate::protocol_serde::shape_forward_action_config::de_forward_action_config(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_forward_config(var_24);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::action_correct_errors(builder).build())
}