Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

@@ -1,0 +111,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_json_timestamps_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::json_timestamps::JsonTimestampsOutput, crate::operation::json_timestamps::JsonTimestampsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::json_timestamps::JsonTimestampsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::json_timestamps::JsonTimestampsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_json_timestamps_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::json_timestamps::JsonTimestampsOutput, crate::operation::json_timestamps::JsonTimestampsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_json_timestamps::de_json_timestamps(_response_body, output)
   25         -
            .map_err(crate::operation::json_timestamps::JsonTimestampsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_json_timestamps_input(
   31         -
    input: &crate::operation::json_timestamps::JsonTimestampsInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    let mut out = String::new();
   34         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   35         -
    crate::protocol_serde::shape_json_timestamps_input::ser_json_timestamps_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_json_timestamps(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder,
   45         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   46         -
> {
   47         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   48         -
    let tokens = &mut tokens_owned;
   49         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   50         -
    loop {
   51         -
        match tokens.next().transpose()? {
   52         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   53         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   54         -
                "dateTime" => {
   55         -
                    builder = builder.set_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   56         -
                        tokens.next(),
   57         -
                        ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
   58         -
                    )?);
   59         -
                }
   60         -
                "dateTimeOnTarget" => {
   61         -
                    builder = builder.set_date_time_on_target(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   62         -
                        tokens.next(),
   63         -
                        ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
   64         -
                    )?);
   65         -
                }
   66         -
                "epochSeconds" => {
   67         -
                    builder = builder.set_epoch_seconds(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   68         -
                        tokens.next(),
   69         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   70         -
                    )?);
   71         -
                }
   72         -
                "epochSecondsOnTarget" => {
   73         -
                    builder = builder.set_epoch_seconds_on_target(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   74         -
                        tokens.next(),
   75         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   76         -
                    )?);
   77         -
                }
   78         -
                "httpDate" => {
   79         -
                    builder = builder.set_http_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   80         -
                        tokens.next(),
   81         -
                        ::aws_smithy_types::date_time::Format::HttpDate,
   82         -
                    )?);
   83         -
                }
   84         -
                "httpDateOnTarget" => {
   85         -
                    builder = builder.set_http_date_on_target(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   86         -
                        tokens.next(),
   87         -
                        ::aws_smithy_types::date_time::Format::HttpDate,
   88         -
                    )?);
   89         -
                }
   90         -
                "normal" => {
   91         -
                    builder = builder.set_normal(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   92         -
                        tokens.next(),
   93         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   94         -
                    )?);
   95         -
                }
   96         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   97         -
            },
   98         -
            other => {
   99         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  100         -
                    "expected object key or end object, found: {other:?}"
  101         -
                )))
  102         -
            }
  103         -
        }
  104         -
    }
  105         -
    if tokens.next().is_some() {
  106         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  107         -
            "found more JSON tokens after completing parsing",
  108         -
        ));
  109         -
    }
  110         -
    Ok(builder)
  111         -
}

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

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_json_timestamps_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::json_timestamps::JsonTimestampsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.date_time {
    7         -
        object.key("dateTime").date_time(var_1, ::aws_smithy_types::date_time::Format::DateTime)?;
    8         -
    }
    9         -
    if let Some(var_2) = &input.date_time_on_target {
   10         -
        object
   11         -
            .key("dateTimeOnTarget")
   12         -
            .date_time(var_2, ::aws_smithy_types::date_time::Format::DateTime)?;
   13         -
    }
   14         -
    if let Some(var_3) = &input.epoch_seconds {
   15         -
        object
   16         -
            .key("epochSeconds")
   17         -
            .date_time(var_3, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   18         -
    }
   19         -
    if let Some(var_4) = &input.epoch_seconds_on_target {
   20         -
        object
   21         -
            .key("epochSecondsOnTarget")
   22         -
            .date_time(var_4, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   23         -
    }
   24         -
    if let Some(var_5) = &input.http_date {
   25         -
        object.key("httpDate").date_time(var_5, ::aws_smithy_types::date_time::Format::HttpDate)?;
   26         -
    }
   27         -
    if let Some(var_6) = &input.http_date_on_target {
   28         -
        object
   29         -
            .key("httpDateOnTarget")
   30         -
            .date_time(var_6, ::aws_smithy_types::date_time::Format::HttpDate)?;
   31         -
    }
   32         -
    if let Some(var_7) = &input.normal {
   33         -
        object
   34         -
            .key("normal")
   35         -
            .date_time(var_7, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   36         -
    }
   37         -
    Ok(())
   38         -
}

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

@@ -1,0 +70,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_json_unions_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::json_unions::JsonUnionsOutput, crate::operation::json_unions::JsonUnionsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::json_unions::JsonUnionsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::json_unions::JsonUnionsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_json_unions_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::json_unions::JsonUnionsOutput, crate::operation::json_unions::JsonUnionsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::json_unions::builders::JsonUnionsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_json_unions::de_json_unions(_response_body, output)
   25         -
            .map_err(crate::operation::json_unions::JsonUnionsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_json_unions_input(
   31         -
    input: &crate::operation::json_unions::JsonUnionsInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    let mut out = String::new();
   34         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   35         -
    crate::protocol_serde::shape_json_unions_input::ser_json_unions_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_json_unions(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::json_unions::builders::JsonUnionsOutputBuilder,
   43         -
) -> ::std::result::Result<crate::operation::json_unions::builders::JsonUnionsOutputBuilder, ::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         -
                "contents" => {
   53         -
                    builder = builder.set_contents(crate::protocol_serde::shape_my_union::de_my_union(tokens, _value)?);
   54         -
                }
   55         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   56         -
            },
   57         -
            other => {
   58         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   59         -
                    "expected object key or end object, found: {other:?}"
   60         -
                )))
   61         -
            }
   62         -
        }
   63         -
    }
   64         -
    if tokens.next().is_some() {
   65         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   66         -
            "found more JSON tokens after completing parsing",
   67         -
        ));
   68         -
    }
   69         -
    Ok(builder)
   70         -
}

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_json_unions_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::json_unions::JsonUnionsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.contents {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("contents").start_object();
    9         -
        crate::protocol_serde::shape_my_union::ser_my_union(&mut object_2, var_1)?;
   10         -
        object_2.finish();
   11         -
    }
   12         -
    Ok(())
   13         -
}

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

