aws_sdk_s3/protocol_serde/
shape_ssekms.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_ssekms(decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder) -> Result<crate::types::Ssekms, ::aws_smithy_xml::decode::XmlDecodeError> {
4    #[allow(unused_mut)]
5    let mut builder = crate::types::Ssekms::builder();
6    while let Some(mut tag) = decoder.next_tag() {
7        match tag.start_el() {
8            s if s.matches("KeyId") /* KeyId com.amazonaws.s3#SSEKMS$KeyId */ =>  {
9                let var_1 =
10                    Some(
11                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
12                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
13                            .into()
14                        )
15                        ?
16                    )
17                ;
18                builder = builder.set_key_id(var_1);
19            }
20            ,
21            _ => {}
22        }
23    }
24    Ok(crate::serde_util::ssekms_correct_errors(builder)
25        .build()
26        .map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
27}
28
29pub fn ser_ssekms(
30    input: &crate::types::Ssekms,
31    writer: ::aws_smithy_xml::encode::ElWriter,
32) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
33    #[allow(unused_mut)]
34    let mut scope = writer.finish();
35    {
36        let mut inner_writer = scope.start_el("KeyId").finish();
37        inner_writer.data(input.key_id.as_str());
38    }
39    scope.finish();
40    Ok(())
41}