aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_authenticate_cognito_action_config.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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_authenticate_cognito_action_config(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::AuthenticateCognitoActionConfig,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("UserPoolArn");
    if let Some(var_2) = &input.user_pool_arn {
        scope_1.string(var_2);
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("UserPoolClientId");
    if let Some(var_4) = &input.user_pool_client_id {
        scope_3.string(var_4);
    }
    #[allow(unused_mut)]
    let mut scope_5 = writer.prefix("UserPoolDomain");
    if let Some(var_6) = &input.user_pool_domain {
        scope_5.string(var_6);
    }
    #[allow(unused_mut)]
    let mut scope_7 = writer.prefix("SessionCookieName");
    if let Some(var_8) = &input.session_cookie_name {
        scope_7.string(var_8);
    }
    #[allow(unused_mut)]
    let mut scope_9 = writer.prefix("Scope");
    if let Some(var_10) = &input.scope {
        scope_9.string(var_10);
    }
    #[allow(unused_mut)]
    let mut scope_11 = writer.prefix("SessionTimeout");
    if let Some(var_12) = &input.session_timeout {
        scope_11.number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_12).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_13 = writer.prefix("AuthenticationRequestExtraParams");
    if let Some(var_14) = &input.authentication_request_extra_params {
        let mut map_15 = scope_13.start_map(false, "key", "value");
        for (key_16, value_17) in var_14 {
            #[allow(unused_mut)]
            let mut entry_18 = map_15.entry(key_16);
            {
                entry_18.string(value_17);
            }
        }
        map_15.finish();
    }
    #[allow(unused_mut)]
    let mut scope_19 = writer.prefix("OnUnauthenticatedRequest");
    if let Some(var_20) = &input.on_unauthenticated_request {
        scope_19.string(var_20.as_str());
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_authenticate_cognito_action_config(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::types::AuthenticateCognitoActionConfig, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::AuthenticateCognitoActionConfig::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("UserPoolArn") /* UserPoolArn com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$UserPoolArn */ =>  {
                let var_21 =
                    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_user_pool_arn(var_21);
            }
            ,
            s if s.matches("UserPoolClientId") /* UserPoolClientId com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$UserPoolClientId */ =>  {
                let var_22 =
                    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_user_pool_client_id(var_22);
            }
            ,
            s if s.matches("UserPoolDomain") /* UserPoolDomain com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$UserPoolDomain */ =>  {
                let var_23 =
                    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_user_pool_domain(var_23);
            }
            ,
            s if s.matches("SessionCookieName") /* SessionCookieName com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$SessionCookieName */ =>  {
                let var_24 =
                    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_session_cookie_name(var_24);
            }
            ,
            s if s.matches("Scope") /* Scope com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$Scope */ =>  {
                let var_25 =
                    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_scope(var_25);
            }
            ,
            s if s.matches("SessionTimeout") /* SessionTimeout com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$SessionTimeout */ =>  {
                let var_26 =
                    Some(
                         {
                            <i64 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 (long: `com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionSessionTimeout`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_session_timeout(var_26);
            }
            ,
            s if s.matches("AuthenticationRequestExtraParams") /* AuthenticationRequestExtraParams com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$AuthenticationRequestExtraParams */ =>  {
                let var_27 =
                    Some(
                        crate::protocol_serde::shape_authenticate_cognito_action_authentication_request_extra_params::de_authenticate_cognito_action_authentication_request_extra_params(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_authentication_request_extra_params(var_27);
            }
            ,
            s if s.matches("OnUnauthenticatedRequest") /* OnUnauthenticatedRequest com.amazonaws.elasticloadbalancingv2#AuthenticateCognitoActionConfig$OnUnauthenticatedRequest */ =>  {
                let var_28 =
                    Some(
                        Result::<crate::types::AuthenticateCognitoActionConditionalBehaviorEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::AuthenticateCognitoActionConditionalBehaviorEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_on_unauthenticated_request(var_28);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::authenticate_cognito_action_config_correct_errors(builder).build())
}