@@ -1,0 +74,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_malformed_accept_with_body_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::malformed_accept_with_body::MalformedAcceptWithBodyOutput,
    9         -
    crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   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::malformed_accept_with_body::MalformedAcceptWithBodyError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_malformed_accept_with_body_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::malformed_accept_with_body::MalformedAcceptWithBodyOutput,
   27         -
    crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder::default();
   32         -
        output = crate::protocol_serde::shape_malformed_accept_with_body::de_malformed_accept_with_body(_response_body, output)
   33         -
            .map_err(crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError::unhandled)?;
   34         -
        output.build()
   35         -
    })
   36         -
}
   37         -
   38         -
pub(crate) fn de_malformed_accept_with_body(
   39         -
    _value: &[u8],
   40         -
    mut builder: crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder,
   41         -
) -> ::std::result::Result<
   42         -
    crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder,
   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         -
                "hi" => {
   53         -
                    builder = builder.set_hi(
   54         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   55         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   56         -
                            .transpose()?,
   57         -
                    );
   58         -
                }
   59         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   60         -
            },
   61         -
            other => {
   62         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   63         -
                    "expected object key or end object, found: {other:?}"
   64         -
                )))
   65         -
            }
   66         -
        }
   67         -
    }
   68         -
    if tokens.next().is_some() {
   69         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   70         -
            "found more JSON tokens after completing parsing",
   71         -
        ));
   72         -
    }
   73         -
    Ok(builder)
   74         -
}

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

@@ -1,0 +33,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_malformed_accept_with_generic_string_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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
    9         -
    crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_malformed_accept_with_generic_string_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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   25         -
    crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringOutputBuilder::default();
   30         -
        output = output.set_payload(crate::protocol_serde::shape_malformed_accept_with_generic_string_output::de_payload_payload(_response_body)?);
   31         -
        output.build()
   32         -
    })
   33         -
}

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

@@ -1,0 +15,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_payload_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<
    5         -
    ::std::option::Option<::std::string::String>,
    6         -
    crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
    7         -
> {
    8         -
    (!body.is_empty())
    9         -
        .then(|| {
   10         -
            let body_str = std::str::from_utf8(body)
   11         -
                .map_err(crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError::unhandled)?;
   12         -
            Ok(body_str.to_string())
   13         -
        })
   14         -
        .transpose()
   15         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_malformed_accept_with_payload_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::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput,
    9         -
    crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
   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::malformed_accept_with_payload::MalformedAcceptWithPayloadError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_malformed_accept_with_payload_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::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput,
   27         -
    crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::malformed_accept_with_payload::builders::MalformedAcceptWithPayloadOutputBuilder::default();
   32         -
        output = output.set_payload(crate::protocol_serde::shape_malformed_accept_with_payload_output::de_payload_payload(
   33         -
            _response_body,
   34         -
        )?);
   35         -
        output.build()
   36         -
    })
   37         -
}

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

@@ -1,0 +9,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_payload_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<
    5         -
    ::std::option::Option<::aws_smithy_types::Blob>,
    6         -
    crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
    7         -
> {
    8         -
    (!body.is_empty()).then(|| Ok(::aws_smithy_types::Blob::new(body))).transpose()
    9         -
}

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

