Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

@@ -1,1 +78,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn type_erase_result<O, E>(
    3         -
    result: ::std::result::Result<O, E>,
    4         -
) -> ::std::result::Result<
    5         -
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6         -
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7         -
>
    8         -
where
    9         -
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10         -
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11         -
{
   12         -
    result
   13         -
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14         -
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15         -
        .map_err(::std::convert::Into::into)
   16         -
}
   17         -
   18      2   
pub fn parse_http_error_metadata(
   19      3   
    _response_status: u16,
   20      4   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21      5   
    response_body: &[u8],
   22      6   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23      7   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24      8   
}
   25         -
   26         -
pub(crate) mod shape_required_header_collection_operation;
   27         -
   28         -
pub(crate) mod shape_required_inner_shape_operation;
   29         -
   30         -
pub(crate) mod shape_response_code_default_operation;
   31         -
   32         -
pub(crate) mod shape_response_code_http_fallback_operation;
   33         -
   34         -
pub(crate) mod shape_response_code_required_operation;
   35         -
   36         -
pub(crate) mod shape_type_complexity_operation;
   37         -
   38         -
pub(crate) mod shape_required_header_collection_operation_output;
   39         -
   40         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   41         -
    if data.is_empty() {
   42         -
        b"{}"
   43         -
    } else {
   44         -
        data
   45         -
    }
   46         -
}
   47         -
   48         -
pub(crate) mod shape_required_inner_shape_operation_input;
   49         -
   50         -
pub(crate) mod shape_type_complexity_operation_input;
   51         -
   52         -
pub(crate) mod shape_validation_exception;
   53         -
   54         -
pub(crate) mod shape_empty_structure;
   55         -
   56         -
pub(crate) mod shape_inner_shape;
   57         -
   58         -
pub(crate) mod shape_list_a;
   59         -
   60         -
pub(crate) mod shape_validation_exception_field_list;
   61         -
   62         -
pub(crate) mod shape_innermost_shape;
   63         -
   64         -
pub(crate) mod shape_list_b;
   65         -
   66         -
pub(crate) mod shape_validation_exception_field;
   67         -
   68         -
pub(crate) mod shape_a_map;
   69         -
   70         -
pub(crate) mod shape_a_string_list;
   71         -
   72         -
pub(crate) mod shape_a_string_set;
   73         -
   74         -
pub(crate) mod shape_a_union;
   75         -
   76         -
pub(crate) mod shape_list_c;
   77         -
   78         -
pub(crate) mod shape_map_a;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_map.rs

@@ -1,0 +49,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_a_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::DateTime>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   22         -
                            tokens.next(),
   23         -
                            ::aws_smithy_types::date_time::Format::EpochSeconds,
   24         -
                        )?;
   25         -
                        match value {
   26         -
                            Some(value) => {
   27         -
                                map.insert(key, value);
   28         -
                            }
   29         -
                            None => {
   30         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
                                    "dense map cannot contain null values",
   32         -
                                ))
   33         -
                            }
   34         -
                        }
   35         -
                    }
   36         -
                    other => {
   37         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   38         -
                            "expected object key or end object, found: {other:?}"
   39         -
                        )))
   40         -
                    }
   41         -
                }
   42         -
            }
   43         -
            Ok(Some(map))
   44         -
        }
   45         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46         -
            "expected start object or null",
   47         -
        )),
   48         -
    }
   49         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_string_list.rs

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_a_string_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
   23         -
                        if let Some(value) = value {
   24         -
                            items.push(value);
   25         -
                        } else {
   26         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   27         -
                                "dense list cannot contain null values",
   28         -
                            ));
   29         -
                        }
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(items))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start array or null",
   37         -
        )),
   38         -
    }
   39         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_string_set.rs

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_a_string_set<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
   23         -
                        if let Some(value) = value {
   24         -
                            items.push(value);
   25         -
                        } else {
   26         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   27         -
                                "dense list cannot contain null values",
   28         -
                            ));
   29         -
                        }
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(items))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start array or null",
   37         -
        )),
   38         -
    }
   39         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_union.rs

