Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_traits_output.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_blob_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<::std::option::Option<::aws_smithy_types::Blob>, crate::operation::http_payload_traits::HttpPayloadTraitsError> {
    5         -
    (!body.is_empty()).then(|| Ok(::aws_smithy_types::Blob::new(body))).transpose()
    6         -
}
    7         -
    8         -
pub(crate) fn de_foo_header(
    9         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
   10         -
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
   11         -
    let headers = header_map.get_all("X-Foo");
   12         -
    ::aws_smithy_http::header::one_or_none(headers)
   13         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_traits_with_media_type.rs

@@ -1,0 +60,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_http_payload_traits_with_media_type_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
    9         -
    crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_http_payload_traits_with_media_type_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
   25         -
    crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeOutputBuilder::default();
   30         -
        output = output.set_blob(crate::protocol_serde::shape_http_payload_traits_with_media_type_output::de_blob_payload(
   31         -
            _response_body,
   32         -
        )?);
   33         -
        output = output.set_foo(
   34         -
            crate::protocol_serde::shape_http_payload_traits_with_media_type_output::de_foo_header(_response_headers).map_err(|_| {
   35         -
                crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError::unhandled(
   36         -
                    "Failed to parse foo from header `X-Foo",
   37         -
                )
   38         -
            })?,
   39         -
        );
   40         -
        output.build()
   41         -
    })
   42         -
}
   43         -
   44         -
pub fn ser_http_payload_traits_with_media_type_headers(
   45         -
    input: &crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput,
   46         -
    mut builder: ::http_1x::request::Builder,
   47         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   48         -
    if let ::std::option::Option::Some(inner_1) = &input.foo {
   49         -
        let formatted_2 = inner_1.as_str();
   50         -
        let header_value = formatted_2;
   51         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   52         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   53         -
                "foo",
   54         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   55         -
            )
   56         -
        })?;
   57         -
        builder = builder.header("X-Foo", header_value);
   58         -
    }
   59         -
    Ok(builder)
   60         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_traits_with_media_type_input.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_blob_http_payload(
    3         -
    payload: ::std::option::Option<::aws_smithy_types::Blob>,
    4         -
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
    5         -
    let payload = match payload {
    6         -
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
    8         -
    };
    9         -
    Ok(payload.into_inner())
   10         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_traits_with_media_type_output.rs

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_blob_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<
    5         -
    ::std::option::Option<::aws_smithy_types::Blob>,
    6         -
    crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
    7         -
> {
    8         -
    (!body.is_empty()).then(|| Ok(::aws_smithy_types::Blob::new(body))).transpose()
    9         -
}
   10         -
   11         -
pub(crate) fn de_foo_header(
   12         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
   13         -
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
   14         -
    let headers = header_map.get_all("X-Foo");
   15         -
    ::aws_smithy_http::header::one_or_none(headers)
   16         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_with_structure.rs

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_http_payload_with_structure_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput,
    9         -
    crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::http_payload_with_structure::HttpPayloadWithStructureError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::http_payload_with_structure::HttpPayloadWithStructureError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_http_payload_with_structure_http_response(
   22         -
    _response_status: u16,
   23         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24         -
    _response_body: &[u8],
   25         -
) -> std::result::Result<
   26         -
    crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput,
   27         -
    crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureOutputBuilder::default();
   32         -
        output = output.set_nested(crate::protocol_serde::shape_http_payload_with_structure_output::de_nested_payload(
   33         -
            _response_body,
   34         -
        )?);
   35         -
        output.build()
   36         -
    })
   37         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_with_structure_input.rs

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_nested_http_payload(
    3         -
    payload: &::std::option::Option<crate::types::NestedPayload>,
    4         -
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
    5         -
    let payload = match payload.as_ref() {
    6         -
        Some(t) => t,
    7         -
        None => return Ok(crate::protocol_serde::rest_json_unset_struct_payload()),
    8         -
    };
    9         -
    Ok(crate::protocol_serde::shape_http_payload_with_structure_input::ser_nested_payload(
   10         -
        payload,
   11         -
    )?)
   12         -
}
   13         -
   14         -
