aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_authenticate_oidc_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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_authenticate_oidc_action_config(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::AuthenticateOidcActionConfig,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("Issuer");
    if let Some(var_2) = &input.issuer {
        scope_1.string(var_2);
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("AuthorizationEndpoint");
    if let Some(var_4) = &input.authorization_endpoint {
        scope_3.string(var_4);
    }
    #[allow(unused_mut)]
    let mut scope_5 = writer.prefix("TokenEndpoint");
    if let Some(var_6) = &input.token_endpoint {
        scope_5.string(var_6);
    }
    #[allow(unused_mut)]
    let mut scope_7 = writer.prefix("UserInfoEndpoint");
    if let Some(var_8) = &input.user_info_endpoint {
        scope_7.string(var_8);
    }
    #[allow(unused_mut)]
    let mut scope_9 = writer.prefix("ClientId");
    if let Some(var_10) = &input.client_id {
        scope_9.string(var_10);
    }
    #[allow(unused_mut)]
    let mut scope_11 = writer.prefix("ClientSecret");
    if let Some(var_12) = &input.client_secret {
        scope_11.string(var_12);
    }
    #[allow(unused_mut)]
    let mut scope_13 = writer.prefix("SessionCookieName");
    if let Some(var_14) = &input.session_cookie_name {
        scope_13.string(var_14);
    }
    #[allow(unused_mut)]
    let mut scope_15 = writer.prefix("Scope");
    if let Some(var_16) = &input.scope {
        scope_15.string(var_16);
    }
    #[allow(unused_mut)]
    let mut scope_17 = writer.prefix("SessionTimeout");
    if let Some(var_18) = &input.session_timeout {
        scope_17.number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_18).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_19 = writer.prefix("AuthenticationRequestExtraParams");
    if let Some(var_20) = &input.authentication_request_extra_params {
        let mut map_21 = scope_19.start_map(false, "key", "value");
        for (key_22, value_23) in var_20 {
            #[allow(unused_mut)]
            let mut entry_24 = map_21.entry(key_22);
            {
                entry_24.string(value_23);
            }
        }
        map_21.finish();
    }
    #[allow(unused_mut)]
    let mut scope_25 = writer.prefix("OnUnauthenticatedRequest");
    if let Some(var_26) = &input.on_unauthenticated_request {
        scope_25.string(var_26.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_27 = writer.prefix("UseExistingClientSecret");
    if let Some(var_28) = &input.use_existing_client_secret {
        scope_27.boolean(*var_28);
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_authenticate_oidc_action_config(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::types::AuthenticateOidcActionConfig, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::AuthenticateOidcActionConfig::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Issuer") /* Issuer com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$Issuer */ =>  {
                let var_29 =
                    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_issuer(var_29);
            }
            ,
            s if s.matches("AuthorizationEndpoint") /* AuthorizationEndpoint com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$AuthorizationEndpoint */ =>  {
                let var_30 =
                    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_authorization_endpoint(var_30);
            }
            ,
            s if s.matches("TokenEndpoint") /* TokenEndpoint com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$TokenEndpoint */ =>  {
                let var_31 =
                    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_token_endpoint(var_31);
            }
            ,
            s if s.matches("UserInfoEndpoint") /* UserInfoEndpoint com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$UserInfoEndpoint */ =>  {
                let var_32 =
                    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_info_endpoint(var_32);
            }
            ,
            s if s.matches("ClientId") /* ClientId com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$ClientId */ =>  {
                let var_33 =
                    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_client_id(var_33);
            }
            ,
            s if s.matches("ClientSecret") /* ClientSecret com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$ClientSecret */ =>  {
                let var_34 =
                    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_client_secret(var_34);
            }
            ,
            s if s.matches("SessionCookieName") /* SessionCookieName com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$SessionCookieName */ =>  {
                let var_35 =
                    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_35);
            }
            ,
            s if s.matches("Scope") /* Scope com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$Scope */ =>  {
                let var_36 =
                    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_36);
            }
            ,
            s if s.matches("SessionTimeout") /* SessionTimeout com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$SessionTimeout */ =>  {
                let var_37 =
                    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#AuthenticateOidcActionSessionTimeout`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_session_timeout(var_37);
            }
            ,
            s if s.matches("AuthenticationRequestExtraParams") /* AuthenticationRequestExtraParams com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$AuthenticationRequestExtraParams */ =>  {
                let var_38 =
                    Some(
                        crate::protocol_serde::shape_authenticate_oidc_action_authentication_request_extra_params::de_authenticate_oidc_action_authentication_request_extra_params(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_authentication_request_extra_params(var_38);
            }
            ,
            s if s.matches("OnUnauthenticatedRequest") /* OnUnauthenticatedRequest com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$OnUnauthenticatedRequest */ =>  {
                let var_39 =
                    Some(
                        Result::<crate::types::AuthenticateOidcActionConditionalBehaviorEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::AuthenticateOidcActionConditionalBehaviorEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_on_unauthenticated_request(var_39);
            }
            ,
            s if s.matches("UseExistingClientSecret") /* UseExistingClientSecret com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionConfig$UseExistingClientSecret */ =>  {
                let var_40 =
                    Some(
                         {
                            <bool 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 (boolean: `com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionUseExistingClientSecret`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_use_existing_client_secret(var_40);
            }
            ,
            _ => {}
        }
    }
    Ok(crate::serde_util::authenticate_oidc_action_config_correct_errors(builder).build())
}