Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_capture_pokemon.rs

@@ -1,1 +121,0 @@
   13     13   
        #[allow(unused_mut)]
   14     14   
        let mut output = crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder::default();
   15     15   
        output = output.set_events(Some(crate::protocol_serde::shape_capture_pokemon_output::de_events_payload(
   16     16   
            _response_body,
   17     17   
        )?));
   18     18   
        output
   19     19   
            .build()
   20     20   
            .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   21     21   
    })
   22     22   
}
   23         -
   24         -
#[allow(clippy::unnecessary_wraps)]
   25         -
pub fn de_capture_pokemon_http_error(
   26         -
    _response_status: u16,
   27         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   28         -
    _response_body: &[u8],
   29         -
) -> std::result::Result<crate::operation::capture_pokemon::CapturePokemonOutput, crate::operation::capture_pokemon::CapturePokemonError> {
   30         -
    #[allow(unused_mut)]
   31         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   32         -
        .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   33         -
    let generic = generic_builder.build();
   34         -
    let error_code = match generic.code() {
   35         -
        Some(code) => code,
   36         -
        None => return Err(crate::operation::capture_pokemon::CapturePokemonError::unhandled(generic)),
   37         -
    };
   38         -
   39         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   40         -
    Err(match error_code {
   41         -
        "UnsupportedRegionError" => crate::operation::capture_pokemon::CapturePokemonError::UnsupportedRegionError({
   42         -
            #[allow(unused_mut)]
   43         -
            let mut tmp = {
   44         -
                #[allow(unused_mut)]
   45         -
                let mut output = crate::types::error::builders::UnsupportedRegionErrorBuilder::default();
   46         -
                output = crate::protocol_serde::shape_unsupported_region_error::de_unsupported_region_error_json_err(_response_body, output)
   47         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   48         -
                let output = output.meta(generic);
   49         -
                crate::serde_util::unsupported_region_error_correct_errors(output)
   50         -
                    .build()
   51         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   52         -
            };
   53         -
            if tmp.message.is_none() {
   54         -
                tmp.message = _error_message;
   55         -
            }
   56         -
            tmp
   57         -
        }),
   58         -
        "ThrottlingError" => crate::operation::capture_pokemon::CapturePokemonError::ThrottlingError({
   59         -
            #[allow(unused_mut)]
   60         -
            let mut tmp = {
   61         -
                #[allow(unused_mut)]
   62         -
                let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default();
   63         -
                output = crate::protocol_serde::shape_throttling_error::de_throttling_error_json_err(_response_body, output)
   64         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   65         -
                let output = output.meta(generic);
   66         -
                output.build()
   67         -
            };
   68         -
            if tmp.message.is_none() {
   69         -
                tmp.message = _error_message;
   70         -
            }
   71         -
            tmp
   72         -
        }),
   73         -
        "ValidationException" => crate::operation::capture_pokemon::CapturePokemonError::ValidationError({
   74         -
            #[allow(unused_mut)]
   75         -
            let mut tmp = {
   76         -
                #[allow(unused_mut)]
   77         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   78         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   79         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   80         -
                let output = output.meta(generic);
   81         -
                crate::serde_util::validation_exception_correct_errors(output)
   82         -
                    .build()
   83         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   84         -
            };
   85         -
            tmp
   86         -
        }),
   87         -
        "MasterBallUnsuccessful" => crate::operation::capture_pokemon::CapturePokemonError::MasterBallUnsuccessful({
   88         -
            #[allow(unused_mut)]
   89         -
            let mut tmp = {
   90         -
                #[allow(unused_mut)]
   91         -
                let mut output = crate::types::error::builders::MasterBallUnsuccessfulBuilder::default();
   92         -
                output = crate::protocol_serde::shape_master_ball_unsuccessful::de_master_ball_unsuccessful_json_err(_response_body, output)
   93         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   94         -
                let output = output.meta(generic);
   95         -
                output.build()
   96         -
            };
   97         -
            if tmp.message.is_none() {
   98         -
                tmp.message = _error_message;
   99         -
            }
  100         -
            tmp
  101         -
        }),
  102         -
        "InvalidPokeballError" => crate::operation::capture_pokemon::CapturePokemonError::InvalidPokeballError({
  103         -
            #[allow(unused_mut)]
  104         -
            let mut tmp = {
  105         -
                #[allow(unused_mut)]
  106         -
                let mut output = crate::types::error::builders::InvalidPokeballErrorBuilder::default();
  107         -
                output = crate::protocol_serde::shape_invalid_pokeball_error::de_invalid_pokeball_error_json_err(_response_body, output)
  108         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
  109         -
                let output = output.meta(generic);
  110         -
                crate::serde_util::invalid_pokeball_error_correct_errors(output)
  111         -
                    .build()
  112         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
  113         -
            };
  114         -
            if tmp.message.is_none() {
  115         -
                tmp.message = _error_message;
  116         -
            }
  117         -
            tmp
  118         -
        }),
  119         -
        _ => crate::operation::capture_pokemon::CapturePokemonError::generic(generic),
  120         -
    })
  121         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_check_health.rs

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_check_health_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::check_health::CheckHealthOutput, crate::operation::check_health::CheckHealthError> {
    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::check_health::CheckHealthError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::check_health::CheckHealthError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_check_health_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::check_health::CheckHealthOutput, crate::operation::check_health::CheckHealthError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::check_health::builders::CheckHealthOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}
   27         -
   28         -
pub fn ser_check_health_input(
   29         -
    _input: &crate::operation::check_health::CheckHealthInput,
   30         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   31         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   32         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_do_nothing.rs

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_do_nothing_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::do_nothing::DoNothingOutput, crate::operation::do_nothing::DoNothingError> {
    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::do_nothing::DoNothingError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::do_nothing::DoNothingError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_do_nothing_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::do_nothing::DoNothingOutput, crate::operation::do_nothing::DoNothingError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::do_nothing::builders::DoNothingOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}
   27         -
   28         -
pub fn ser_do_nothing_input(
   29         -
    _input: &crate::operation::do_nothing::DoNothingInput,
   30         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   31         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   32         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_get_server_statistics.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_master_ball_unsuccessful.rs

@@ -1,1 +55,20 @@
    2      2   
pub fn ser_master_ball_unsuccessful_error(
    3      3   
    value: &crate::types::error::MasterBallUnsuccessful,
    4      4   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
    5      5   
    let mut out = ::std::string::String::new();
    6      6   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
    7      7   
    crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful(&mut object, value)?;
    8      8   
    object.finish();
    9      9   
    Ok(out)
   10     10   
}
   11     11   
   12         -
pub(crate) fn de_master_ball_unsuccessful_json_err(
   13         -
    _value: &[u8],
   14         -
    mut builder: crate::types::error::builders::MasterBallUnsuccessfulBuilder,
   15         -
) -> ::std::result::Result<crate::types::error::builders::MasterBallUnsuccessfulBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   16         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   17         -
    let tokens = &mut tokens_owned;
   18         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   19         -
    loop {
   20         -
        match tokens.next().transpose()? {
   21         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   23         -
                "message" => {
   24         -
                    builder = builder.set_message(
   25         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   26         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   27         -
                            .transpose()?,
   28         -
                    );
   29         -
                }
   30         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   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         -
    if tokens.next().is_some() {
   40         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41         -
            "found more JSON tokens after completing parsing",
   42         -
        ));
   43         -
    }
   44         -
    Ok(builder)
   45         -
}
   46         -
   47     12   
pub fn ser_master_ball_unsuccessful(
   48     13   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   49     14   
    input: &crate::types::error::MasterBallUnsuccessful,
   50     15   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   51     16   
    if let Some(var_1) = &input.message {
   52     17   
        object.key("message").string(var_1.as_str());
   53     18   
    }
   54     19   
    Ok(())
   55     20   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_unsupported_region_error.rs

@@ -1,0 +42,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_unsupported_region_error_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::UnsupportedRegionErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::UnsupportedRegionErrorBuilder, ::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         -
                "region" => {
   14         -
                    builder = builder.set_region(
   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         -
                "Message" => {
   21         -
                    builder = builder.set_message(
   22         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   23         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   24         -
                            .transpose()?,
   25         -
                    );
   26         -
                }
   27         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   28         -
            },
   29         -
            other => {
   30         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   31         -
                    "expected object key or end object, found: {other:?}"
   32         -
                )))
   33         -
            }
   34         -
        }
   35         -
    }
   36         -
    if tokens.next().is_some() {
   37         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38         -
            "found more JSON tokens after completing parsing",
   39         -
        ));
   40         -
    }
   41         -
    Ok(builder)
   42         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_validation_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ValidationErrorBuilder, ::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         -
                "fieldList" => {
   21         -
                    builder = builder.set_field_list(
   22         -
                        crate::protocol_serde::shape_validation_exception_field_list::de_validation_exception_field_list(tokens, _value)?,
   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         -
    if tokens.next().is_some() {
   35         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "found more JSON tokens after completing parsing",
   37         -
        ));
   38         -
    }
   39         -
    Ok(builder)
   40         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_validation_exception_field.rs