@@ -1,0 +103,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_a_union<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::AUnion>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    let mut variant = None;
   10         -
    match tokens.next().transpose()? {
   11         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   12         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   13         -
            match tokens.next().transpose()? {
   14         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   15         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   16         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   17         -
                        tokens.peek()
   18         -
                    {
   19         -
                        let _ = tokens.next().expect("peek returned a token")?;
   20         -
                        continue;
   21         -
                    }
   22         -
                    let key = key.to_unescaped()?;
   23         -
                    if key == "__type" {
   24         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   25         -
                        continue;
   26         -
                    }
   27         -
                    if variant.is_some() {
   28         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
                            "encountered mixed variants in union",
   30         -
                        ));
   31         -
                    }
   32         -
                    variant = match key.as_ref() {
   33         -
                        "i32" => Some(crate::types::AUnion::I32(
   34         -
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   35         -
                                .map(i32::try_from)
   36         -
                                .transpose()?
   37         -
                                .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'i32' cannot be null"))?,
   38         -
                        )),
   39         -
                        "string" => Some(crate::types::AUnion::String(
   40         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   41         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   42         -
                                .transpose()?
   43         -
                                .ok_or_else(|| {
   44         -
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null")
   45         -
                                })?,
   46         -
                        )),
   47         -
                        "time" => Some(crate::types::AUnion::Time(
   48         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   49         -
                                tokens.next(),
   50         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   51         -
                            )?
   52         -
                            .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'time' cannot be null"))?,
   53         -
                        )),
   54         -
                        _ => {
   55         -
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   56         -
                            Some(crate::types::AUnion::Unknown)
   57         -
                        }
   58         -
                    };
   59         -
                }
   60         -
                other => {
   61         -
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   62         -
                        "expected object key or end object, found: {other:?}"
   63         -
                    )))
   64         -
                }
   65         -
            }
   66         -
        },
   67         -
        _ => {
   68         -
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   69         -
                "expected start object or null",
   70         -
            ))
   71         -
        }
   72         -
    }
   73         -
    if variant.is_none() {
   74         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   75         -
            "Union did not contain a valid variant.",
   76         -
        ));
   77         -
    }
   78         -
    Ok(variant)
   79         -
}
   80         -
   81         -
pub fn ser_a_union(
   82         -
    object_8: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   83         -
    input: &crate::types::AUnion,
   84         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   85         -
    match input {
   86         -
        crate::types::AUnion::I32(inner) => {
   87         -
            object_8.key("i32").number(
   88         -
                #[allow(clippy::useless_conversion)]
   89         -
                ::aws_smithy_types::Number::NegInt((*inner).into()),
   90         -
            );
   91         -
        }
   92         -
        crate::types::AUnion::String(inner) => {
   93         -
            object_8.key("string").string(inner.as_str());
   94         -
        }
   95         -
        crate::types::AUnion::Time(inner) => {
   96         -
            object_8
   97         -
                .key("time")
   98         -
                .date_time(inner, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   99         -
        }
  100         -
        crate::types::AUnion::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("AUnion")),
  101         -
    }
  102         -
    Ok(())
  103         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_empty_structure.rs

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_empty_structure(
    3         -
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    #[allow(unused_variables)] input: &crate::types::EmptyStructure,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    Ok(())
    7         -
}
    8         -
    9         -
pub(crate) fn de_empty_structure<'a, I>(
   10         -
    tokens: &mut ::std::iter::Peekable<I>,
   11         -
    _value: &'a [u8],
   12         -
) -> ::std::result::Result<Option<crate::types::EmptyStructure>, ::aws_smithy_json::deserialize::error::DeserializeError>
   13         -
where
   14         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   15         -
{
   16         -
    match tokens.next().transpose()? {
   17         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   19         -
            #[allow(unused_mut)]
   20         -
            let mut builder = crate::types::builders::EmptyStructureBuilder::default();
   21         -
            ::aws_smithy_json::deserialize::token::skip_to_end(tokens)?;
   22         -
            Ok(Some(builder.build()))
   23         -
        }
   24         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25         -
            "expected start object or null",
   26         -
        )),
   27         -
    }
   28         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_inner_shape.rs

@@ -1,0 +52,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_inner_shape<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::InnerShape>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::InnerShapeBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "requiredInnerMostShape" => {
   19         -
                            builder = builder
   20         -
                                .set_required_inner_most_shape(crate::protocol_serde::shape_innermost_shape::de_innermost_shape(tokens, _value)?);
   21         -
                        }
   22         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   23         -
                    },
   24         -
                    other => {
   25         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   26         -
                            "expected object key or end object, found: {other:?}"
   27         -
                        )))
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(crate::serde_util::inner_shape_correct_errors(builder).build().map_err(|err| {
   32         -
                ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err)
   33         -
            })?))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
   38         -
    }
   39         -
}
   40         -
   41         -
