aws_sdk_ec2/protocol_serde/
shape_ipv4_prefix_specification_request.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(unused_mut)]
3pub fn ser_ipv4_prefix_specification_request(
4    mut writer: ::aws_smithy_query::QueryValueWriter,
5    input: &crate::types::Ipv4PrefixSpecificationRequest,
6) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
7    #[allow(unused_mut)]
8    let mut scope_1 = writer.prefix("Ipv4Prefix");
9    if let Some(var_2) = &input.ipv4_prefix {
10        scope_1.string(var_2);
11    }
12    Ok(())
13}
14
15#[allow(clippy::needless_question_mark)]
16pub fn de_ipv4_prefix_specification_request(
17    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
18) -> ::std::result::Result<crate::types::Ipv4PrefixSpecificationRequest, ::aws_smithy_xml::decode::XmlDecodeError> {
19    #[allow(unused_mut)]
20    let mut builder = crate::types::Ipv4PrefixSpecificationRequest::builder();
21    while let Some(mut tag) = decoder.next_tag() {
22        match tag.start_el() {
23            s if s.matches("Ipv4Prefix") /* Ipv4Prefix com.amazonaws.ec2#Ipv4PrefixSpecificationRequest$Ipv4Prefix */ =>  {
24                let var_3 =
25                    Some(
26                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
28                            .into()
29                        )
30                        ?
31                    )
32                ;
33                builder = builder.set_ipv4_prefix(var_3);
34            }
35            ,
36            _ => {}
37        }
38    }
39    Ok(builder.build())
40}