@@ -1,0 +51,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_validation_exception_field<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ValidationExceptionField>, ::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::ValidationExceptionFieldBuilder::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         -
                        "path" => {
   19         -
                            builder = builder.set_path(
   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         -
                        "message" => {
   26         -
                            builder = builder.set_message(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
                    },
   34         -
                    other => {
   35         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36         -
                            "expected object key or end object, found: {other:?}"
   37         -
                        )))
   38         -
                    }
   39         -
                }
   40         -
            }
   41         -
            Ok(Some(
   42         -
                crate::serde_util::validation_exception_field_correct_errors(builder)
   43         -
                    .build()
   44         -
                    .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
   45         -
            ))
   46         -
        }
   47         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
            "expected start object or null",
   49         -
        )),
   50         -
    }
   51         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_validation_exception_field_list.rs

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_validation_exception_field_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::ValidationExceptionField>>, ::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 = crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens, _value)?;
   21         -
                        if let Some(value) = value {
   22         -
                            items.push(value);
   23         -
                        } else {
   24         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25         -
                                "dense list cannot contain null values",
   26         -
                            ));
   27         -
                        }
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(items))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start array or null",
   35         -
        )),
   36         -
    }
   37         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/serde_util.rs

@@ -1,1 +48,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn unsupported_region_error_correct_errors(
    3         -
    mut builder: crate::types::error::builders::UnsupportedRegionErrorBuilder,
    4         -
) -> crate::types::error::builders::UnsupportedRegionErrorBuilder {
    5         -
    if builder.region.is_none() {
    6         -
        builder.region = Some(Default::default())
    7         -
    }
    8         -
    builder
    9         -
}
   10         -
   11         -
