Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

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

@@ -1,0 +42,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_with_content_encoding_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::put_with_content_encoding::PutWithContentEncodingOutput,
    9         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   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::put_with_content_encoding::PutWithContentEncodingError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_put_with_content_encoding_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::put_with_content_encoding::PutWithContentEncodingOutput,
   25         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_put_with_content_encoding_input(
   35         -
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    let mut out = String::new();
   38         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   39         -
    crate::protocol_serde::shape_put_with_content_encoding_input::ser_put_with_content_encoding_input_input(&mut object, input)?;
   40         -
    object.finish();
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   42         -
}

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_with_content_encoding_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.encoding {
    7         -
        object.key("encoding").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.data {
   10         -
        object.key("data").string(var_2.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}

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

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_query_incompatible_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::query_incompatible_operation::QueryIncompatibleOperationOutput,
    9         -
    crate::operation::query_incompatible_operation::QueryIncompatibleOperationError,
   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::query_incompatible_operation::QueryIncompatibleOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::query_incompatible_operation::QueryIncompatibleOperationError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_query_incompatible_operation_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::query_incompatible_operation::QueryIncompatibleOperationOutput,
   27         -
    crate::operation::query_incompatible_operation::QueryIncompatibleOperationError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationOutputBuilder::default();
   32         -
        output.build()
   33         -
    })
   34         -
}
   35         -
   36         -
pub fn ser_query_incompatible_operation_input(
   37         -
    _input: &crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput,
   38         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   39         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   40         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_required_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_required_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/json_rpc10/rust-client-codegen/src/protocol_serde/shape_required_string_map.rs

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_required_string_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, ::std::string::String>>,
    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_string_or_null(tokens.next())?
   22         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23         -
                            .transpose()?;
   24         -
                        match value {
   25         -
                            Some(value) => {
   26         -
                                map.insert(key, value);
   27         -
                            }
   28         -
                            None => {
   29         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30         -
                                    "dense map cannot contain null values",
   31         -
                                ))
   32         -
                            }
   33         -
                        }
   34         -
                    }
   35         -
                    other => {
   36         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   37         -
                            "expected object key or end object, found: {other:?}"
   38         -
                        )))
   39         -
                    }
   40         -
                }
   41         -
            }
   42         -
            Ok(Some(map))
   43         -
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
            "expected start object or null",
   46         -
        )),
   47         -
    }
   48         -
}

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

@@ -1,0 +83,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_simple_scalar_properties_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::simple_scalar_properties::SimpleScalarPropertiesOutput,
    9         -
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   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::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_simple_scalar_properties_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::simple_scalar_properties::SimpleScalarPropertiesOutput,
   25         -
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default();
   30         -
        output = crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(_response_body, output)
   31         -
            .map_err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
   32         -
        output.build()
   33         -
    })
   34         -
}
   35         -
   36         -
pub fn ser_simple_scalar_properties_input(
   37         -
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   38         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   39         -
    let mut out = String::new();
   40         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   41         -
    crate::protocol_serde::shape_simple_scalar_properties_input::ser_simple_scalar_properties_input_input(&mut object, input)?;
   42         -
    object.finish();
   43         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   44         -
}
   45         -
   46         -
pub(crate) fn de_simple_scalar_properties(
   47         -
    _value: &[u8],
   48         -
    mut builder: crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   49         -
) -> ::std::result::Result<
   50         -
    crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   51         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   52         -
