Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_endpoint_with_host_label_operation.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_endpoint_with_host_label_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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
    9         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_endpoint_with_host_label_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   25         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_endpoint_with_host_label_operation_input(
   35         -
    input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   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_endpoint_with_host_label_operation_input::ser_endpoint_with_host_label_operation_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_rpc11/rust-client-codegen/src/protocol_serde/shape_endpoint_with_host_label_operation_input.rs

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

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

@@ -1,0 +65,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_error_with_members_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ErrorWithMembersBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ErrorWithMembersBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "Code" => {
   14         -
                    builder = builder.set_code(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                "ComplexData" => {
   21         -
                    builder = builder.set_complex_data(crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens, _value)?);
   22         -
                }
   23         -
                "IntegerField" => {
   24         -
                    builder = builder.set_integer_field(
   25         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   26         -
                            .map(i32::try_from)
   27         -
                            .transpose()?,
   28         -
                    );
   29         -
                }
   30         -
                "ListField" => {
   31         -
                    builder = builder.set_list_field(crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens, _value)?);
   32         -
                }
   33         -
                "MapField" => {
   34         -
                    builder = builder.set_map_field(crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens, _value)?);
   35         -
                }
   36         -
                "Message" => {
   37         -
                    builder = builder.set_message(
   38         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   39         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   40         -
                            .transpose()?,
   41         -
                    );
   42         -
                }
   43         -
                "StringField" => {
   44         -
                    builder = builder.set_string_field(
   45         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   46         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   47         -
                            .transpose()?,
   48         -
                    );
   49         -
                }
   50         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   51         -
            },
   52         -
            other => {
   53         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   54         -
                    "expected object key or end object, found: {other:?}"
   55         -
                )))
   56         -
            }
   57         -
        }
   58         -
    }
   59         -
    if tokens.next().is_some() {
   60         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   61         -
            "found more JSON tokens after completing parsing",
   62         -
        ));
   63         -
    }
   64         -
    Ok(builder)
   65         -
}

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

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_error_without_members_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ErrorWithoutMembersBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ErrorWithoutMembersBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "Message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_foo_enum_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_foo_enum_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::FooEnum>>, ::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| crate::types::FooEnum::from(u.as_ref())))
   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_rpc11/rust-client-codegen/src/protocol_serde/shape_foo_enum_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_foo_enum_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, crate::types::FooEnum>>,
    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| crate::types::FooEnum::from(u.as_ref())))
   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_rpc11/rust-client-codegen/src/protocol_serde/shape_foo_enum_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_foo_enum_set<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::FooEnum>>, ::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| crate::types::FooEnum::from(u.as_ref())))
   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_rpc11/rust-client-codegen/src/protocol_serde/shape_foo_error.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_foo_error_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::FooErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::FooErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "Message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

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

@@ -1,0 +73,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_fractional_seconds_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::fractional_seconds::FractionalSecondsOutput, crate::operation::fractional_seconds::FractionalSecondsError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::fractional_seconds::FractionalSecondsError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    Err(crate::operation::fractional_seconds::FractionalSecondsError::generic(generic))
   14         -
}
   15         -
   16         -
#[allow(clippy::unnecessary_wraps)]
   17         -
pub fn de_fractional_seconds_http_response(
   18         -
    _response_status: u16,
   19         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20         -
    _response_body: &[u8],
   21         -
) -> std::result::Result<crate::operation::fractional_seconds::FractionalSecondsOutput, crate::operation::fractional_seconds::FractionalSecondsError>
   22         -
{
   23         -
    Ok({
   24         -
        #[allow(unused_mut)]
   25         -
        let mut output = crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder::default();
   26         -
        output = crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds(_response_body, output)
   27         -
            .map_err(crate::operation::fractional_seconds::FractionalSecondsError::unhandled)?;
   28         -
        output.build()
   29         -
    })
   30         -
}
   31         -
   32         -
pub fn ser_fractional_seconds_input(
   33         -
    _input: &crate::operation::fractional_seconds::FractionalSecondsInput,
   34         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   35         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   36         -
}
   37         -
   38         -
pub(crate) fn de_fractional_seconds(
   39         -
    _value: &[u8],
   40         -
    mut builder: crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder,
   41         -
) -> ::std::result::Result<
   42         -
    crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder,
   43         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   44         -
> {
   45         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   46         -
    let tokens = &mut tokens_owned;
   47         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   48         -
    loop {
   49         -
        match tokens.next().transpose()? {
   50         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   51         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   52         -
                "datetime" => {
   53         -
                    builder = builder.set_datetime(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   54         -
                        tokens.next(),
   55         -
                        ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
   56         -
                    )?);
   57         -
                }
   58         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   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         -
    if tokens.next().is_some() {
   68         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   69         -
            "found more JSON tokens after completing parsing",
   70         -
        ));
   71         -
    }
   72         -
    Ok(builder)
   73         -
}

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