pub(crate) fn validation_exception_correct_errors(
   12         -
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
   13         -
) -> crate::types::error::builders::ValidationErrorBuilder {
   14         -
    if builder.message.is_none() {
   15         -
        builder.message = Some(Default::default())
   16         -
    }
   17         -
    builder
   18         -
}
   19         -
   20      2   
pub(crate) fn invalid_pokeball_error_correct_errors(
   21      3   
    mut builder: crate::types::error::builders::InvalidPokeballErrorBuilder,
   22      4   
) -> crate::types::error::builders::InvalidPokeballErrorBuilder {
   23      5   
    if builder.pokeball.is_none() {
   24      6   
        builder.pokeball = Some(Default::default())
   25      7   
    }
   26      8   
    builder
   27      9   
}
   28         -
   29         -
pub(crate) fn get_server_statistics_output_output_correct_errors(
   30         -
    mut builder: crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder,
   31         -
) -> crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder {
   32         -
    if builder.calls_count.is_none() {
   33         -
        builder.calls_count = Some(Default::default())
   34         -
    }
   35         -
    builder
   36         -
}
   37         -
   38         -
pub(crate) fn validation_exception_field_correct_errors(
   39         -
    mut builder: crate::types::builders::ValidationExceptionFieldBuilder,
   40         -
) -> crate::types::builders::ValidationExceptionFieldBuilder {
   41         -
    if builder.path.is_none() {
   42         -
        builder.path = Some(Default::default())
   43         -
    }
   44         -
    if builder.message.is_none() {
   45         -
        builder.message = Some(Default::default())
   46         -
    }
   47         -
    builder
   48         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/serialization_settings.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/types/_attempt_capturing_pokemon_event.rs

@@ -8,8 +0,94 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`Event`](crate::types::AttemptCapturingPokemonEvent::Event).
   30     30   
    pub fn is_event(&self) -> bool {
   31     31   
        self.as_event().is_ok()
   32     32   
    }
   33     33   
    /// Returns true if the enum instance is the `Unknown` variant.
   34     34   
    pub fn is_unknown(&self) -> bool {
   35     35   
        matches!(self, Self::Unknown)
   36     36   
    }
   37     37   
}
          38  +
static ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
          39  +
    "com.aws.example#AttemptCapturingPokemonEvent",
          40  +
    "com.aws.example",
          41  +
    "AttemptCapturingPokemonEvent",
          42  +
);
          43  +
static ATTEMPTCAPTURINGPOKEMONEVENT_MEMBER_EVENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_static(
          45  +
        "com.aws.example#AttemptCapturingPokemonEvent$event",
          46  +
        "com.aws.example",
          47  +
        "AttemptCapturingPokemonEvent",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::Structure,
          50  +
    "event",
          51  +
    0,
          52  +
);
          53  +
static ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          54  +
    ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA_ID,
          55  +
    ::aws_smithy_schema::ShapeType::Union,
          56  +
    &[&ATTEMPTCAPTURINGPOKEMONEVENT_MEMBER_EVENT],
          57  +
)
          58  +
.with_streaming();
          59  +
impl AttemptCapturingPokemonEvent {
          60  +
    /// The schema for this shape.
          61  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA;
          62  +
}
          63  +
impl ::aws_smithy_schema::serde::SerializableStruct for AttemptCapturingPokemonEvent {
          64  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          65  +
    fn serialize_members(
          66  +
        &self,
          67  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          68  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          69  +
        match self {
          70  +
            Self::Event(val) => {
          71  +
                ser.write_struct(&ATTEMPTCAPTURINGPOKEMONEVENT_MEMBER_EVENT, val)?;
          72  +
            }
          73  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          74  +
        }
          75  +
        Ok(())
          76  +
    }
          77  +
}
          78  +
impl AttemptCapturingPokemonEvent {
          79  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          80  +
    pub fn deserialize(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          83  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          84  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          85  +
        deserializer.read_struct(&ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA, &mut |member, deser| {
          86  +
            result = ::std::option::Option::Some(match member.member_index() {
          87  +
                Some(0) => Self::Event(crate::types::CapturingEvent::deserialize(deser)?),
          88  +
                _ => Self::Unknown,
          89  +
            });
          90  +
            Ok(())
          91  +
        })?;
          92  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
          93  +
    }
          94  +
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/types/_capture_event.rs

@@ -70,70 +162,173 @@
   90     90   
            ser.write_boolean(&CAPTUREEVENT_MEMBER_SHINY, *val)?;
   91     91   
        }
   92     92   
        if let Some(ref val) = self.pokedex_update {
   93     93   
            ser.write_blob(&CAPTUREEVENT_MEMBER_POKEDEX_UPDATE, val)?;
   94     94   
        }
   95     95   
        Ok(())
   96     96   
    }
   97     97   
}
   98     98   