> {
   53         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   54         -
    let tokens = &mut tokens_owned;
   55         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   56         -
    loop {
   57         -
        match tokens.next().transpose()? {
   58         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   59         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   60         -
                "floatValue" => {
   61         -
                    builder = builder
   62         -
                        .set_float_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
   63         -
                }
   64         -
                "doubleValue" => {
   65         -
                    builder = builder
   66         -
                        .set_double_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
   67         -
                }
   68         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   69         -
            },
   70         -
            other => {
   71         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   72         -
                    "expected object key or end object, found: {other:?}"
   73         -
                )))
   74         -
            }
   75         -
        }
   76         -
    }
   77         -
    if tokens.next().is_some() {
   78         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   79         -
            "found more JSON tokens after completing parsing",
   80         -
        ));
   81         -
    }
   82         -
    Ok(builder)
   83         -
}

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

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_simple_scalar_properties_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.float_value {
    7         -
        object.key("floatValue").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::Float((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    if let Some(var_2) = &input.double_value {
   13         -
        object.key("doubleValue").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::Float((*var_2).into()),
   16         -
        );
   17         -
    }
   18         -
    Ok(())
   19         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_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_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/json_rpc10/rust-client-codegen/src/protocol_serde/shape_string_map.rs

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_string_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, ::std::string::String>>,
    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_string_or_null(tokens.next())?
   22         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23         -
                            .transpose()?;
   24         -
                        match value {
   25         -
                            Some(value) => {
   26         -
                                map.insert(key, value);
   27         -
                            }
   28         -
                            None => {
   29         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30         -
                                    "dense map cannot contain null values",
   31         -
                                ))
   32         -
                            }
   33         -
                        }
   34         -
                    }
   35         -
                    other => {
   36         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   37         -
                            "expected object key or end object, found: {other:?}"
   38         -
                        )))
   39         -
                    }
   40         -
                }
   41         -
            }
   42         -
            Ok(Some(map))
   43         -
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
            "expected start object or null",
   46         -
        )),
   47         -
    }
   48         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_test_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_test_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/json_rpc10/rust-client-codegen/src/protocol_serde/shape_test_string_map.rs

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_test_string_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, ::std::string::String>>,
    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_string_or_null(tokens.next())?
   22         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23         -
                            .transpose()?;
   24         -
                        match value {
   25         -
                            Some(value) => {
   26         -
                                map.insert(key, value);
   27         -
                            }
   28         -
                            None => {
   29         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30         -
                                    "dense map cannot contain null values",
   31         -
                                ))
   32         -
                            }
   33         -
                        }
   34         -
                    }
   35         -
                    other => {
   36         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   37         -
                            "expected object key or end object, found: {other:?}"
   38         -
                        )))
   39         -
                    }
   40         -
                }
   41         -
            }
   42         -
            Ok(Some(map))
   43         -
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
            "expected start object or null",
   46         -
        )),
   47         -
    }
   48         -
}

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

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_top_level(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::TopLevel,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_1 = object.key("dialog").start_object();
    9         -
        crate::protocol_serde::shape_dialog::ser_dialog(&mut object_1, &input.dialog)?;
   10         -
        object_1.finish();
   11         -
    }
   12         -
    {
   13         -
        let mut array_2 = object.key("dialogList").start_array();
   14         -
        for item_3 in &input.dialog_list {
   15         -
            {
   16         -
                #[allow(unused_mut)]
   17         -
                let mut object_4 = array_2.value().start_object();
   18         -
                crate::protocol_serde::shape_dialog::ser_dialog(&mut object_4, item_3)?;
   19         -
                object_4.finish();
   20         -
            }
   21         -
        }
   22         -
        array_2.finish();
   23         -
    }
   24         -
    {
   25         -
        #[allow(unused_mut)]
   26         -
        let mut object_5 = object.key("dialogMap").start_object();
   27         -
        for (key_6, value_7) in &input.dialog_map {
   28         -
            {
   29         -
                #[allow(unused_mut)]
   30         -
                let mut object_8 = object_5.key(key_6.as_str()).start_object();
   31         -
                crate::protocol_serde::shape_dialog::ser_dialog(&mut object_8, value_7)?;
   32         -
                object_8.finish();
   33         -
            }
   34         -
        }
   35         -
        object_5.finish();
   36         -
    }
   37         -
    Ok(())
   38         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/serde_util.rs

@@ -1,0 +102,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn operation_with_nested_structure_output_output_correct_errors(
    3         -
    mut builder: crate::operation::operation_with_nested_structure::builders::OperationWithNestedStructureOutputBuilder,
    4         -
) -> crate::operation::operation_with_nested_structure::builders::OperationWithNestedStructureOutputBuilder {
    5         -
    if builder.dialog.is_none() {
    6         -
        builder.dialog = {
    7         -
            let builder = crate::types::builders::DialogBuilder::default();
    8         -
            Some(builder.build())
    9         -
        }
   10         -
    }
   11         -
    builder
   12         -
}
   13         -
   14         -