pub fn ser_inner_shape(
   42         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   43         -
    input: &crate::types::InnerShape,
   44         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   45         -
    {
   46         -
        #[allow(unused_mut)]
   47         -
        let mut object_1 = object.key("requiredInnerMostShape").start_object();
   48         -
        crate::protocol_serde::shape_innermost_shape::ser_innermost_shape(&mut object_1, &input.required_inner_most_shape)?;
   49         -
        object_1.finish();
   50         -
    }
   51         -
    Ok(())
   52         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_innermost_shape.rs

@@ -1,0 +232,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_innermost_shape<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::InnermostShape>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::InnermostShapeBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "aString" => {
   19         -
                            builder = builder.set_a_string(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "aBoolean" => {
   26         -
                            builder = builder.set_a_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   27         -
                        }
   28         -
                        "aByte" => {
   29         -
                            builder = builder.set_a_byte(
   30         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   31         -
                                    .map(i8::try_from)
   32         -
                                    .transpose()?,
   33         -
                            );
   34         -
                        }
   35         -
                        "aShort" => {
   36         -
                            builder = builder.set_a_short(
   37         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   38         -
                                    .map(i16::try_from)
   39         -
                                    .transpose()?,
   40         -
                            );
   41         -
                        }
   42         -
                        "anInt" => {
   43         -
                            builder = builder.set_an_int(
   44         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   45         -
                                    .map(i32::try_from)
   46         -
                                    .transpose()?,
   47         -
                            );
   48         -
                        }
   49         -
                        "aLong" => {
   50         -
                            builder = builder.set_a_long(
   51         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   52         -
                                    .map(i64::try_from)
   53         -
                                    .transpose()?,
   54         -
                            );
   55         -
                        }
   56         -
                        "aFloat" => {
   57         -
                            builder = builder
   58         -
                                .set_a_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
   59         -
                        }
   60         -
                        "aDouble" => {
   61         -
                            builder = builder
   62         -
                                .set_a_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
   63         -
                        }
   64         -
                        "aBigInteger" => {
   65         -
                            builder = builder.set_a_big_integer(
   66         -
                                ::aws_smithy_json::deserialize::token::expect_number_as_string_or_null(tokens.next(), _value)?
   67         -
                                    .map(<::aws_smithy_types::BigInteger as ::std::str::FromStr>::from_str)
   68         -
                                    .transpose()
   69         -
                                    .map_err(|e| {
   70         -
                                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("invalid BigInteger: {e}"))
   71         -
                                    })?,
   72         -
                            );
   73         -
                        }
   74         -
                        "aBigDecimal" => {
   75         -
                            builder = builder.set_a_big_decimal(
   76         -
                                ::aws_smithy_json::deserialize::token::expect_number_as_string_or_null(tokens.next(), _value)?
   77         -
                                    .map(<::aws_smithy_types::BigDecimal as ::std::str::FromStr>::from_str)
   78         -
                                    .transpose()
   79         -
                                    .map_err(|e| {
   80         -
                                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("invalid BigDecimal: {e}"))
   81         -
                                    })?,
   82         -
                            );
   83         -
                        }
   84         -
                        "aTimestamp" => {
   85         -
                            builder = builder.set_a_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   86         -
                                tokens.next(),
   87         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   88         -
                            )?);
   89         -
                        }
   90         -
                        "aDocument" => {
   91         -
                            builder = builder.set_a_document(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   92         -
                                tokens.next(),
   93         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   94         -
                            )?);
   95         -
                        }
   96         -
                        "aStringList" => {
   97         -
                            builder = builder.set_a_string_list(crate::protocol_serde::shape_a_string_list::de_a_string_list(tokens, _value)?);
   98         -
                        }
   99         -
                        "aStringMap" => {
  100         -
                            builder = builder.set_a_string_map(crate::protocol_serde::shape_a_map::de_a_map(tokens, _value)?);
  101         -
                        }
  102         -
                        "aStringSet" => {
  103         -
                            builder = builder.set_a_string_set(crate::protocol_serde::shape_a_string_set::de_a_string_set(tokens, _value)?);
  104         -
                        }
  105         -
                        "aBlob" => {
  106         -
                            builder = builder.set_a_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  107         -
                        }
  108         -
                        "aUnion" => {
  109         -
                            builder = builder.set_a_union(crate::protocol_serde::shape_a_union::de_a_union(tokens, _value)?);
  110         -
                        }
  111         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  112         -
                    },
  113         -
                    other => {
  114         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  115         -
                            "expected object key or end object, found: {other:?}"
  116         -
                        )))
  117         -
                    }
  118         -
                }
  119         -
            }
  120         -
            Ok(Some(crate::serde_util::innermost_shape_correct_errors(builder).build().map_err(
  121         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
  122         -
            )?))
  123         -
        }
  124         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  125         -
            "expected start object or null",
  126         -
        )),
  127         -
    }
  128         -
}
  129         -
  130         -