impl CaptureEvent {
   99     99   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  100         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  101         -
        deserializer: &mut D,
         100  +
    pub fn deserialize(
         101  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  102    102   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  103    103   
        #[allow(unused_variables, unused_mut)]
  104    104   
        let mut builder = Self::builder();
  105    105   
        #[allow(
  106    106   
            unused_variables,
  107    107   
            unreachable_code,
  108    108   
            clippy::single_match,
  109    109   
            clippy::match_single_binding,
  110    110   
            clippy::diverging_sub_expression
  111    111   
        )]
  112         -
        deserializer.read_struct(&CAPTUREEVENT_SCHEMA, (), |_, member, deser| {
         112  +
        deserializer.read_struct(&CAPTUREEVENT_SCHEMA, &mut |member, deser| {
  113    113   
            match member.member_index() {
  114    114   
                Some(0) => {
  115    115   
                    builder.name = Some(deser.read_string(member)?);
  116    116   
                }
  117    117   
                Some(1) => {
  118    118   
                    builder.captured = Some(deser.read_boolean(member)?);
  119    119   
                }
  120    120   
                Some(2) => {
  121    121   
                    builder.shiny = Some(deser.read_boolean(member)?);
  122    122   
                }
  123    123   
                Some(3) => {
  124    124   
                    builder.pokedex_update = Some(deser.read_blob(member)?);
  125    125   
                }
  126    126   
                _ => {}
  127    127   
            }
  128    128   
            Ok(())
  129    129   
        })?;
  130    130   
        Ok(builder.build())
  131    131   
    }
  132    132   
}
         133  +
impl CaptureEvent {
         134  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         135  +
    pub fn deserialize_with_response(
         136  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         137  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         138  +
        _status: u16,
         139  +
        _body: &[u8],
         140  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         141  +
        Self::deserialize(deserializer)
         142  +
    }
         143  +
}
  133    144   
impl CaptureEvent {
  134    145   
    /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::types::CaptureEvent).
  135    146   
    pub fn builder() -> crate::types::builders::CaptureEventBuilder {
  136    147   
        crate::types::builders::CaptureEventBuilder::default()
  137    148   
    }
  138    149   
}
  139    150   
  140    151   
/// A builder for [`CaptureEvent`](crate::types::CaptureEvent).
  141    152   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  142    153   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/types/_capture_pokemon_events.rs

@@ -8,8 +0,87 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`Event`](crate::types::CapturePokemonEvents::Event).
   30     30   
    pub fn is_event(&self) -> bool {
   31     31   
        self.as_event().is_ok()
   32     32   
    }
   33     33   
    /// Returns true if the enum instance is the `Unknown` variant.
   34     34   
    pub fn is_unknown(&self) -> bool {
   35     35   
        matches!(self, Self::Unknown)
   36     36   
    }
   37     37   
}
          38  +
static CAPTUREPOKEMONEVENTS_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
          39  +
    ::aws_smithy_schema::ShapeId::from_static("com.aws.example#CapturePokemonEvents", "com.aws.example", "CapturePokemonEvents");
          40  +
static CAPTUREPOKEMONEVENTS_MEMBER_EVENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_static("com.aws.example#CapturePokemonEvents$event", "com.aws.example", "CapturePokemonEvents"),
          42  +
    ::aws_smithy_schema::ShapeType::Structure,
          43  +
    "event",
          44  +
    0,
          45  +
);
          46  +
static CAPTUREPOKEMONEVENTS_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          47  +
    CAPTUREPOKEMONEVENTS_SCHEMA_ID,
          48  +
    ::aws_smithy_schema::ShapeType::Union,
          49  +
    &[&CAPTUREPOKEMONEVENTS_MEMBER_EVENT],
          50  +
)
          51  +
.with_streaming();
          52  +