pub(crate) fn operation_with_required_members_output_output_correct_errors(
   15         -
    mut builder: crate::operation::operation_with_required_members::builders::OperationWithRequiredMembersOutputBuilder,
   16         -
) -> crate::operation::operation_with_required_members::builders::OperationWithRequiredMembersOutputBuilder {
   17         -
    if builder.required_string.is_none() {
   18         -
        builder.required_string = Some(Default::default())
   19         -
    }
   20         -
    if builder.required_boolean.is_none() {
   21         -
        builder.required_boolean = Some(Default::default())
   22         -
    }
   23         -
    if builder.required_list.is_none() {
   24         -
        builder.required_list = Some(Default::default())
   25         -
    }
   26         -
    if builder.required_timestamp.is_none() {
   27         -
        builder.required_timestamp = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64))
   28         -
    }
   29         -
    if builder.required_blob.is_none() {
   30         -
        builder.required_blob = Some(::aws_smithy_types::Blob::new(""))
   31         -
    }
   32         -
    if builder.required_byte.is_none() {
   33         -
        builder.required_byte = Some(Default::default())
   34         -
    }
   35         -
    if builder.required_short.is_none() {
   36         -
        builder.required_short = Some(Default::default())
   37         -
    }
   38         -
    if builder.required_integer.is_none() {
   39         -
        builder.required_integer = Some(Default::default())
   40         -
    }
   41         -
    if builder.required_long.is_none() {
   42         -
        builder.required_long = Some(Default::default())
   43         -
    }
   44         -
    if builder.required_float.is_none() {
   45         -
        builder.required_float = Some(Default::default())
   46         -
    }
   47         -
    if builder.required_double.is_none() {
   48         -
        builder.required_double = Some(Default::default())
   49         -
    }
   50         -
    if builder.required_map.is_none() {
   51         -
        builder.required_map = Some(Default::default())
   52         -
    }
   53         -
    builder
   54         -
}
   55         -
   56         -
pub(crate) fn operation_with_required_members_with_defaults_output_output_correct_errors(
   57         -
    mut builder: crate::operation::operation_with_required_members_with_defaults::builders::OperationWithRequiredMembersWithDefaultsOutputBuilder,
   58         -
) -> crate::operation::operation_with_required_members_with_defaults::builders::OperationWithRequiredMembersWithDefaultsOutputBuilder {
   59         -
    if builder.required_string.is_none() {
   60         -
        builder.required_string = Some(Default::default())
   61         -
    }
   62         -
    if builder.required_boolean.is_none() {
   63         -
        builder.required_boolean = Some(Default::default())
   64         -
    }
   65         -
    if builder.required_list.is_none() {
   66         -
        builder.required_list = Some(Default::default())
   67         -
    }
   68         -
    if builder.required_timestamp.is_none() {
   69         -
        builder.required_timestamp = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64))
   70         -
    }
   71         -
    if builder.required_blob.is_none() {
   72         -
        builder.required_blob = Some(::aws_smithy_types::Blob::new(""))
   73         -
    }
   74         -
    if builder.required_byte.is_none() {
   75         -
        builder.required_byte = Some(Default::default())
   76         -
    }
   77         -
    if builder.required_short.is_none() {
   78         -
        builder.required_short = Some(Default::default())
   79         -
    }
   80         -
    if builder.required_integer.is_none() {
   81         -
        builder.required_integer = Some(Default::default())
   82         -
    }
   83         -
    if builder.required_long.is_none() {
   84         -
        builder.required_long = Some(Default::default())
   85         -
    }
   86         -
    if builder.required_float.is_none() {
   87         -
        builder.required_float = Some(Default::default())
   88         -
    }
   89         -
    if builder.required_double.is_none() {
   90         -
        builder.required_double = Some(Default::default())
   91         -
    }
   92         -
    if builder.required_map.is_none() {
   93         -
        builder.required_map = Some(Default::default())
   94         -
    }
   95         -
    if builder.required_enum.is_none() {
   96         -
        builder.required_enum = "no value was set".parse::<crate::types::RequiredEnum>().ok()
   97         -
    }
   98         -
    if builder.required_int_enum.is_none() {
   99         -
        builder.required_int_enum = Some(Default::default())
  100         -
    }
  101         -
    builder
  102         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/serialization_settings.rs

@@ -1,0 +89,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/*
    3         -
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4         -
 * SPDX-License-Identifier: Apache-2.0
    5         -
 */
    6         -
    7         -
#![allow(dead_code)]
    8         -
    9         -
use aws_smithy_http::header::set_request_header_if_absent;
   10         -
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12         -
   13         -
/// Configuration for how default protocol headers are serialized
   14         -
#[derive(Clone, Debug, Default)]
   15         -
pub(crate) struct HeaderSerializationSettings {
   16         -
    omit_default_content_length: bool,
   17         -
    omit_default_content_type: bool,
   18         -
}
   19         -
   20         -
