aws_sdk_s3/protocol_serde/
shape_target_object_key_format.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_target_object_key_format(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::TargetObjectKeyFormat, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::TargetObjectKeyFormat::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("SimplePrefix") /* SimplePrefix com.amazonaws.s3#TargetObjectKeyFormat$SimplePrefix */ =>  {
11                let var_1 =
12                    Some(
13                        crate::protocol_serde::shape_simple_prefix::de_simple_prefix(&mut tag)
14                        ?
15                    )
16                ;
17                builder = builder.set_simple_prefix(var_1);
18            }
19            ,
20            s if s.matches("PartitionedPrefix") /* PartitionedPrefix com.amazonaws.s3#TargetObjectKeyFormat$PartitionedPrefix */ =>  {
21                let var_2 =
22                    Some(
23                        crate::protocol_serde::shape_partitioned_prefix::de_partitioned_prefix(&mut tag)
24                        ?
25                    )
26                ;
27                builder = builder.set_partitioned_prefix(var_2);
28            }
29            ,
30            _ => {}
31        }
32    }
33    Ok(builder.build())
34}
35
36pub fn ser_target_object_key_format(
37    input: &crate::types::TargetObjectKeyFormat,
38    writer: ::aws_smithy_xml::encode::ElWriter,
39) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
40    #[allow(unused_mut)]
41    let mut scope = writer.finish();
42    if let Some(_var_3) = &input.simple_prefix {
43        scope.start_el("SimplePrefix").finish();
44    }
45    if let Some(var_4) = &input.partitioned_prefix {
46        let inner_writer = scope.start_el("PartitionedPrefix");
47        crate::protocol_serde::shape_partitioned_prefix::ser_partitioned_prefix(var_4, inner_writer)?
48    }
49    scope.finish();
50    Ok(())
51}