aws_sdk_cloudfront/protocol_serde/
shape_create_field_level_encryption_config_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub(crate) fn de_e_tag_header(
3    header_map: &::aws_smithy_runtime_api::http::Headers,
4) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
5    let headers = header_map.get_all("ETag");
6    ::aws_smithy_http::header::one_or_none(headers)
7}
8
9pub(crate) fn de_field_level_encryption_payload(
10    body: &[u8],
11) -> std::result::Result<
12    ::std::option::Option<crate::types::FieldLevelEncryption>,
13    crate::operation::create_field_level_encryption_config::CreateFieldLevelEncryptionConfigError,
14> {
15    (!body.is_empty())
16        .then(|| {
17            crate::protocol_serde::shape_create_field_level_encryption_config_output::de_field_level_encryption(body)
18                .map_err(crate::operation::create_field_level_encryption_config::CreateFieldLevelEncryptionConfigError::unhandled)
19        })
20        .transpose()
21}
22
23pub(crate) fn de_location_header(
24    header_map: &::aws_smithy_runtime_api::http::Headers,
25) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
26    let headers = header_map.get_all("Location");
27    ::aws_smithy_http::header::one_or_none(headers)
28}
29
30pub fn de_field_level_encryption(inp: &[u8]) -> std::result::Result<crate::types::FieldLevelEncryption, ::aws_smithy_xml::decode::XmlDecodeError> {
31    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
32    #[allow(unused_mut)]
33    let mut decoder = doc.root_element()?;
34    let start_el = decoder.start_el();
35    if !(start_el.matches("FieldLevelEncryption")) {
36        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
37            "invalid root, expected FieldLevelEncryption got {:?}",
38            start_el
39        )));
40    }
41    crate::protocol_serde::shape_field_level_encryption::de_field_level_encryption(&mut decoder)
42}