impl CapturePokemonEvents {
          53  +
    /// The schema for this shape.
          54  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CAPTUREPOKEMONEVENTS_SCHEMA;
          55  +
}
          56  +
impl ::aws_smithy_schema::serde::SerializableStruct for CapturePokemonEvents {
          57  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          58  +
    fn serialize_members(
          59  +
        &self,
          60  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          61  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          62  +
        match self {
          63  +
            Self::Event(val) => {
          64  +
                ser.write_struct(&CAPTUREPOKEMONEVENTS_MEMBER_EVENT, val)?;
          65  +
            }
          66  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          67  +
        }
          68  +
        Ok(())
          69  +
    }
          70  +
}
          71  +
impl CapturePokemonEvents {
          72  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          73  +
    pub fn deserialize(
          74  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          75  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          76  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          77  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          78  +
        deserializer.read_struct(&CAPTUREPOKEMONEVENTS_SCHEMA, &mut |member, deser| {
          79  +
            result = ::std::option::Option::Some(match member.member_index() {
          80  +
                Some(0) => Self::Event(crate::types::CaptureEvent::deserialize(deser)?),
          81  +
                _ => Self::Unknown,
          82  +
            });
          83  +
            Ok(())
          84  +
        })?;
          85  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
          86  +
    }
          87  +
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/types/_capturing_event.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/types/_capturing_payload.rs

@@ -31,31 +117,128 @@
   51     51   
            ser.write_string(&CAPTURINGPAYLOAD_MEMBER_NAME, val)?;
   52     52   
        }
   53     53   
        if let Some(ref val) = self.pokeball {
   54     54   
            ser.write_string(&CAPTURINGPAYLOAD_MEMBER_POKEBALL, val)?;
   55     55   
        }
   56     56   
        Ok(())
   57     57   
    }
   58     58   
}
   59     59   
impl CapturingPayload {
   60     60   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   61         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   62         -
        deserializer: &mut D,
          61  +
    pub fn deserialize(
          62  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   63     63   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        #[allow(unused_variables, unused_mut)]
   65     65   
        let mut builder = Self::builder();
   66     66   
        #[allow(
   67     67   
            unused_variables,
   68     68   
            unreachable_code,
   69     69   
            clippy::single_match,
   70     70   
            clippy::match_single_binding,
   71     71   
            clippy::diverging_sub_expression
   72     72   
        )]
   73         -
        deserializer.read_struct(&CAPTURINGPAYLOAD_SCHEMA, (), |_, member, deser| {
          73  +
        deserializer.read_struct(&CAPTURINGPAYLOAD_SCHEMA, &mut |member, deser| {
   74     74   
            match member.member_index() {
   75     75   
                Some(0) => {
   76     76   
                    builder.name = Some(deser.read_string(member)?);
   77     77   
                }
   78     78   
                Some(1) => {
   79     79   
                    builder.pokeball = Some(deser.read_string(member)?);
   80     80   
                }
   81     81   
                _ => {}
   82     82   
            }
   83     83   
            Ok(())
   84     84   
        })?;
   85     85   
        Ok(builder.build())
   86     86   
    }
   87     87   
}
          88  +
impl CapturingPayload {
          89  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          90  +
    pub fn deserialize_with_response(
          91  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          92  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          93  +
        _status: u16,
          94  +
        _body: &[u8],
          95  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          96  +
        Self::deserialize(deserializer)
          97  +
    }
          98  +
}
   88     99   
impl CapturingPayload {
   89    100   
    /// Creates a new builder-style object to manufacture [`CapturingPayload`](crate::types::CapturingPayload).
   90    101   
    pub fn builder() -> crate::types::builders::CapturingPayloadBuilder {
   91    102   
        crate::types::builders::CapturingPayloadBuilder::default()
   92    103   
    }
   93    104   
}
   94    105   
   95    106   
/// A builder for [`CapturingPayload`](crate::types::CapturingPayload).
   96    107   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   97    108   
#[non_exhaustive]