@@ -1,0 +36,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_malformed_blob_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::malformed_blob::MalformedBlobOutput, crate::operation::malformed_blob::MalformedBlobError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::malformed_blob::MalformedBlobError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::malformed_blob::MalformedBlobError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_malformed_blob_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::malformed_blob::MalformedBlobOutput, crate::operation::malformed_blob::MalformedBlobError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::malformed_blob::builders::MalformedBlobOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}
   27         -
   28         -
pub fn ser_malformed_blob_input(
   29         -
    input: &crate::operation::malformed_blob::MalformedBlobInput,
   30         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   31         -
    let mut out = String::new();
   32         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   33         -
    crate::protocol_serde::shape_malformed_blob_input::ser_malformed_blob_input_input(&mut object, input)?;
   34         -
    object.finish();
   35         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   36         -
}

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

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

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

@@ -1,0 +55,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_malformed_boolean_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::malformed_boolean::MalformedBooleanOutput, crate::operation::malformed_boolean::MalformedBooleanError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::malformed_boolean::MalformedBooleanError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::malformed_boolean::MalformedBooleanError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_malformed_boolean_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::malformed_boolean::MalformedBooleanOutput, crate::operation::malformed_boolean::MalformedBooleanError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::malformed_boolean::builders::MalformedBooleanOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}
   27         -
   28         -
pub fn ser_malformed_boolean_headers(
   29         -
    input: &crate::operation::malformed_boolean::MalformedBooleanInput,
   30         -
    mut builder: ::http_1x::request::Builder,
   31         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   32         -
    if let ::std::option::Option::Some(inner_1) = &input.boolean_in_header {
   33         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
   34         -
        let formatted_2 = encoder.encode();
   35         -
        let header_value = formatted_2;
   36         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   37         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   38         -
                "boolean_in_header",
   39         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   40         -
            )
   41         -
        })?;
   42         -
        builder = builder.header("booleanInHeader", header_value);
   43         -
    }
   44         -
    Ok(builder)
   45         -
}
   46         -
   47         -
pub fn ser_malformed_boolean_input(
   48         -
    input: &crate::operation::malformed_boolean::MalformedBooleanInput,
   49         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   50         -
    let mut out = String::new();
   51         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   52         -
    crate::protocol_serde::shape_malformed_boolean_input::ser_malformed_boolean_input_input(&mut object, input)?;
   53         -
    object.finish();
   54         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   55         -
}

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

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

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

@@ -1,0 +55,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_malformed_byte_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::malformed_byte::MalformedByteOutput, crate::operation::malformed_byte::MalformedByteError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::malformed_byte::MalformedByteError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::malformed_byte::MalformedByteError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_malformed_byte_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::malformed_byte::MalformedByteOutput, crate::operation::malformed_byte::MalformedByteError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::malformed_byte::builders::MalformedByteOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}
   27         -
   28         -
pub fn ser_malformed_byte_headers(
   29         -
    input: &crate::operation::malformed_byte::MalformedByteInput,
   30         -
    mut builder: ::http_1x::request::Builder,
   31         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   32         -
    if let ::std::option::Option::Some(inner_1) = &input.byte_in_header {
   33         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
   34         -
        let formatted_2 = encoder.encode();
   35         -
        let header_value = formatted_2;
   36         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   37         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   38         -
                "byte_in_header",
   39         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   40         -
            )
   41         -
        })?;
   42         -
        builder = builder.header("byteInHeader", header_value);
   43         -
    }
   44         -
    Ok(builder)
   45         -
}
   46         -
   47         -
pub fn ser_malformed_byte_input(
   48         -
    input: &crate::operation::malformed_byte::MalformedByteInput,
   49         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   50         -
    let mut out = String::new();
   51         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   52         -
    crate::protocol_serde::shape_malformed_byte_input::ser_malformed_byte_input_input(&mut object, input)?;
   53         -
    object.finish();
   54         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   55         -
}

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_malformed_byte_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::malformed_byte::MalformedByteInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.byte_in_body {
    7         -
        object.key("byteInBody").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    Ok(())
   13         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_with_body.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_malformed_content_type_with_body_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::malformed_content_type_with_body::MalformedContentTypeWithBodyOutput,
    9         -
    crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyError,
   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::malformed_content_type_with_body::MalformedContentTypeWithBodyError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_malformed_content_type_with_body_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::malformed_content_type_with_body::MalformedContentTypeWithBodyOutput,
   25         -
    crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::malformed_content_type_with_body::builders::MalformedContentTypeWithBodyOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_malformed_content_type_with_body_input(
   35         -
    input: &crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyInput,
   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_malformed_content_type_with_body_input::ser_malformed_content_type_with_body_input_input(&mut object, input)?;
   40         -
    object.finish();
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   42         -
}