aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_authenticate_oidc_action_config.rs1#[allow(unused_mut)]
3pub fn ser_authenticate_oidc_action_config(
4 mut writer: ::aws_smithy_query::QueryValueWriter,
5 input: &crate::types::AuthenticateOidcActionConfig,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7 #[allow(unused_mut)]
8 let mut scope_1 = writer.prefix("Issuer");
9 if let Some(var_2) = &input.issuer {
10 scope_1.string(var_2);
11 }
12 #[allow(unused_mut)]
13 let mut scope_3 = writer.prefix("AuthorizationEndpoint");
14 if let Some(var_4) = &input.authorization_endpoint {
15 scope_3.string(var_4);
16 }
17 #[allow(unused_mut)]
18 let mut scope_5 = writer.prefix("TokenEndpoint");
19 if let Some(var_6) = &input.token_endpoint {
20 scope_5.string(var_6);
21 }
22 #[allow(unused_mut)]
23 let mut scope_7 = writer.prefix("UserInfoEndpoint");
24 if let Some(var_8) = &input.user_info_endpoint {
25 scope_7.string(var_8);
26 }
27 #[allow(unused_mut)]
28 let mut scope_9 = writer.prefix("ClientId");
29 if let Some(var_10) = &input.client_id {
30 scope_9.string(var_10);
31 }
32 #[allow(unused_mut)]
33 let mut scope_11 = writer.prefix("ClientSecret");
34 if let Some(var_12) = &input.client_secret {
35 scope_11.string(var_12);
36 }
37 #[allow(unused_mut)]
38 let mut scope_13 = writer.prefix("SessionCookieName");
39 if let Some(var_14) = &input.session_cookie_name {
40 scope_13.string(var_14);
41 }
42 #[allow(unused_mut)]
43 let mut scope_15 = writer.prefix("Scope");
44 if let Some(var_16) = &input.scope {
45 scope_15.string(var_16);
46 }
47 #[allow(unused_mut)]
48 let mut scope_17 = writer.prefix("SessionTimeout");
49 if let Some(var_18) = &input.session_timeout {
50 scope_17.number(
51 #[allow(clippy::useless_conversion)]
52 ::aws_smithy_types::Number::NegInt((*var_18).into()),
53 );
54 }
55 #[allow(unused_mut)]
56 let mut scope_19 = writer.prefix("AuthenticationRequestExtraParams");
57 if let Some(var_20) = &input.authentication_request_extra_params {
58 let mut map_21 = scope_19.start_map(false, "key", "value");
59 for (key_22, value_23) in var_20 {
60 #[allow(unused_mut)]
61 let mut entry_24 = map_21.entry(key_22);
62 {
63 entry_24.string(value_23);
64 }
65 }
66 map_21.finish();
67 }
68 #[allow(unused_mut)]
69 let mut scope_25 = writer.prefix("OnUnauthenticatedRequest");
70 if let Some(var_26) = &input.on_unauthenticated_request {
71 scope_25.string(var_26.as_str());
72 }
73 #[allow(unused_mut)]
74 let mut scope_27 = writer.prefix("UseExistingClientSecret");
75 if let Some(var_28) = &input.use_existing_client_secret {
76 scope_27.boolean(*var_28);
77 }
78 Ok(())
79}
80
81#[allow(clippy::needless_question_mark)]
82pub fn de_authenticate_oidc_action_config(
83 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
84) -> ::std::result::Result<crate::types::AuthenticateOidcActionConfig, ::aws_smithy_xml::decode::XmlDecodeError> {
85 #[allow(unused_mut)]
86 let mut builder = crate::types::AuthenticateOidcActionConfig::builder();
87 while let Some(mut tag) = decoder.next_tag() {
88 match tag.start_el() {
89 s if s.matches("Issuer") => {
90 let var_29 =
91 Some(
92 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
93 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
94 .into()
95 )
96 ?
97 )
98 ;
99 builder = builder.set_issuer(var_29);
100 }
101 ,
102 s if s.matches("AuthorizationEndpoint") => {
103 let var_30 =
104 Some(
105 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
106 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
107 .into()
108 )
109 ?
110 )
111 ;
112 builder = builder.set_authorization_endpoint(var_30);
113 }
114 ,
115 s if s.matches("TokenEndpoint") => {
116 let var_31 =
117 Some(
118 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
119 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
120 .into()
121 )
122 ?
123 )
124 ;
125 builder = builder.set_token_endpoint(var_31);
126 }
127 ,
128 s if s.matches("UserInfoEndpoint") => {
129 let var_32 =
130 Some(
131 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
132 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
133 .into()
134 )
135 ?
136 )
137 ;
138 builder = builder.set_user_info_endpoint(var_32);
139 }
140 ,
141 s if s.matches("ClientId") => {
142 let var_33 =
143 Some(
144 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
145 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
146 .into()
147 )
148 ?
149 )
150 ;
151 builder = builder.set_client_id(var_33);
152 }
153 ,
154 s if s.matches("ClientSecret") => {
155 let var_34 =
156 Some(
157 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
158 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
159 .into()
160 )
161 ?
162 )
163 ;
164 builder = builder.set_client_secret(var_34);
165 }
166 ,
167 s if s.matches("SessionCookieName") => {
168 let var_35 =
169 Some(
170 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
171 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
172 .into()
173 )
174 ?
175 )
176 ;
177 builder = builder.set_session_cookie_name(var_35);
178 }
179 ,
180 s if s.matches("Scope") => {
181 let var_36 =
182 Some(
183 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
184 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
185 .into()
186 )
187 ?
188 )
189 ;
190 builder = builder.set_scope(var_36);
191 }
192 ,
193 s if s.matches("SessionTimeout") => {
194 let var_37 =
195 Some(
196 {
197 <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
198 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
199 )
200 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionSessionTimeout`)"))
201 }
202 ?
203 )
204 ;
205 builder = builder.set_session_timeout(var_37);
206 }
207 ,
208 s if s.matches("AuthenticationRequestExtraParams") => {
209 let var_38 =
210 Some(
211 crate::protocol_serde::shape_authenticate_oidc_action_authentication_request_extra_params::de_authenticate_oidc_action_authentication_request_extra_params(&mut tag)
212 ?
213 )
214 ;
215 builder = builder.set_authentication_request_extra_params(var_38);
216 }
217 ,
218 s if s.matches("OnUnauthenticatedRequest") => {
219 let var_39 =
220 Some(
221 Result::<crate::types::AuthenticateOidcActionConditionalBehaviorEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
222 crate::types::AuthenticateOidcActionConditionalBehaviorEnum::from(
223 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
224 )
225 )
226 ?
227 )
228 ;
229 builder = builder.set_on_unauthenticated_request(var_39);
230 }
231 ,
232 s if s.matches("UseExistingClientSecret") => {
233 let var_40 =
234 Some(
235 {
236 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
237 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
238 )
239 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.elasticloadbalancingv2#AuthenticateOidcActionUseExistingClientSecret`)"))
240 }
241 ?
242 )
243 ;
244 builder = builder.set_use_existing_client_secret(var_40);
245 }
246 ,
247 _ => {}
248 }
249 }
250 Ok(crate::serde_util::authenticate_oidc_action_config_correct_errors(builder).build())
251}