aws_sdk_elasticloadbalancingv2/protocol_serde/
shape_load_balancer_attribute.rs1#[allow(unused_mut)]
3pub fn ser_load_balancer_attribute(
4 mut writer: ::aws_smithy_query::QueryValueWriter,
5 input: &crate::types::LoadBalancerAttribute,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7 #[allow(unused_mut)]
8 let mut scope_1 = writer.prefix("Key");
9 if let Some(var_2) = &input.key {
10 scope_1.string(var_2);
11 }
12 #[allow(unused_mut)]
13 let mut scope_3 = writer.prefix("Value");
14 if let Some(var_4) = &input.value {
15 scope_3.string(var_4);
16 }
17 Ok(())
18}
19
20#[allow(clippy::needless_question_mark)]
21pub fn de_load_balancer_attribute(
22 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
23) -> ::std::result::Result<crate::types::LoadBalancerAttribute, ::aws_smithy_xml::decode::XmlDecodeError> {
24 #[allow(unused_mut)]
25 let mut builder = crate::types::LoadBalancerAttribute::builder();
26 while let Some(mut tag) = decoder.next_tag() {
27 match tag.start_el() {
28 s if s.matches("Key") => {
29 let var_5 =
30 Some(
31 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
32 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
33 .into()
34 )
35 ?
36 )
37 ;
38 builder = builder.set_key(var_5);
39 }
40 ,
41 s if s.matches("Value") => {
42 let var_6 =
43 Some(
44 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
45 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
46 .into()
47 )
48 ?
49 )
50 ;
51 builder = builder.set_value(var_6);
52 }
53 ,
54 _ => {}
55 }
56 }
57 Ok(builder.build())
58}