pub fn ser_nested_payload(
   15         -
    input: &crate::types::NestedPayload,
   16         -
) -> std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::SerializationError> {
   17         -
    let mut out = String::new();
   18         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   19         -
    crate::protocol_serde::shape_nested_payload::ser_nested_payload(&mut object, input)?;
   20         -
    object.finish();
   21         -
    Ok(out.into_bytes())
   22         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_with_structure_output.rs

@@ -1,0 +14,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_nested_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<
    5         -
    ::std::option::Option<crate::types::NestedPayload>,
    6         -
    crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
    7         -
> {
    8         -
    (!body.is_empty())
    9         -
        .then(|| {
   10         -
            crate::protocol_serde::shape_nested_payload::de_nested_payload_payload(body)
   11         -
                .map_err(crate::operation::http_payload_with_structure::HttpPayloadWithStructureError::unhandled)
   12         -
        })
   13         -
        .transpose()
   14         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_with_union.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_http_payload_with_union_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput,
    9         -
    crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::http_payload_with_union::HttpPayloadWithUnionError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::http_payload_with_union::HttpPayloadWithUnionError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_http_payload_with_union_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput,
   25         -
    crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionOutputBuilder::default();
   30         -
        output = output.set_nested(crate::protocol_serde::shape_http_payload_with_union_output::de_nested_payload(
   31         -
            _response_body,
   32         -
        )?);
   33         -
        output.build()
   34         -
    })
   35         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_with_union_input.rs

@@ -1,0 +20,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_nested_http_payload(
    3         -
    payload: &::std::option::Option<crate::types::UnionPayload>,
    4         -
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
    5         -
    let payload = match payload.as_ref() {
    6         -
        Some(t) => t,
    7         -
        None => return Ok(crate::protocol_serde::rest_json_unset_union_payload()),
    8         -
    };
    9         -
    Ok(crate::protocol_serde::shape_http_payload_with_union_input::ser_nested_payload(payload)?)
   10         -
}
   11         -
   12         -
pub fn ser_nested_payload(
   13         -
    input: &crate::types::UnionPayload,
   14         -
) -> std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::SerializationError> {
   15         -
    let mut out = String::new();
   16         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   17         -
    crate::protocol_serde::shape_union_payload::ser_union_payload(&mut object, input)?;
   18         -
    object.finish();
   19         -
    Ok(out.into_bytes())
   20         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_payload_with_union_output.rs

@@ -1,0 +11,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_nested_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<::std::option::Option<crate::types::UnionPayload>, crate::operation::http_payload_with_union::HttpPayloadWithUnionError> {
    5         -
    (!body.is_empty())
    6         -
        .then(|| {
    7         -
            crate::protocol_serde::shape_union_payload::de_union_payload_payload(body)
    8         -
                .map_err(crate::operation::http_payload_with_union::HttpPayloadWithUnionError::unhandled)
    9         -
        })
   10         -
        .transpose()
   11         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_prefix_headers.rs

@@ -1,0 +76,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_http_prefix_headers_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::http_prefix_headers::HttpPrefixHeadersOutput, crate::operation::http_prefix_headers::HttpPrefixHeadersError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::http_prefix_headers::HttpPrefixHeadersError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    Err(crate::operation::http_prefix_headers::HttpPrefixHeadersError::generic(generic))
   14         -
}
   15         -
   16         -
#[allow(clippy::unnecessary_wraps)]
   17         -
pub fn de_http_prefix_headers_http_response(
   18         -
    _response_status: u16,
   19         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20         -
    _response_body: &[u8],
   21         -
) -> std::result::Result<crate::operation::http_prefix_headers::HttpPrefixHeadersOutput, crate::operation::http_prefix_headers::HttpPrefixHeadersError>
   22         -
{
   23         -
    Ok({
   24         -
        #[allow(unused_mut)]
   25         -
        let mut output = crate::operation::http_prefix_headers::builders::HttpPrefixHeadersOutputBuilder::default();
   26         -
        output = output.set_foo(
   27         -
            crate::protocol_serde::shape_http_prefix_headers_output::de_foo_header(_response_headers)
   28         -
                .map_err(|_| crate::operation::http_prefix_headers::HttpPrefixHeadersError::unhandled("Failed to parse foo from header `x-foo"))?,
   29         -
        );
   30         -
        output = output.set_foo_map(
   31         -
            crate::protocol_serde::shape_http_prefix_headers_output::de_foo_map_prefix_header(_response_headers).map_err(|_| {
   32         -
                crate::operation::http_prefix_headers::HttpPrefixHeadersError::unhandled("Failed to parse fooMap from prefix header `x-foo-")
   33         -
            })?,
   34         -
        );
   35         -
        output.build()
   36         -
    })
   37         -
}
   38         -
   39         -
pub fn ser_http_prefix_headers_headers(
   40         -
    input: &crate::operation::http_prefix_headers::HttpPrefixHeadersInput,
   41         -
    mut builder: ::http_1x::request::Builder,
   42         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   43         -
    if let ::std::option::Option::Some(inner_1) = &input.foo {
   44         -
        let formatted_2 = inner_1.as_str();
   45         -
        let header_value = formatted_2;
   46         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   47         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   48         -
                "foo",
   49         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   50         -
            )
   51         -
        })?;
   52         -
        builder = builder.header("x-foo", header_value);
   53         -
    }
   54         -
    if let ::std::option::Option::Some(inner_3) = &input.foo_map {
   55         -
        {
   56         -
            for (k, v) in inner_3 {
   57         -
                use std::str::FromStr;
   58         -
                let header_name = ::http_1x::HeaderName::from_str(&format!("{}{}", "x-foo-", &k)).map_err(|err| {
   59         -
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   60         -
                        "foo_map",
   61         -
                        format!("`{k}` cannot be used as a header name: {err}"),
   62         -
                    )
   63         -
                })?;
   64         -
                let header_value = v.as_str();
   65         -
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   66         -
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   67         -
                        "foo_map",
   68         -
                        format!("`{v}` cannot be used as a header value: {err}"),
   69         -
                    )
   70         -
                })?;
   71         -
                builder = builder.header(header_name, header_value);
   72         -
            }
   73         -
        }
   74         -
    }
   75         -
    Ok(builder)
   76         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_prefix_headers_in_response.rs

