aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_mutual_authentication_attributes.rs1#[allow(unused_mut)]
3pub fn ser_mutual_authentication_attributes(
4 mut writer: ::aws_smithy_query::QueryValueWriter,
5 input: &crate::types::MutualAuthenticationAttributes,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7 #[allow(unused_mut)]
8 let mut scope_1 = writer.prefix("Mode");
9 if let Some(var_2) = &input.mode {
10 scope_1.string(var_2);
11 }
12 #[allow(unused_mut)]
13 let mut scope_3 = writer.prefix("TrustStoreArn");
14 if let Some(var_4) = &input.trust_store_arn {
15 scope_3.string(var_4);
16 }
17 #[allow(unused_mut)]
18 let mut scope_5 = writer.prefix("IgnoreClientCertificateExpiry");
19 if let Some(var_6) = &input.ignore_client_certificate_expiry {
20 scope_5.boolean(*var_6);
21 }
22 #[allow(unused_mut)]
23 let mut scope_7 = writer.prefix("TrustStoreAssociationStatus");
24 if let Some(var_8) = &input.trust_store_association_status {
25 scope_7.string(var_8.as_str());
26 }
27 #[allow(unused_mut)]
28 let mut scope_9 = writer.prefix("AdvertiseTrustStoreCaNames");
29 if let Some(var_10) = &input.advertise_trust_store_ca_names {
30 scope_9.string(var_10.as_str());
31 }
32 Ok(())
33}
34
35#[allow(clippy::needless_question_mark)]
36pub fn de_mutual_authentication_attributes(
37 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
38) -> ::std::result::Result<crate::types::MutualAuthenticationAttributes, ::aws_smithy_xml::decode::XmlDecodeError> {
39 #[allow(unused_mut)]
40 let mut builder = crate::types::MutualAuthenticationAttributes::builder();
41 while let Some(mut tag) = decoder.next_tag() {
42 match tag.start_el() {
43 s if s.matches("Mode") => {
44 let var_11 =
45 Some(
46 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
47 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
48 .into()
49 )
50 ?
51 )
52 ;
53 builder = builder.set_mode(var_11);
54 }
55 ,
56 s if s.matches("TrustStoreArn") => {
57 let var_12 =
58 Some(
59 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
60 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
61 .into()
62 )
63 ?
64 )
65 ;
66 builder = builder.set_trust_store_arn(var_12);
67 }
68 ,
69 s if s.matches("IgnoreClientCertificateExpiry") => {
70 let var_13 =
71 Some(
72 {
73 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
74 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
75 )
76 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.elasticloadbalancingv2#IgnoreClientCertificateExpiry`)"))
77 }
78 ?
79 )
80 ;
81 builder = builder.set_ignore_client_certificate_expiry(var_13);
82 }
83 ,
84 s if s.matches("TrustStoreAssociationStatus") => {
85 let var_14 =
86 Some(
87 Result::<crate::types::TrustStoreAssociationStatusEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
88 crate::types::TrustStoreAssociationStatusEnum::from(
89 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
90 )
91 )
92 ?
93 )
94 ;
95 builder = builder.set_trust_store_association_status(var_14);
96 }
97 ,
98 s if s.matches("AdvertiseTrustStoreCaNames") => {
99 let var_15 =
100 Some(
101 Result::<crate::types::AdvertiseTrustStoreCaNamesEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
102 crate::types::AdvertiseTrustStoreCaNamesEnum::from(
103 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
104 )
105 )
106 ?
107 )
108 ;
109 builder = builder.set_advertise_trust_store_ca_names(var_15);
110 }
111 ,
112 _ => {}
113 }
114 }
115 Ok(builder.build())
116}