pub fn ser_innermost_shape(
  131         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  132         -
    input: &crate::types::InnermostShape,
  133         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
  134         -
    {
  135         -
        object.key("aString").string(input.a_string.as_str());
  136         -
    }
  137         -
    {
  138         -
        object.key("aBoolean").boolean(input.a_boolean);
  139         -
    }
  140         -
    {
  141         -
        object.key("aByte").number(
  142         -
            #[allow(clippy::useless_conversion)]
  143         -
            ::aws_smithy_types::Number::NegInt((input.a_byte).into()),
  144         -
        );
  145         -
    }
  146         -
    {
  147         -
        object.key("aShort").number(
  148         -
            #[allow(clippy::useless_conversion)]
  149         -
            ::aws_smithy_types::Number::NegInt((input.a_short).into()),
  150         -
        );
  151         -
    }
  152         -
    {
  153         -
        object.key("anInt").number(
  154         -
            #[allow(clippy::useless_conversion)]
  155         -
            ::aws_smithy_types::Number::NegInt((input.an_int).into()),
  156         -
        );
  157         -
    }
  158         -
    {
  159         -
        object.key("aLong").number(
  160         -
            #[allow(clippy::useless_conversion)]
  161         -
            ::aws_smithy_types::Number::NegInt((input.a_long).into()),
  162         -
        );
  163         -
    }
  164         -
    {
  165         -
        object.key("aFloat").number(
  166         -
            #[allow(clippy::useless_conversion)]
  167         -
            ::aws_smithy_types::Number::Float((input.a_float).into()),
  168         -
        );
  169         -
    }
  170         -
    {
  171         -
        object.key("aDouble").number(
  172         -
            #[allow(clippy::useless_conversion)]
  173         -
            ::aws_smithy_types::Number::Float((input.a_double).into()),
  174         -
        );
  175         -
    }
  176         -
    {
  177         -
        object.key("aBigInteger").write_raw_value(input.a_big_integer.as_ref());
  178         -
    }
  179         -
    {
  180         -
        object.key("aBigDecimal").write_raw_value(input.a_big_decimal.as_ref());
  181         -
    }
  182         -
    {
  183         -
        object
  184         -
            .key("aTimestamp")
  185         -
            .date_time(&input.a_timestamp, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  186         -
    }
  187         -
    {
  188         -
        object
  189         -
            .key("aDocument")
  190         -
            .date_time(&input.a_document, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  191         -
    }
  192         -
    {
  193         -
        let mut array_1 = object.key("aStringList").start_array();
  194         -
        for item_2 in &input.a_string_list {
  195         -
            {
  196         -
                array_1.value().string(item_2.as_str());
  197         -
            }
  198         -
        }
  199         -
        array_1.finish();
  200         -
    }
  201         -
    {
  202         -
        #[allow(unused_mut)]
  203         -
        let mut object_3 = object.key("aStringMap").start_object();
  204         -
        for (key_4, value_5) in &input.a_string_map {
  205         -
            {
  206         -
                object_3
  207         -
                    .key(key_4.as_str())
  208         -
                    .date_time(value_5, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  209         -
            }
  210         -
        }
  211         -
        object_3.finish();
  212         -
    }
  213         -
    {
  214         -
        let mut array_6 = object.key("aStringSet").start_array();
  215         -
        for item_7 in &input.a_string_set {
  216         -
            {
  217         -
                array_6.value().string(item_7.as_str());
  218         -
            }
  219         -
        }
  220         -
        array_6.finish();
  221         -
    }
  222         -
    {
  223         -
        object.key("aBlob").string_unchecked(&::aws_smithy_types::base64::encode(&input.a_blob));
  224         -
    }
  225         -
    {
  226         -
        #[allow(unused_mut)]
  227         -
        let mut object_8 = object.key("aUnion").start_object();
  228         -
        crate::protocol_serde::shape_a_union::ser_a_union(&mut object_8, &input.a_union)?;
  229         -
        object_8.finish();
  230         -
    }
  231         -
    Ok(())
  232         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_a.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_list_a<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   15         -
            let mut items = Vec::new();
   16         -
            loop {
   17         -
                match tokens.peek() {
   18         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19         -
                        tokens.next().transpose().unwrap();
   20         -
                        break;
   21         -
                    }
   22         -
                    _ => {
   23         -
                        let value = crate::protocol_serde::shape_list_b::de_list_b(tokens, _value)?;
   24         -
                        if let Some(value) = value {
   25         -
                            items.push(value);
   26         -
                        } else {
   27         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                "dense list cannot contain null values",
   29         -
                            ));
   30         -
                        }
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(items))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start array or null",
   38         -
        )),
   39         -
    }
   40         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_b.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_list_b<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   15         -
            let mut items = Vec::new();
   16         -
            loop {
   17         -
                match tokens.peek() {
   18         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19         -
                        tokens.next().transpose().unwrap();
   20         -
                        break;
   21         -
                    }
   22         -
                    _ => {
   23         -
                        let value = crate::protocol_serde::shape_list_c::de_list_c(tokens, _value)?;
   24         -
                        if let Some(value) = value {
   25         -
                            items.push(value);
   26         -
                        } else {
   27         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                "dense list cannot contain null values",
   29         -
                            ));
   30         -
                        }
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(items))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start array or null",
   38         -
        )),
   39         -
    }
   40         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_c.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_list_c<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   15         -
            let mut items = Vec::new();
   16         -
            loop {
   17         -
                match tokens.peek() {
   18         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19         -
                        tokens.next().transpose().unwrap();
   20         -
                        break;
   21         -
                    }
   22         -
                    _ => {
   23         -
                        let value = crate::protocol_serde::shape_map_a::de_map_a(tokens, _value)?;
   24         -
                        if let Some(value) = value {
   25         -
                            items.push(value);
   26         -
                        } else {
   27         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                "dense list cannot contain null values",
   29         -
                            ));
   30         -
                        }
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(items))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start array or null",
   38         -
        )),
   39         -
    }
   40         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_map_a.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_map_a<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = crate::protocol_serde::shape_empty_structure::de_empty_structure(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_header_collection_operation.rs

@@ -1,0 +117,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_required_header_collection_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::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
    9         -
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   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::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "ValidationException" => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::ValidationError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
   33         -
            };
   34         -
            tmp
   35         -
        }),
   36         -
        _ => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::generic(generic),
   37         -
    })
   38         -
}
   39         -
   40         -