@@ -1,0 +41,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_http_prefix_headers_in_response_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseOutput,
    9         -
    crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_http_prefix_headers_in_response_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseOutput,
   25         -
    crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::http_prefix_headers_in_response::builders::HttpPrefixHeadersInResponseOutputBuilder::default();
   30         -
        output = output.set_prefix_headers(
   31         -
            crate::protocol_serde::shape_http_prefix_headers_in_response_output::de_prefix_headers_prefix_header(_response_headers).map_err(
   32         -
                |_| {
   33         -
                    crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseError::unhandled(
   34         -
                        "Failed to parse prefixHeaders from prefix header `",
   35         -
                    )
   36         -
                },
   37         -
            )?,
   38         -
        );
   39         -
        output.build()
   40         -
    })
   41         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_prefix_headers_in_response_output.rs

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_prefix_headers_prefix_header(
    3         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> std::result::Result<
    5         -
    ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    6         -
    ::aws_smithy_http::header::ParseError,
    7         -
> {
    8         -
    let headers = ::aws_smithy_http::header::headers_for_prefix(header_map.iter().map(|(k, _)| k), "");
    9         -
    let out: std::result::Result<_, _> = headers.map(|(key, header_name)| {
   10         -
                            let values = header_map.get_all(header_name);
   11         -
                            crate::protocol_serde::shape_http_prefix_headers_in_response_output::de_prefix_headers_inner(values).map(|v| (key.to_string(), v.expect(
   12         -
                                "we have checked there is at least one value for this header name; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues"
   13         -
                            )))
   14         -
                        }).collect();
   15         -
    out.map(Some)
   16         -
}
   17         -
   18         -
pub fn de_prefix_headers_inner<'a>(
   19         -
    headers: impl ::std::iter::Iterator<Item = &'a str>,
   20         -
) -> std::result::Result<Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
   21         -
    ::aws_smithy_http::header::one_or_none(headers)
   22         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_prefix_headers_output.rs

@@ -1,0 +29,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_foo_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("x-foo");
    6         -
    ::aws_smithy_http::header::one_or_none(headers)
    7         -
}
    8         -
    9         -
pub(crate) fn de_foo_map_prefix_header(
   10         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
   11         -
) -> std::result::Result<
   12         -
    ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   13         -
    ::aws_smithy_http::header::ParseError,
   14         -
> {
   15         -
    let headers = ::aws_smithy_http::header::headers_for_prefix(header_map.iter().map(|(k, _)| k), "x-foo-");
   16         -
    let out: std::result::Result<_, _> = headers.map(|(key, header_name)| {
   17         -
                            let values = header_map.get_all(header_name);
   18         -
                            crate::protocol_serde::shape_http_prefix_headers_output::de_foo_map_inner(values).map(|v| (key.to_string(), v.expect(
   19         -
                                "we have checked there is at least one value for this header name; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues"
   20         -
                            )))
   21         -
                        }).collect();
   22         -
    out.map(Some)
   23         -
}
   24         -
   25         -
pub fn de_foo_map_inner<'a>(
   26         -
    headers: impl ::std::iter::Iterator<Item = &'a str>,
   27         -
) -> std::result::Result<Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
   28         -
    ::aws_smithy_http::header::one_or_none(headers)
   29         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_query_params_only_operation.rs

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_http_query_params_only_operation_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationOutput,
    9         -
    crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_http_query_params_only_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationOutput,
   25         -
    crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::http_query_params_only_operation::builders::HttpQueryParamsOnlyOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_http_request_with_float_labels.rs

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_http_request_with_float_labels_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsOutput,
    9         -
    crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_http_request_with_float_labels_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsOutput,
   25         -
    crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::http_request_with_float_labels::builders::HttpRequestWithFloatLabelsOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}