@@ -1,0 +50,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_greeting_struct<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::GreetingStruct>, ::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::GreetingStructBuilder::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         -
                        "hi" => {
   19         -
                            builder = builder.set_hi(
   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         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   26         -
                    },
   27         -
                    other => {
   28         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29         -
                            "expected object key or end object, found: {other:?}"
   30         -
                        )))
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}
   41         -
   42         -
pub fn ser_greeting_struct(
   43         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44         -
    input: &crate::types::GreetingStruct,
   45         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   46         -
    if let Some(var_1) = &input.hi {
   47         -
        object.key("hi").string(var_1.as_str());
   48         -
    }
   49         -
    Ok(())
   50         -
}

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

@@ -1,0 +131,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_greeting_with_errors_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::greeting_with_errors::GreetingWithErrorsOutput,
    9         -
    crate::operation::greeting_with_errors::GreetingWithErrorsError,
   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::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "InvalidGreeting" => crate::operation::greeting_with_errors::GreetingWithErrorsError::InvalidGreeting({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::InvalidGreetingBuilder::default();
   27         -
                output = crate::protocol_serde::shape_invalid_greeting::de_invalid_greeting_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        "ComplexError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError({
   38         -
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ComplexErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_complex_error::de_complex_error_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   44         -
                let output = output.meta(generic);
   45         -
                output.build()
   46         -
            };
   47         -
            if tmp.message.is_none() {
   48         -
                tmp.message = _error_message;
   49         -
            }
   50         -
            tmp
   51         -
        }),
   52         -
        "FooError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError({
   53         -
            #[allow(unused_mut)]
   54         -
            let mut tmp = {
   55         -
                #[allow(unused_mut)]
   56         -
                let mut output = crate::types::error::builders::FooErrorBuilder::default();
   57         -
                output = crate::protocol_serde::shape_foo_error::de_foo_error_json_err(_response_body, output)
   58         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   59         -
                let output = output.meta(generic);
   60         -
                output.build()
   61         -
            };
   62         -
            if tmp.message.is_none() {
   63         -
                tmp.message = _error_message;
   64         -
            }
   65         -
            tmp
   66         -
        }),
   67         -
        _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
   68         -
    })
   69         -
}
   70         -
   71         -
#[allow(clippy::unnecessary_wraps)]
   72         -
pub fn de_greeting_with_errors_http_response(
   73         -
    _response_status: u16,
   74         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   75         -
    _response_body: &[u8],
   76         -
) -> std::result::Result<
   77         -
    crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   78         -
    crate::operation::greeting_with_errors::GreetingWithErrorsError,
   79         -
> {
   80         -
    Ok({
   81         -
        #[allow(unused_mut)]
   82         -
        let mut output = crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default();
   83         -
        output = crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors(_response_body, output)
   84         -
            .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   85         -
        output.build()
   86         -
    })
   87         -
}
   88         -
   89         -
pub fn ser_greeting_with_errors_input(
   90         -
    _input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
   91         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   92         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   93         -
}
   94         -
   95         -
pub(crate) fn de_greeting_with_errors(
   96         -
    _value: &[u8],
   97         -
    mut builder: crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
   98         -
) -> ::std::result::Result<
   99         -
    crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
  100         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  101         -
> {
  102         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  103         -
    let tokens = &mut tokens_owned;
  104         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  105         -
    loop {
  106         -
        match tokens.next().transpose()? {
  107         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  108         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  109         -
                "greeting" => {
  110         -
                    builder = builder.set_greeting(
  111         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  112         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  113         -
                            .transpose()?,
  114         -
                    );
  115         -
                }
  116         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  117         -
            },
  118         -
            other => {
  119         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  120         -
                    "expected object key or end object, found: {other:?}"
  121         -
                )))
  122         -
            }
  123         -
        }
  124         -
    }
  125         -
    if tokens.next().is_some() {
  126         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  127         -
            "found more JSON tokens after completing parsing",
  128         -
        ));
  129         -
    }
  130         -
    Ok(builder)
  131         -
}

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

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_host_with_path_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::host_with_path_operation::HostWithPathOperationOutput,
    9         -
    crate::operation::host_with_path_operation::HostWithPathOperationError,
   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::host_with_path_operation::HostWithPathOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::host_with_path_operation::HostWithPathOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_host_with_path_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::host_with_path_operation::HostWithPathOperationOutput,
   25         -
    crate::operation::host_with_path_operation::HostWithPathOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::host_with_path_operation::builders::HostWithPathOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_host_with_path_operation_input(
   35         -
    _input: &crate::operation::host_with_path_operation::HostWithPathOperationInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   38         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_integer_enum_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_integer_enum_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<i32>>, ::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_number_or_null(tokens.next())?
   21         -
                            .map(i32::try_from)
   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_rpc11/rust-client-codegen/src/protocol_serde/shape_integer_enum_map.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_integer_enum_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_integer_enum_set<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<i32>>, ::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_number_or_null(tokens.next())?
   21         -
                            .map(i32::try_from)
   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         -
}