#[allow(clippy::unnecessary_wraps)]
   41         -
pub fn de_required_header_collection_operation_http_response(
   42         -
    _response_status: u16,
   43         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   44         -
    _response_body: &[u8],
   45         -
) -> std::result::Result<
   46         -
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   47         -
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   48         -
> {
   49         -
    Ok({
   50         -
        #[allow(unused_mut)]
   51         -
        let mut output = crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::default();
   52         -
        output = output.set_required_header_list(
   53         -
            crate::protocol_serde::shape_required_header_collection_operation_output::de_required_header_list_header(_response_headers).map_err(
   54         -
                |_| {
   55         -
                    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(
   56         -
                        "Failed to parse requiredHeaderList from header `X-Required-List",
   57         -
                    )
   58         -
                },
   59         -
            )?,
   60         -
        );
   61         -
        output = output.set_required_header_set(
   62         -
            crate::protocol_serde::shape_required_header_collection_operation_output::de_required_header_set_header(_response_headers).map_err(
   63         -
                |_| {
   64         -
                    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(
   65         -
                        "Failed to parse requiredHeaderSet from header `X-Required-Set",
   66         -
                    )
   67         -
                },
   68         -
            )?,
   69         -
        );
   70         -
        crate::serde_util::required_header_collection_operation_output_output_correct_errors(output)
   71         -
            .build()
   72         -
            .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
   73         -
    })
   74         -
}
   75         -
   76         -
