aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_mutual_authentication_attributes.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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_mutual_authentication_attributes(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::MutualAuthenticationAttributes,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("Mode");
    if let Some(var_2) = &input.mode {
        scope_1.string(var_2);
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("TrustStoreArn");
    if let Some(var_4) = &input.trust_store_arn {
        scope_3.string(var_4);
    }
    #[allow(unused_mut)]
    let mut scope_5 = writer.prefix("IgnoreClientCertificateExpiry");
    if let Some(var_6) = &input.ignore_client_certificate_expiry {
        scope_5.boolean(*var_6);
    }
    #[allow(unused_mut)]
    let mut scope_7 = writer.prefix("TrustStoreAssociationStatus");
    if let Some(var_8) = &input.trust_store_association_status {
        scope_7.string(var_8.as_str());
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_mutual_authentication_attributes(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::types::MutualAuthenticationAttributes, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::MutualAuthenticationAttributes::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Mode") /* Mode com.amazonaws.elasticloadbalancingv2#MutualAuthenticationAttributes$Mode */ =>  {
                let var_9 =
                    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_mode(var_9);
            }
            ,
            s if s.matches("TrustStoreArn") /* TrustStoreArn com.amazonaws.elasticloadbalancingv2#MutualAuthenticationAttributes$TrustStoreArn */ =>  {
                let var_10 =
                    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_trust_store_arn(var_10);
            }
            ,
            s if s.matches("IgnoreClientCertificateExpiry") /* IgnoreClientCertificateExpiry com.amazonaws.elasticloadbalancingv2#MutualAuthenticationAttributes$IgnoreClientCertificateExpiry */ =>  {
                let var_11 =
                    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#IgnoreClientCertificateExpiry`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ignore_client_certificate_expiry(var_11);
            }
            ,
            s if s.matches("TrustStoreAssociationStatus") /* TrustStoreAssociationStatus com.amazonaws.elasticloadbalancingv2#MutualAuthenticationAttributes$TrustStoreAssociationStatus */ =>  {
                let var_12 =
                    Some(
                        Result::<crate::types::TrustStoreAssociationStatusEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::TrustStoreAssociationStatusEnum::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_trust_store_association_status(var_12);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}