impl HeaderSerializationSettings {
   21         -
    /// Creates new [`HeaderSerializationSettings`]
   22         -
    pub(crate) fn new() -> Self {
   23         -
        Default::default()
   24         -
    }
   25         -
   26         -
    /// Omit the default `Content-Length` header during serialization
   27         -
    pub(crate) fn omit_default_content_length(self) -> Self {
   28         -
        Self {
   29         -
            omit_default_content_length: true,
   30         -
            ..self
   31         -
        }
   32         -
    }
   33         -
   34         -
    /// Omit the default `Content-Type` header during serialization
   35         -
    pub(crate) fn omit_default_content_type(self) -> Self {
   36         -
        Self {
   37         -
            omit_default_content_type: true,
   38         -
            ..self
   39         -
        }
   40         -
    }
   41         -
   42         -
    /// Returns true if the given default header name should be serialized
   43         -
    fn include_header(&self, header: &HeaderName) -> bool {
   44         -
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45         -
    }
   46         -
   47         -
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(
   49         -
        &self,
   50         -
        mut request: http_1x::request::Builder,
   51         -
        header_name: HeaderName,
   52         -
        value: &str,
   53         -
    ) -> http_1x::request::Builder {
   54         -
        if self.include_header(&header_name) {
   55         -
            request = set_request_header_if_absent(request, header_name, value);
   56         -
        }
   57         -
        request
   58         -
    }
   59         -
}
   60         -
   61         -
impl Storable for HeaderSerializationSettings {
   62         -
    type Storer = StoreReplace<Self>;
   63         -
}
   64         -
   65         -
#[cfg(test)]
   66         -
mod tests {
   67         -
    use super::*;
   68         -
   69         -
    #[test]
   70         -
    fn test_include_header() {
   71         -
        let settings = HeaderSerializationSettings::default();
   72         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   73         -
        assert!(settings.include_header(&CONTENT_TYPE));
   74         -
   75         -
        let settings = HeaderSerializationSettings::default().omit_default_content_length();
   76         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   77         -
        assert!(settings.include_header(&CONTENT_TYPE));
   78         -
   79         -
        let settings = HeaderSerializationSettings::default().omit_default_content_type();
   80         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   81         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   82         -
   83         -
        let settings = HeaderSerializationSettings::default()
   84         -
            .omit_default_content_type()
   85         -
            .omit_default_content_length();
   86         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   87         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   88         -
    }
   89         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_client_optional_defaults.rs

@@ -23,23 +106,117 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.member {
   46     46   
            ser.write_integer(&CLIENTOPTIONALDEFAULTS_MEMBER_MEMBER, *val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl ClientOptionalDefaults {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&CLIENTOPTIONALDEFAULTS_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&CLIENTOPTIONALDEFAULTS_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.member = Some(deser.read_integer(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl ClientOptionalDefaults {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl ClientOptionalDefaults {
   78     89   
    /// Creates a new builder-style object to manufacture [`ClientOptionalDefaults`](crate::types::ClientOptionalDefaults).
   79     90   
    pub fn builder() -> crate::types::builders::ClientOptionalDefaultsBuilder {
   80     91   
        crate::types::builders::ClientOptionalDefaultsBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`ClientOptionalDefaults`](crate::types::ClientOptionalDefaults).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_complex_nested_error_data.rs

@@ -1,1 +107,118 @@
   17     17   
    "aws.protocoltests.json10",
   18     18   
    "ComplexNestedErrorData",
   19     19   
);
   20     20   
static COMPLEXNESTEDERRORDATA_MEMBER_FOO: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.json10#ComplexNestedErrorData$Foo",
   23     23   
        "aws.protocoltests.json10",
   24     24   
        "ComplexNestedErrorData",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "foo",
          27  +
    "Foo",
   28     28   
    0,
   29     29   
)
   30     30   
.with_json_name("Fooooo");
   31     31   
static COMPLEXNESTEDERRORDATA_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    COMPLEXNESTEDERRORDATA_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&COMPLEXNESTEDERRORDATA_MEMBER_FOO],
   35     35   
);
   36     36   
impl ComplexNestedErrorData {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXNESTEDERRORDATA_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for ComplexNestedErrorData {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.foo {
   47     47   
            ser.write_string(&COMPLEXNESTEDERRORDATA_MEMBER_FOO, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl ComplexNestedErrorData {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&COMPLEXNESTEDERRORDATA_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&COMPLEXNESTEDERRORDATA_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.foo = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl ComplexNestedErrorData {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   78     89   
impl ComplexNestedErrorData {
   79     90   
    /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
   80     91   
    pub fn builder() -> crate::types::builders::ComplexNestedErrorDataBuilder {
   81     92   
        crate::types::builders::ComplexNestedErrorDataBuilder::default()
   82     93   
    }
   83     94   
}
   84     95   
   85     96   
/// A builder for [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
   86     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87     98   
#[non_exhaustive]