pub fn ser_required_header_collection_operation_headers(
   77         -
    input: &crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
   78         -
    mut builder: ::http_1x::request::Builder,
   79         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   80         -
    if let ::std::option::Option::Some(inner_1) = &input.required_header_list {
   81         -
        // Empty vec in header is serialized as an empty string
   82         -
        if inner_1.is_empty() {
   83         -
            builder = builder.header("X-Required-List", "");
   84         -
        } else {
   85         -
            for inner_2 in inner_1 {
   86         -
                let formatted_3 = ::aws_smithy_http::header::quote_header_value(inner_2.as_str());
   87         -
                let header_value = formatted_3;
   88         -
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   89         -
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   90         -
                        "required_header_list",
   91         -
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
   92         -
                    )
   93         -
                })?;
   94         -
                builder = builder.header("X-Required-List", header_value);
   95         -
            }
   96         -
        }
   97         -
    }
   98         -
    if let ::std::option::Option::Some(inner_4) = &input.required_header_set {
   99         -
        // Empty vec in header is serialized as an empty string
  100         -
        if inner_4.is_empty() {
  101         -
            builder = builder.header("X-Required-Set", "");
  102         -
        } else {
  103         -
            for inner_5 in inner_4 {
  104         -
                let formatted_6 = ::aws_smithy_http::header::quote_header_value(inner_5.as_str());
  105         -
                let header_value = formatted_6;
  106         -
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  107         -
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  108         -
                        "required_header_set",
  109         -
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  110         -
                    )
  111         -
                })?;
  112         -
                builder = builder.header("X-Required-Set", header_value);
  113         -
            }
  114         -
        }
  115         -
    }
  116         -
    Ok(builder)
  117         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_header_collection_operation_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_required_header_list_header(
    3         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
    5         -
    let headers = header_map.get_all("X-Required-List");
    6         -
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
    7         -
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
    8         -
}
    9         -
   10         -
pub(crate) fn de_required_header_set_header(
   11         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
   12         -
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
   13         -
    let headers = header_map.get_all("X-Required-Set");
   14         -
    let var_2: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
   15         -
    Ok(if !var_2.is_empty() { Some(var_2) } else { None })
   16         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_inner_shape_operation.rs

@@ -1,0 +100,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_required_inner_shape_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::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
    9         -
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   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::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "ValidationException" => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::ValidationError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?
   33         -
            };
   34         -
            tmp
   35         -
        }),
   36         -
        _ => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::generic(generic),
   37         -
    })
   38         -
}
   39         -
   40         -
#[allow(clippy::unnecessary_wraps)]
   41         -
pub fn de_required_inner_shape_operation_http_response(
   42         -
    _response_status: u16,
   43         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   44         -
    _response_body: &[u8],
   45         -
) -> std::result::Result<
   46         -
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   47         -
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   48         -
> {
   49         -
    Ok({
   50         -
        #[allow(unused_mut)]
   51         -
        let mut output = crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder::default();
   52         -
        output = crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation(_response_body, output)
   53         -
            .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
   54         -
        output.build()
   55         -
    })
   56         -
}
   57         -
   58         -
pub fn ser_required_inner_shape_operation_input(
   59         -
    input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   60         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   61         -
    let mut out = String::new();
   62         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   63         -
    crate::protocol_serde::shape_required_inner_shape_operation_input::ser_required_inner_shape_operation_input_input(&mut object, input)?;
   64         -
    object.finish();
   65         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   66         -
}
   67         -
   68         -
pub(crate) fn de_required_inner_shape_operation(
   69         -
    _value: &[u8],
   70         -
    mut builder: crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder,
   71         -
) -> ::std::result::Result<
   72         -
    crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder,
   73         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   74         -
> {
   75         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   76         -
    let tokens = &mut tokens_owned;
   77         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   78         -
    loop {
   79         -
        match tokens.next().transpose()? {
   80         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   81         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   82         -
                "inner" => {
   83         -
                    builder = builder.set_inner(crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens, _value)?);
   84         -
                }
   85         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   86         -
            },
   87         -
            other => {
   88         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   89         -
                    "expected object key or end object, found: {other:?}"
   90         -
                )))
   91         -
            }
   92         -
        }
   93         -
    }
   94         -
    if tokens.next().is_some() {
   95         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   96         -
            "found more JSON tokens after completing parsing",
   97         -
        ));
   98         -
    }
   99         -
    Ok(builder)
  100         -
}